[25/n] Internal 4GB allocator.

- Do not obtain pattern allocation from reusable pool.
- This is due to the fact that it may contain allocations from internal
heap, which cannot be used for arguments declared as kernel argument.

Change-Id: I6c73445c409edc4ce25f8d8eba966f512dfd6cc9
This commit is contained in:
Mrozek, Michal
2018-03-30 12:47:52 +02:00
committed by sys_ocldev
parent 9700c9bc42
commit e4c25f11de
2 changed files with 21 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -45,14 +45,8 @@ cl_int CommandQueueHw<GfxFamily>::enqueueFillBuffer(
cl_event *event) {
auto memoryManager = getDevice().getMemoryManager();
DEBUG_BREAK_IF(nullptr == memoryManager);
TakeOwnershipWrapper<Device> deviceOwnership(getDevice());
auto patternAllocation = memoryManager->obtainReusableAllocation(patternSize).release();
deviceOwnership.unlock();
if (!patternAllocation) {
patternAllocation = memoryManager->allocateGraphicsMemory(alignUp(patternSize, MemoryConstants::cacheLineSize), MemoryConstants::preferredAlignment);
}
auto patternAllocation = memoryManager->allocateGraphicsMemory(alignUp(patternSize, MemoryConstants::cacheLineSize), MemoryConstants::preferredAlignment);
patternAllocation->setAllocationType(GraphicsAllocation::ALLOCATION_TYPE_FILL_PATTERN);
if (patternSize == 1) {
@@ -93,7 +87,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueFillBuffer(
eventWaitList,
event);
memoryManager->storeAllocation(std::unique_ptr<GraphicsAllocation>(patternAllocation), REUSABLE_ALLOCATION, taskCount);
memoryManager->storeAllocation(std::unique_ptr<GraphicsAllocation>(patternAllocation), TEMPORARY_ALLOCATION, taskCount);
builder.releaseOwnership();