mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 09:58:55 +08:00
Return sucess for zeCommandListAppendMemAdvise when not supported
zeCommandListAppendMemAdvise is a performance hint, so on error, we can just return success, while at the same time ignoring it. Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f20cdac7d3
commit
7363b3fc09
@@ -792,9 +792,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemAdvise(ze_device_hand
|
||||
}
|
||||
|
||||
auto alloc = allocData->gpuAllocations.getGraphicsAllocation(deviceImp->getRootDeviceIndex());
|
||||
if (!memoryManager->setMemAdvise(alloc, flags, deviceImp->getRootDeviceIndex())) {
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
memoryManager->setMemAdvise(alloc, flags, deviceImp->getRootDeviceIndex());
|
||||
|
||||
deviceImp->memAdviseSharedAllocations[allocData] = flags;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
@@ -118,7 +118,7 @@ TEST_F(CommandListCreate, givenNonExistingPtrThenAppendMemoryPrefetchReturnsErro
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, res);
|
||||
}
|
||||
|
||||
TEST_F(CommandListCreate, givenValidPtrWhenAppendMemAdviseFailsThenReturnError) {
|
||||
TEST_F(CommandListCreate, givenValidPtrWhenAppendMemAdviseFailsThenReturnSuccess) {
|
||||
size_t size = 10;
|
||||
size_t alignment = 1u;
|
||||
void *ptr = nullptr;
|
||||
@@ -138,7 +138,7 @@ TEST_F(CommandListCreate, givenValidPtrWhenAppendMemAdviseFailsThenReturnError)
|
||||
memoryManager->failSetMemAdvise = true;
|
||||
|
||||
res = commandList->appendMemAdvise(device, ptr, size, ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION);
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, res);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
res = context->freeMem(ptr);
|
||||
ASSERT_EQ(res, ZE_RESULT_SUCCESS);
|
||||
|
||||
Reference in New Issue
Block a user