refactor: Correct status return in getExternalMemoryProperties

In TBX mode, getExternalMemoryProperties was returning an incorrect status
The status returns have been corrected to ensure proper functionality.

Related-To: HSD-18041313876
Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
This commit is contained in:
Marcel Skierkowski
2025-02-06 11:35:35 +00:00
committed by Compute-Runtime-Automation
parent c645f84663
commit fcb59152ba
2 changed files with 5 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -63,10 +63,8 @@ ze_result_t DeviceImp::getExternalMemoryProperties(ze_device_external_memory_pro
pExternalMemoryProperties->memoryAllocationExportTypes = ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF;
pExternalMemoryProperties->memoryAllocationImportTypes = ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF;
}
return ZE_RESULT_SUCCESS;
}
return ZE_RESULT_ERROR_UNINITIALIZED;
return ZE_RESULT_SUCCESS;
}
} // namespace L0

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -132,11 +132,11 @@ struct DeviceExtensionTest : public ::testing::Test {
const uint32_t rootDeviceIndex = 0u;
};
TEST_F(DeviceExtensionTest, whenGetExternalMemoryPropertiesWithoutOsInterfaceIsCalledThenUnitializedIsReturnedAndNoPropertiesAreSet) {
TEST_F(DeviceExtensionTest, whenGetExternalMemoryPropertiesWithoutOsInterfaceIsCalledThenSuccessIsReturnedAndNoPropertiesAreSet) {
ze_device_external_memory_properties_t externalMemoryProperties{};
ze_result_t result = device->getExternalMemoryProperties(&externalMemoryProperties);
EXPECT_EQ(ZE_RESULT_ERROR_UNINITIALIZED, result);
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
EXPECT_FALSE(externalMemoryProperties.imageExportTypes & ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32);
EXPECT_FALSE(externalMemoryProperties.imageExportTypes & ZE_EXTERNAL_MEMORY_TYPE_FLAG_DMA_BUF);
EXPECT_FALSE(externalMemoryProperties.imageImportTypes & ZE_EXTERNAL_MEMORY_TYPE_FLAG_OPAQUE_WIN32);