fix: correct naming of zer functions

zerDriverGetDefaultContext -> zerGetDefaultContext
zerDriverGetLastErrorDescription -> zerGetLastErrorDesription
zerDeviceTranslateToIdentifier -> zerTranslateDeviceHandleToIdentifier
zerIdentifierTranslateToDeviceHandle -> zerTranslateIdentifierToDeviceHandle

Related-To: NEO-14560

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-08-01 14:25:22 +00:00
committed by Compute-Runtime-Automation
parent b7a73653a2
commit ee5cd678ea
9 changed files with 60 additions and 60 deletions

View File

@@ -159,7 +159,7 @@ ze_result_t zeDeviceGetVectorWidthPropertiesExt(
return L0::Device::fromHandle(hDevice)->getVectorWidthPropertiesExt(pCount, pVectorWidthProperties); return L0::Device::fromHandle(hDevice)->getVectorWidthPropertiesExt(pCount, pVectorWidthProperties);
} }
uint32_t zerDeviceTranslateToIdentifier(ze_device_handle_t device) { uint32_t zerTranslateDeviceHandleToIdentifier(ze_device_handle_t device) {
if (!device) { if (!device) {
auto driverHandle = static_cast<L0::DriverHandleImp *>(L0::globalDriverHandles->front()); auto driverHandle = static_cast<L0::DriverHandleImp *>(L0::globalDriverHandles->front());
driverHandle->setErrorDescription("Invalid device handle"); driverHandle->setErrorDescription("Invalid device handle");
@@ -168,7 +168,7 @@ uint32_t zerDeviceTranslateToIdentifier(ze_device_handle_t device) {
return L0::Device::fromHandle(device)->getIdentifier(); return L0::Device::fromHandle(device)->getIdentifier();
} }
ze_device_handle_t zerIdentifierTranslateToDeviceHandle(uint32_t identifier) { ze_device_handle_t zerTranslateIdentifierToDeviceHandle(uint32_t identifier) {
auto driverHandle = static_cast<L0::DriverHandleImp *>(L0::globalDriverHandles->front()); auto driverHandle = static_cast<L0::DriverHandleImp *>(L0::globalDriverHandles->front());
if (identifier >= driverHandle->devicesToExpose.size()) { if (identifier >= driverHandle->devicesToExpose.size()) {
driverHandle->setErrorDescription("Invalid device identifier"); driverHandle->setErrorDescription("Invalid device identifier");
@@ -364,12 +364,12 @@ ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetVectorWidthPropertiesExt(
return L0::zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties); return L0::zeDeviceGetVectorWidthPropertiesExt(hDevice, pCount, pVectorWidthProperties);
} }
uint32_t ZE_APICALL zerDeviceTranslateToIdentifier(ze_device_handle_t device) { uint32_t ZE_APICALL zerTranslateDeviceHandleToIdentifier(ze_device_handle_t device) {
return L0::zerDeviceTranslateToIdentifier(device); return L0::zerTranslateDeviceHandleToIdentifier(device);
} }
ze_device_handle_t ZE_APICALL zerIdentifierTranslateToDeviceHandle(uint32_t identifier) { ze_device_handle_t ZE_APICALL zerTranslateIdentifierToDeviceHandle(uint32_t identifier) {
return L0::zerIdentifierTranslateToDeviceHandle(identifier); return L0::zerTranslateIdentifierToDeviceHandle(identifier);
} }
ze_result_t ZE_APICALL zeDeviceSynchronize(ze_device_handle_t hDevice) { ze_result_t ZE_APICALL zeDeviceSynchronize(ze_device_handle_t hDevice) {

View File

@@ -71,11 +71,11 @@ ze_context_handle_t zeDriverGetDefaultContext(
return L0::DriverHandle::fromHandle(hDriver)->getDefaultContext(); return L0::DriverHandle::fromHandle(hDriver)->getDefaultContext();
} }
ze_context_handle_t zerDriverGetDefaultContext() { ze_context_handle_t zerGetDefaultContext() {
return L0::DriverHandle::fromHandle(L0::globalDriverHandles->front())->getDefaultContext(); return L0::DriverHandle::fromHandle(L0::globalDriverHandles->front())->getDefaultContext();
} }
ze_result_t zerDriverGetLastErrorDescription(const char **ppString) { ze_result_t zerGetLastErrorDescription(const char **ppString) {
return L0::DriverHandle::fromHandle(L0::globalDriverHandles->front())->getErrorDescription(ppString); return L0::DriverHandle::fromHandle(L0::globalDriverHandles->front())->getErrorDescription(ppString);
} }
} // namespace L0 } // namespace L0
@@ -158,10 +158,10 @@ ze_context_handle_t ZE_APICALL zeDriverGetDefaultContext(
return L0::zeDriverGetDefaultContext(hDriver); return L0::zeDriverGetDefaultContext(hDriver);
} }
ze_context_handle_t ZE_APICALL zerDriverGetDefaultContext() { ze_context_handle_t ZE_APICALL zerGetDefaultContext() {
return L0::zerDriverGetDefaultContext(); return L0::zerGetDefaultContext();
} }
ze_result_t ZE_APICALL zerDriverGetLastErrorDescription(const char **ppString) { ze_result_t ZE_APICALL zerGetLastErrorDescription(const char **ppString) {
return L0::zerDriverGetLastErrorDescription(ppString); return L0::zerGetLastErrorDescription(ppString);
} }
} }

View File

@@ -31,11 +31,11 @@ void *ExtensionFunctionAddressHelper::getExtensionFunctionAddress(const std::str
RETURN_FUNC_PTR_IF_EXIST(zexDriverReleaseImportedPointer); RETURN_FUNC_PTR_IF_EXIST(zexDriverReleaseImportedPointer);
RETURN_FUNC_PTR_IF_EXIST(zexDriverGetHostPointerBaseAddress); RETURN_FUNC_PTR_IF_EXIST(zexDriverGetHostPointerBaseAddress);
RETURN_FUNC_PTR_IF_EXIST(zeDriverGetDefaultContext); RETURN_FUNC_PTR_IF_EXIST(zeDriverGetDefaultContext);
RETURN_FUNC_PTR_IF_EXIST(zerDriverGetDefaultContext); RETURN_FUNC_PTR_IF_EXIST(zerGetDefaultContext);
RETURN_FUNC_PTR_IF_EXIST(zerDriverGetLastErrorDescription); RETURN_FUNC_PTR_IF_EXIST(zerGetLastErrorDescription);
RETURN_FUNC_PTR_IF_EXIST(zerDeviceTranslateToIdentifier); RETURN_FUNC_PTR_IF_EXIST(zerTranslateDeviceHandleToIdentifier);
RETURN_FUNC_PTR_IF_EXIST(zerIdentifierTranslateToDeviceHandle); RETURN_FUNC_PTR_IF_EXIST(zerTranslateIdentifierToDeviceHandle);
RETURN_FUNC_PTR_IF_EXIST(zeDeviceSynchronize); RETURN_FUNC_PTR_IF_EXIST(zeDeviceSynchronize);
RETURN_FUNC_PTR_IF_EXIST(zeDeviceGetPriorityLevels); RETURN_FUNC_PTR_IF_EXIST(zeDeviceGetPriorityLevels);

View File

@@ -19,12 +19,12 @@
#endif #endif
namespace LevelZeroBlackBoxTests { namespace LevelZeroBlackBoxTests {
decltype(&zerDriverGetDefaultContext) zerDriverGetDefaultContextFunc = nullptr; decltype(&zerGetDefaultContext) zerGetDefaultContextFunc = nullptr;
decltype(&zeDeviceSynchronize) zeDeviceSynchronizeFunc = nullptr; decltype(&zeDeviceSynchronize) zeDeviceSynchronizeFunc = nullptr;
decltype(&zeCommandListAppendLaunchKernelWithArguments) zeCommandListAppendLaunchKernelWithArgumentsFunc = nullptr; decltype(&zeCommandListAppendLaunchKernelWithArguments) zeCommandListAppendLaunchKernelWithArgumentsFunc = nullptr;
decltype(&zerIdentifierTranslateToDeviceHandle) zerIdentifierTranslateToDeviceHandleFunc = nullptr; decltype(&zerTranslateIdentifierToDeviceHandle) zerTranslateIdentifierToDeviceHandleFunc = nullptr;
decltype(&zerDeviceTranslateToIdentifier) zerDeviceTranslateToIdentifierFunc = nullptr; decltype(&zerTranslateDeviceHandleToIdentifier) zerTranslateDeviceHandleToIdentifierFunc = nullptr;
decltype(&zerDriverGetLastErrorDescription) zerDriverGetLastErrorDescriptionFunc = nullptr; decltype(&zerGetLastErrorDescription) zerGetLastErrorDescriptionFunc = nullptr;
struct LoadedDriverExtensions { struct LoadedDriverExtensions {
std::vector<ze_driver_extension_properties_t> extensions; std::vector<ze_driver_extension_properties_t> extensions;
@@ -458,14 +458,14 @@ std::vector<ze_device_handle_t> zelloInitContextAndGetDevices(ze_context_handle_
SUCCESS_OR_TERMINATE(zeDriverGet(&driverCount, &driverHandle)); SUCCESS_OR_TERMINATE(zeDriverGet(&driverCount, &driverHandle));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerDriverGetDefaultContext", reinterpret_cast<void **>(&zerDriverGetDefaultContextFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerGetDefaultContext", reinterpret_cast<void **>(&zerGetDefaultContextFunc)));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zeDeviceSynchronize", reinterpret_cast<void **>(&zeDeviceSynchronizeFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zeDeviceSynchronize", reinterpret_cast<void **>(&zeDeviceSynchronizeFunc)));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zeCommandListAppendLaunchKernelWithArguments", reinterpret_cast<void **>(&zeCommandListAppendLaunchKernelWithArgumentsFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zeCommandListAppendLaunchKernelWithArguments", reinterpret_cast<void **>(&zeCommandListAppendLaunchKernelWithArgumentsFunc)));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerIdentifierTranslateToDeviceHandle", reinterpret_cast<void **>(&zerIdentifierTranslateToDeviceHandleFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerTranslateIdentifierToDeviceHandle", reinterpret_cast<void **>(&zerTranslateIdentifierToDeviceHandleFunc)));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerDeviceTranslateToIdentifier", reinterpret_cast<void **>(&zerDeviceTranslateToIdentifierFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerTranslateDeviceHandleToIdentifier", reinterpret_cast<void **>(&zerTranslateDeviceHandleToIdentifierFunc)));
SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerDriverGetLastErrorDescription", reinterpret_cast<void **>(&zerDriverGetLastErrorDescriptionFunc))); SUCCESS_OR_TERMINATE(zeDriverGetExtensionFunctionAddress(driverHandle, "zerGetLastErrorDescription", reinterpret_cast<void **>(&zerGetLastErrorDescriptionFunc)));
context = zerDriverGetDefaultContextFunc(); context = zerGetDefaultContextFunc();
if (!context) { if (!context) {
const char *description = nullptr; const char *description = nullptr;
SUCCESS_OR_TERMINATE(zeDriverGetLastErrorDescription(driverHandle, &description)); SUCCESS_OR_TERMINATE(zeDriverGetLastErrorDescription(driverHandle, &description));

View File

@@ -22,12 +22,12 @@
namespace LevelZeroBlackBoxTests { namespace LevelZeroBlackBoxTests {
template <bool terminateOnFailure, typename ResulT> template <bool terminateOnFailure, typename ResulT>
inline void validate(ResulT result, const char *message); inline void validate(ResulT result, const char *message);
extern decltype(&zerDriverGetDefaultContext) zerDriverGetDefaultContextFunc; extern decltype(&zerGetDefaultContext) zerGetDefaultContextFunc;
extern decltype(&zeDeviceSynchronize) zeDeviceSynchronizeFunc; extern decltype(&zeDeviceSynchronize) zeDeviceSynchronizeFunc;
extern decltype(&zeCommandListAppendLaunchKernelWithArguments) zeCommandListAppendLaunchKernelWithArgumentsFunc; extern decltype(&zeCommandListAppendLaunchKernelWithArguments) zeCommandListAppendLaunchKernelWithArgumentsFunc;
extern decltype(&zerIdentifierTranslateToDeviceHandle) zerIdentifierTranslateToDeviceHandleFunc; extern decltype(&zerTranslateIdentifierToDeviceHandle) zerTranslateIdentifierToDeviceHandleFunc;
extern decltype(&zerDeviceTranslateToIdentifier) zerDeviceTranslateToIdentifierFunc; extern decltype(&zerTranslateDeviceHandleToIdentifier) zerTranslateDeviceHandleToIdentifierFunc;
extern decltype(&zerDriverGetLastErrorDescription) zerDriverGetLastErrorDescriptionFunc; extern decltype(&zerGetLastErrorDescription) zerGetLastErrorDescriptionFunc;
} // namespace LevelZeroBlackBoxTests } // namespace LevelZeroBlackBoxTests

View File

@@ -19,7 +19,7 @@ void executeKernelAndValidate(ze_context_handle_t context, uint32_t deviceIdentf
std::cout << "Testing for device " << deviceIdentfier << std::endl; std::cout << "Testing for device " << deviceIdentfier << std::endl;
} }
ze_command_list_handle_t cmdList; ze_command_list_handle_t cmdList;
auto device = LevelZeroBlackBoxTests::zerIdentifierTranslateToDeviceHandleFunc(deviceIdentfier); auto device = LevelZeroBlackBoxTests::zerTranslateIdentifierToDeviceHandleFunc(deviceIdentfier);
SUCCESS_OR_TERMINATE(zeCommandListCreateImmediate(context, device, &defaultCommandQueueDesc, &cmdList)); SUCCESS_OR_TERMINATE(zeCommandListCreateImmediate(context, device, &defaultCommandQueueDesc, &cmdList));
constexpr ze_group_count_t groupCounts{16, 1, 1}; constexpr ze_group_count_t groupCounts{16, 1, 1};
@@ -138,19 +138,19 @@ int main(int argc, char *argv[]) {
ze_context_handle_t context = nullptr; ze_context_handle_t context = nullptr;
const char *errorMsg = nullptr; const char *errorMsg = nullptr;
auto devices = LevelZeroBlackBoxTests::zelloInitContextAndGetDevices(context); auto devices = LevelZeroBlackBoxTests::zelloInitContextAndGetDevices(context);
SUCCESS_OR_TERMINATE(LevelZeroBlackBoxTests::zerDriverGetLastErrorDescriptionFunc(&errorMsg)); SUCCESS_OR_TERMINATE(LevelZeroBlackBoxTests::zerGetLastErrorDescriptionFunc(&errorMsg));
if (errorMsg != nullptr && errorMsg[0] != 0) { if (errorMsg != nullptr && errorMsg[0] != 0) {
std::cerr << "Error initializing context: " << (errorMsg ? errorMsg : "Unknown error") << std::endl; std::cerr << "Error initializing context: " << (errorMsg ? errorMsg : "Unknown error") << std::endl;
return 1; return 1;
} }
uint32_t deviceOrdinal = LevelZeroBlackBoxTests::zerDeviceTranslateToIdentifierFunc(devices[0]); uint32_t deviceOrdinal = LevelZeroBlackBoxTests::zerTranslateDeviceHandleToIdentifierFunc(devices[0]);
SUCCESS_OR_TERMINATE(LevelZeroBlackBoxTests::zerDriverGetLastErrorDescriptionFunc(&errorMsg)); SUCCESS_OR_TERMINATE(LevelZeroBlackBoxTests::zerGetLastErrorDescriptionFunc(&errorMsg));
if (errorMsg != nullptr && errorMsg[0] != 0) { if (errorMsg != nullptr && errorMsg[0] != 0) {
std::cerr << "Error zerDeviceTranslateToIdentifier: " << errorMsg << std::endl; std::cerr << "Error zerTranslateDeviceHandleToIdentifier: " << errorMsg << std::endl;
return 1; return 1;
} }
bool outputValidationSuccessful = false; bool outputValidationSuccessful = false;

View File

@@ -5907,13 +5907,13 @@ struct MultiDeviceTest : public Test<MultiDeviceFixture> {
for (auto &hDevice : hDevices) { for (auto &hDevice : hDevices) {
EXPECT_EQ(expectedIdentifier, Device::fromHandle(hDevice)->getIdentifier()); EXPECT_EQ(expectedIdentifier, Device::fromHandle(hDevice)->getIdentifier());
EXPECT_EQ(expectedIdentifier, zerDeviceTranslateToIdentifier(hDevice)); EXPECT_EQ(expectedIdentifier, zerTranslateDeviceHandleToIdentifier(hDevice));
EXPECT_EQ(hDevice, zerIdentifierTranslateToDeviceHandle(expectedIdentifier)); EXPECT_EQ(hDevice, zerTranslateIdentifierToDeviceHandle(expectedIdentifier));
expectedIdentifier++; expectedIdentifier++;
} }
EXPECT_EQ(nullptr, zerIdentifierTranslateToDeviceHandle(expectedIdentifier)); EXPECT_EQ(nullptr, zerTranslateIdentifierToDeviceHandle(expectedIdentifier));
} }
DebugManagerStateRestore restorer; DebugManagerStateRestore restorer;

View File

@@ -969,16 +969,16 @@ TEST_F(DriverHandleTest,
} }
TEST_F(DriverHandleTest, TEST_F(DriverHandleTest,
givenInitializedDriverWhenZerDriverGetDefaultContextIsCalledThenDefaultContextFromFirstDriverHandleIsReturned) { givenInitializedDriverWhenZerGetDefaultContextIsCalledThenDefaultContextFromFirstDriverHandleIsReturned) {
globalDriverHandles->push_back(nullptr); globalDriverHandles->push_back(nullptr);
auto defaultContext = zerDriverGetDefaultContext(); auto defaultContext = zerGetDefaultContext();
EXPECT_EQ(defaultContext, driverHandle->getDefaultContext()); EXPECT_EQ(defaultContext, driverHandle->getDefaultContext());
} }
TEST_F(DriverHandleTest, TEST_F(DriverHandleTest,
whenTranslatingNullptrDeviceHandleToIdentifierThenErrorIsPropagated) { whenTranslatingNullptrDeviceHandleToIdentifierThenErrorIsPropagated) {
auto identifier = zerDeviceTranslateToIdentifier(nullptr); auto identifier = zerTranslateDeviceHandleToIdentifier(nullptr);
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), identifier); EXPECT_EQ(std::numeric_limits<uint32_t>::max(), identifier);
@@ -989,7 +989,7 @@ TEST_F(DriverHandleTest,
EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription; EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription;
errorDescription = nullptr; errorDescription = nullptr;
EXPECT_EQ(ZE_RESULT_SUCCESS, zerDriverGetLastErrorDescription(&errorDescription)); EXPECT_EQ(ZE_RESULT_SUCCESS, zerGetLastErrorDescription(&errorDescription));
EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription; EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription;
} }
@@ -997,7 +997,7 @@ TEST_F(DriverHandleTest,
whenTranslatingIncorrectIdentifierToDeviceHandleThenErrorIsPropagated) { whenTranslatingIncorrectIdentifierToDeviceHandleThenErrorIsPropagated) {
uint32_t invalidIdentifier = std::numeric_limits<uint32_t>::max(); uint32_t invalidIdentifier = std::numeric_limits<uint32_t>::max();
EXPECT_EQ(nullptr, zerIdentifierTranslateToDeviceHandle(invalidIdentifier)); EXPECT_EQ(nullptr, zerTranslateIdentifierToDeviceHandle(invalidIdentifier));
const char *expectedError = "Invalid device identifier"; const char *expectedError = "Invalid device identifier";
@@ -1006,7 +1006,7 @@ TEST_F(DriverHandleTest,
EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription; EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription;
errorDescription = nullptr; errorDescription = nullptr;
EXPECT_EQ(ZE_RESULT_SUCCESS, zerDriverGetLastErrorDescription(&errorDescription)); EXPECT_EQ(ZE_RESULT_SUCCESS, zerGetLastErrorDescription(&errorDescription));
EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription; EXPECT_EQ(0, strcmp(expectedError, errorDescription)) << errorDescription;
} }
@@ -1269,11 +1269,11 @@ TEST_F(DriverExperimentalApiTest, whenRetrievingApiFunctionThenExpectProperPoint
decltype(&zexDriverReleaseImportedPointer) expectedRelease = L0::zexDriverReleaseImportedPointer; decltype(&zexDriverReleaseImportedPointer) expectedRelease = L0::zexDriverReleaseImportedPointer;
decltype(&zexDriverGetHostPointerBaseAddress) expectedGet = L0::zexDriverGetHostPointerBaseAddress; decltype(&zexDriverGetHostPointerBaseAddress) expectedGet = L0::zexDriverGetHostPointerBaseAddress;
decltype(&zeDriverGetDefaultContext) expectedZeDriverGetDefaultContext = zeDriverGetDefaultContext; decltype(&zeDriverGetDefaultContext) expectedZeDriverGetDefaultContext = zeDriverGetDefaultContext;
decltype(&zerDriverGetDefaultContext) expectedZerDriverGetDefaultContext = zerDriverGetDefaultContext; decltype(&zerGetDefaultContext) expectedZerGetDefaultContext = zerGetDefaultContext;
decltype(&zerDriverGetLastErrorDescription) expectedZerDriverGetLastErrorDescription = zerDriverGetLastErrorDescription; decltype(&zerGetLastErrorDescription) expectedZerGetLastErrorDescription = zerGetLastErrorDescription;
decltype(&zerDeviceTranslateToIdentifier) expectedZerDeviceTranslateToIdentifier = zerDeviceTranslateToIdentifier; decltype(&zerTranslateDeviceHandleToIdentifier) expectedZerTranslateDeviceHandleToIdentifier = zerTranslateDeviceHandleToIdentifier;
decltype(&zerIdentifierTranslateToDeviceHandle) expectedZerIdentifierTranslateToDeviceHandle = zerIdentifierTranslateToDeviceHandle; decltype(&zerTranslateIdentifierToDeviceHandle) expectedZerTranslateIdentifierToDeviceHandle = zerTranslateIdentifierToDeviceHandle;
decltype(&zeDeviceSynchronize) expectedZeDeviceSynchronize = zeDeviceSynchronize; decltype(&zeDeviceSynchronize) expectedZeDeviceSynchronize = zeDeviceSynchronize;
decltype(&zeCommandListAppendLaunchKernelWithArguments) expectedZeCommandListAppendLaunchKernelWithArguments = zeCommandListAppendLaunchKernelWithArguments; decltype(&zeCommandListAppendLaunchKernelWithArguments) expectedZeCommandListAppendLaunchKernelWithArguments = zeCommandListAppendLaunchKernelWithArguments;
@@ -1304,17 +1304,17 @@ TEST_F(DriverExperimentalApiTest, whenRetrievingApiFunctionThenExpectProperPoint
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zeDriverGetDefaultContext", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zeDriverGetDefaultContext", &funPtr));
EXPECT_EQ(expectedZeDriverGetDefaultContext, reinterpret_cast<decltype(&zeDriverGetDefaultContext)>(funPtr)); EXPECT_EQ(expectedZeDriverGetDefaultContext, reinterpret_cast<decltype(&zeDriverGetDefaultContext)>(funPtr));
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerDriverGetDefaultContext", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerGetDefaultContext", &funPtr));
EXPECT_EQ(expectedZerDriverGetDefaultContext, reinterpret_cast<decltype(&zerDriverGetDefaultContext)>(funPtr)); EXPECT_EQ(expectedZerGetDefaultContext, reinterpret_cast<decltype(&zerGetDefaultContext)>(funPtr));
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerDriverGetLastErrorDescription", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerGetLastErrorDescription", &funPtr));
EXPECT_EQ(expectedZerDriverGetLastErrorDescription, reinterpret_cast<decltype(&zerDriverGetLastErrorDescription)>(funPtr)); EXPECT_EQ(expectedZerGetLastErrorDescription, reinterpret_cast<decltype(&zerGetLastErrorDescription)>(funPtr));
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerDeviceTranslateToIdentifier", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerTranslateDeviceHandleToIdentifier", &funPtr));
EXPECT_EQ(expectedZerDeviceTranslateToIdentifier, reinterpret_cast<decltype(&zerDeviceTranslateToIdentifier)>(funPtr)); EXPECT_EQ(expectedZerTranslateDeviceHandleToIdentifier, reinterpret_cast<decltype(&zerTranslateDeviceHandleToIdentifier)>(funPtr));
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerIdentifierTranslateToDeviceHandle", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zerTranslateIdentifierToDeviceHandle", &funPtr));
EXPECT_EQ(expectedZerIdentifierTranslateToDeviceHandle, reinterpret_cast<decltype(&zerIdentifierTranslateToDeviceHandle)>(funPtr)); EXPECT_EQ(expectedZerTranslateIdentifierToDeviceHandle, reinterpret_cast<decltype(&zerTranslateIdentifierToDeviceHandle)>(funPtr));
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zeDeviceSynchronize", &funPtr)); EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetExtensionFunctionAddress(driverHandle, "zeDeviceSynchronize", &funPtr));
EXPECT_EQ(expectedZeDeviceSynchronize, reinterpret_cast<decltype(&zeDeviceSynchronize)>(funPtr)); EXPECT_EQ(expectedZeDeviceSynchronize, reinterpret_cast<decltype(&zeDeviceSynchronize)>(funPtr));

View File

@@ -527,7 +527,7 @@ ze_context_handle_t ZE_APICALL zeDriverGetDefaultContext(ze_driver_handle_t hDri
/// - Default context contains all devices within default driver instance /// - Default context contains all devices within default driver instance
/// @returns /// @returns
/// - Context handle associated with default driver /// - Context handle associated with default driver
ze_context_handle_t ZE_APICALL zerDriverGetDefaultContext(); ze_context_handle_t ZE_APICALL zerGetDefaultContext();
/// @brief Get Device Identifier /// @brief Get Device Identifier
/// ///
@@ -535,10 +535,10 @@ ze_context_handle_t ZE_APICALL zerDriverGetDefaultContext();
/// - The application may call this function from simultaneous threads. /// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free. /// - The implementation of this function should be lock-free.
/// - Returned identifier is a 32-bit unsigned integer that is unique to the driver. /// - Returned identifier is a 32-bit unsigned integer that is unique to the driver.
/// - The identifier can be used then in zerIdentifierTranslateToDeviceHandle to get the device handle. /// - The identifier can be used then in zerTranslateIdentifierToDeviceHandle to get the device handle.
/// @returns /// @returns
/// - 32-bit unsigned integer identifier /// - 32-bit unsigned integer identifier
uint32_t ZE_APICALL zerDeviceTranslateToIdentifier(ze_device_handle_t hDevice); ///< [in] handle of the device uint32_t ZE_APICALL zerTranslateDeviceHandleToIdentifier(ze_device_handle_t hDevice); ///< [in] handle of the device
/// @brief Translate Device Identifier to Device Handle from default Driver /// @brief Translate Device Identifier to Device Handle from default Driver
/// ///
@@ -548,7 +548,7 @@ uint32_t ZE_APICALL zerDeviceTranslateToIdentifier(ze_device_handle_t hDevice);
/// - Returned device is associated to default driver handle. /// - Returned device is associated to default driver handle.
/// @returns /// @returns
/// - device handle associated with the identifier /// - device handle associated with the identifier
ze_device_handle_t ZE_APICALL zerIdentifierTranslateToDeviceHandle(uint32_t identifier); ///< [in] integer identifier of the device ze_device_handle_t ZE_APICALL zerTranslateIdentifierToDeviceHandle(uint32_t identifier); ///< [in] integer identifier of the device
/// @brief Global device synchronization /// @brief Global device synchronization
/// ///
@@ -630,7 +630,7 @@ ze_result_t ZE_APICALL zeCommandListAppendLaunchKernelWithArguments(
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER /// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == ppString` /// + `nullptr == ppString`
ze_result_t ZE_APICALL ze_result_t ZE_APICALL
zerDriverGetLastErrorDescription( zerGetLastErrorDescription(
const char **ppString ///< [in,out] pointer to a null-terminated array of characters describing const char **ppString ///< [in,out] pointer to a null-terminated array of characters describing
///< cause of error. ///< cause of error.
); );