mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Require same allocation type when obtaining reusable allocation
Change-Id: I829301b83a6214bcfb4fc9f2692f21ae9a002456 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
395d053f02
commit
ce4a75e121
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -209,14 +209,13 @@ LinearStream &CommandQueue::getCS(size_t minRequiredSize) {
|
||||
|
||||
auto requiredSize = minRequiredSize + CSRequirements::csOverfetchSize;
|
||||
|
||||
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, false).release();
|
||||
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
|
||||
GraphicsAllocation *allocation = storageForAllocation->obtainReusableAllocation(requiredSize, allocationType).release();
|
||||
|
||||
if (!allocation) {
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
|
||||
allocation = memoryManager->allocateGraphicsMemoryWithProperties({requiredSize, allocationType});
|
||||
}
|
||||
|
||||
allocation->setAllocationType(GraphicsAllocation::AllocationType::LINEAR_STREAM);
|
||||
|
||||
// Deallocate the old block, if not null
|
||||
auto oldAllocation = commandStream->getGraphicsAllocation();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -224,15 +224,14 @@ cl_int CommandQueueHw<GfxFamily>::enqueueSVMMemFill(void *svmPtr,
|
||||
|
||||
auto commandStreamReceieverOwnership = getCommandStreamReceiver().obtainUniqueOwnership();
|
||||
auto storageWithAllocations = getCommandStreamReceiver().getInternalAllocationStorage();
|
||||
auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, false).release();
|
||||
auto allocationType = GraphicsAllocation::AllocationType::FILL_PATTERN;
|
||||
auto patternAllocation = storageWithAllocations->obtainReusableAllocation(patternSize, allocationType).release();
|
||||
commandStreamReceieverOwnership.unlock();
|
||||
|
||||
if (!patternAllocation) {
|
||||
patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({patternSize, GraphicsAllocation::AllocationType::FILL_PATTERN});
|
||||
patternAllocation = memoryManager->allocateGraphicsMemoryWithProperties({patternSize, allocationType});
|
||||
}
|
||||
|
||||
patternAllocation->setAllocationType(GraphicsAllocation::AllocationType::FILL_PATTERN);
|
||||
|
||||
if (patternSize == 1) {
|
||||
int patternInt = (uint32_t)((*(uint8_t *)pattern << 24) | (*(uint8_t *)pattern << 16) | (*(uint8_t *)pattern << 8) | *(uint8_t *)pattern);
|
||||
memcpy_s(patternAllocation->getUnderlyingBuffer(), sizeof(int), &patternInt, sizeof(int));
|
||||
|
||||
Reference in New Issue
Block a user