From 83a04c6de0f4a0262485327e8d94c6f7d75e5752 Mon Sep 17 00:00:00 2001 From: omarahmed1111 Date: Thu, 22 Feb 2024 10:47:06 +0000 Subject: [PATCH 1/2] Add more output checks for getInfo tests with relevant adapter fixes --- source/adapters/hip/program.cpp | 2 +- source/adapters/native_cpu/context.cpp | 2 +- .../context/context_adapter_native_cpu.match | 2 - test/conformance/context/urContextGetInfo.cpp | 35 +++++++++++++- test/conformance/device/urDeviceGetInfo.cpp | 7 +++ test/conformance/kernel/urKernelGetInfo.cpp | 22 +++++++++ test/conformance/memory/urMemGetInfo.cpp | 16 +++++++ test/conformance/program/urProgramGetInfo.cpp | 48 +++++++++++++++++++ test/conformance/queue/urQueueGetInfo.cpp | 23 +++++++++ .../testing/include/uur/fixtures.h | 3 +- test/conformance/usm/urUSMGetMemAllocInfo.cpp | 32 +++++++++++++ 11 files changed, 186 insertions(+), 6 deletions(-) diff --git a/source/adapters/hip/program.cpp b/source/adapters/hip/program.cpp index 1f27cfd396..04f2c44559 100644 --- a/source/adapters/hip/program.cpp +++ b/source/adapters/hip/program.cpp @@ -368,7 +368,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName, case UR_PROGRAM_INFO_NUM_DEVICES: return ReturnValue(1u); case UR_PROGRAM_INFO_DEVICES: - return ReturnValue(hProgram->getDevice(), 1); + return ReturnValue(hProgram->getContext()->getDevices()[0], 1); case UR_PROGRAM_INFO_SOURCE: return ReturnValue(hProgram->Binary); case UR_PROGRAM_INFO_BINARY_SIZES: diff --git a/source/adapters/native_cpu/context.cpp b/source/adapters/native_cpu/context.cpp index c485725828..2f58885fb4 100644 --- a/source/adapters/native_cpu/context.cpp +++ b/source/adapters/native_cpu/context.cpp @@ -53,7 +53,7 @@ urContextGetInfo(ur_context_handle_t hContext, ur_context_info_t propName, case UR_CONTEXT_INFO_DEVICES: return returnValue(hContext->_device); case UR_CONTEXT_INFO_REFERENCE_COUNT: - return returnValue(nullptr); + return returnValue(uint32_t{hContext->getReferenceCount()}); case UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT: return returnValue(true); case UR_CONTEXT_INFO_USM_FILL2D_SUPPORT: diff --git a/test/conformance/context/context_adapter_native_cpu.match b/test/conformance/context/context_adapter_native_cpu.match index 284bb9c693..64f39d35c5 100644 --- a/test/conformance/context/context_adapter_native_cpu.match +++ b/test/conformance/context/context_adapter_native_cpu.match @@ -1,3 +1 @@ -urContextReleaseTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU_ -urContextRetainTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU_ urContextSetExtendedDeleterTest.Success/SYCL_NATIVE_CPU___SYCL_Native_CPU_ diff --git a/test/conformance/context/urContextGetInfo.cpp b/test/conformance/context/urContextGetInfo.cpp index 71ada73558..1d75718d87 100644 --- a/test/conformance/context/urContextGetInfo.cpp +++ b/test/conformance/context/urContextGetInfo.cpp @@ -37,7 +37,8 @@ UUR_TEST_SUITE_P(urContextGetInfoTestWithInfoParam, UR_CONTEXT_INFO_NUM_DEVICES, // UR_CONTEXT_INFO_DEVICES, // UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT, // - UR_CONTEXT_INFO_USM_FILL2D_SUPPORT // + UR_CONTEXT_INFO_USM_FILL2D_SUPPORT, // + UR_CONTEXT_INFO_REFERENCE_COUNT // ), uur::deviceTestWithParamPrinter); @@ -56,6 +57,38 @@ TEST_P(urContextGetInfoTestWithInfoParam, Success) { std::vector info_data(info_size); ASSERT_SUCCESS( urContextGetInfo(context, info, info_size, info_data.data(), nullptr)); + + switch (info) { + case UR_CONTEXT_INFO_NUM_DEVICES: { + auto returned_num_of_devices = + reinterpret_cast(info_data.data()); + ASSERT_GE(uur::DevicesEnvironment::instance->devices.size(), + *returned_num_of_devices); + break; + } + case UR_CONTEXT_INFO_DEVICES: { + auto returned_devices = + reinterpret_cast(info_data.data()); + size_t devices_count = info_size / sizeof(ur_device_handle_t); + ASSERT_GT(devices_count, 0); + for (uint32_t i = 0; i < devices_count; i++) { + auto &devices = uur::DevicesEnvironment::instance->devices; + auto queried_device = + std::find(devices.begin(), devices.end(), returned_devices[i]); + EXPECT_TRUE(queried_device != devices.end()) + << "device associated with the context is not valid"; + } + break; + } + case UR_CONTEXT_INFO_REFERENCE_COUNT: { + auto returned_reference_count = + reinterpret_cast(info_data.data()); + ASSERT_GT(*returned_reference_count, 0U); + break; + } + default: + break; + } } using urContextGetInfoTest = uur::urContextTest; diff --git a/test/conformance/device/urDeviceGetInfo.cpp b/test/conformance/device/urDeviceGetInfo.cpp index d52cff2683..a3fd9afe10 100644 --- a/test/conformance/device/urDeviceGetInfo.cpp +++ b/test/conformance/device/urDeviceGetInfo.cpp @@ -271,6 +271,13 @@ TEST_P(urDeviceGetInfoTest, Success) { std::vector info_data(size); ASSERT_SUCCESS(urDeviceGetInfo(device, info_type, size, info_data.data(), nullptr)); + + if (info_type == UR_DEVICE_INFO_PLATFORM) { + auto returned_platform = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_platform, platform); + } + } else { ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION); } diff --git a/test/conformance/kernel/urKernelGetInfo.cpp b/test/conformance/kernel/urKernelGetInfo.cpp index add18cd27d..c6b3d04846 100644 --- a/test/conformance/kernel/urKernelGetInfo.cpp +++ b/test/conformance/kernel/urKernelGetInfo.cpp @@ -24,6 +24,28 @@ TEST_P(urKernelGetInfoTest, Success) { property_value.resize(property_size); ASSERT_SUCCESS(urKernelGetInfo(kernel, property_name, property_size, property_value.data(), nullptr)); + switch (property_name) { + case UR_KERNEL_INFO_CONTEXT: { + auto returned_context = + reinterpret_cast(property_value.data()); + ASSERT_EQ(context, *returned_context); + break; + } + case UR_KERNEL_INFO_PROGRAM: { + auto returned_program = + reinterpret_cast(property_value.data()); + ASSERT_EQ(program, *returned_program); + break; + } + case UR_KERNEL_INFO_REFERENCE_COUNT: { + auto returned_reference_count = + reinterpret_cast(property_value.data()); + ASSERT_GT(*returned_reference_count, 0U); + break; + } + default: + break; + } } TEST_P(urKernelGetInfoTest, InvalidNullHandleKernel) { diff --git a/test/conformance/memory/urMemGetInfo.cpp b/test/conformance/memory/urMemGetInfo.cpp index 71b9ccfcc2..a28b581a26 100644 --- a/test/conformance/memory/urMemGetInfo.cpp +++ b/test/conformance/memory/urMemGetInfo.cpp @@ -31,6 +31,22 @@ TEST_P(urMemGetInfoTest, Success) { std::vector info_data(size); ASSERT_SUCCESS(urMemGetInfo(buffer, info, size, info_data.data(), nullptr)); + + switch (info) { + case UR_MEM_INFO_CONTEXT: { + auto returned_context = + reinterpret_cast(info_data.data()); + ASSERT_EQ(context, *returned_context); + break; + } + case UR_MEM_INFO_SIZE: { + auto returned_size = reinterpret_cast(info_data.data()); + ASSERT_GE(*returned_size, allocation_size); + break; + } + default: + break; + } } TEST_P(urMemGetInfoTest, InvalidNullHandleMemory) { diff --git a/test/conformance/program/urProgramGetInfo.cpp b/test/conformance/program/urProgramGetInfo.cpp index 80d00072e7..2ea3e910b5 100644 --- a/test/conformance/program/urProgramGetInfo.cpp +++ b/test/conformance/program/urProgramGetInfo.cpp @@ -32,6 +32,54 @@ TEST_P(urProgramGetInfoTest, Success) { property_value.resize(property_size); ASSERT_SUCCESS(urProgramGetInfo(program, property_name, property_size, property_value.data(), nullptr)); + switch (property_name) { + case UR_PROGRAM_INFO_REFERENCE_COUNT: { + auto returned_reference_count = + reinterpret_cast(property_value.data()); + ASSERT_GT(*returned_reference_count, 0U); + break; + } + case UR_PROGRAM_INFO_CONTEXT: { + auto returned_context = + reinterpret_cast(property_value.data()); + ASSERT_EQ(context, *returned_context); + break; + } + case UR_PROGRAM_INFO_NUM_DEVICES: { + auto returned_num_of_devices = + reinterpret_cast(property_value.data()); + ASSERT_GE(uur::DevicesEnvironment::instance->devices.size(), + *returned_num_of_devices); + break; + } + case UR_PROGRAM_INFO_DEVICES: { + auto returned_devices = + reinterpret_cast(property_value.data()); + size_t devices_count = property_size / sizeof(ur_device_handle_t); + ASSERT_GT(devices_count, 0); + for (uint32_t i = 0; i < devices_count; i++) { + auto &devices = uur::DevicesEnvironment::instance->devices; + auto queried_device = + std::find(devices.begin(), devices.end(), returned_devices[i]); + EXPECT_TRUE(queried_device != devices.end()); + } + break; + } + case UR_PROGRAM_INFO_NUM_KERNELS: { + auto returned_num_of_kernels = + reinterpret_cast(property_value.data()); + ASSERT_GT(*returned_num_of_kernels, 0U); + break; + } + case UR_PROGRAM_INFO_KERNEL_NAMES: { + auto returned_kernel_names = + reinterpret_cast(property_value.data()); + ASSERT_STRNE(returned_kernel_names, ""); + break; + } + default: + break; + } } TEST_P(urProgramGetInfoTest, InvalidNullHandleProgram) { diff --git a/test/conformance/queue/urQueueGetInfo.cpp b/test/conformance/queue/urQueueGetInfo.cpp index 9269e4de30..9704c72f64 100644 --- a/test/conformance/queue/urQueueGetInfo.cpp +++ b/test/conformance/queue/urQueueGetInfo.cpp @@ -42,6 +42,29 @@ TEST_P(urQueueGetInfoTestWithInfoParam, Success) { std::vector data(size); ASSERT_SUCCESS( urQueueGetInfo(queue, info_type, size, data.data(), nullptr)); + + switch (info_type) { + case UR_QUEUE_INFO_CONTEXT: { + auto returned_context = + reinterpret_cast(data.data()); + ASSERT_EQ(context, *returned_context); + break; + } + case UR_QUEUE_INFO_DEVICE: { + auto returned_device = + reinterpret_cast(data.data()); + ASSERT_EQ(*returned_device, device); + break; + } + case UR_QUEUE_INFO_REFERENCE_COUNT: { + auto returned_reference_count = + reinterpret_cast(data.data()); + ASSERT_GT(*returned_reference_count, 0U); + break; + } + default: + break; + } } else { ASSERT_EQ_RESULT(result, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION); } diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index cf3cfc479a..396ca34e7f 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -260,7 +260,7 @@ template struct urMemBufferTestWithParam : urContextTestWithParam { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); ASSERT_SUCCESS(urMemBufferCreate(this->context, UR_MEM_FLAG_READ_WRITE, - 4096, nullptr, &buffer)); + allocation_size, nullptr, &buffer)); ASSERT_NE(nullptr, buffer); } @@ -271,6 +271,7 @@ template struct urMemBufferTestWithParam : urContextTestWithParam { UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::TearDown()); } ur_mem_handle_t buffer = nullptr; + size_t allocation_size = 4096; }; template struct urMemImageTestWithParam : urContextTestWithParam { diff --git a/test/conformance/usm/urUSMGetMemAllocInfo.cpp b/test/conformance/usm/urUSMGetMemAllocInfo.cpp index 6bb256b97c..181e1d08b3 100644 --- a/test/conformance/usm/urUSMGetMemAllocInfo.cpp +++ b/test/conformance/usm/urUSMGetMemAllocInfo.cpp @@ -45,6 +45,38 @@ TEST_P(urUSMGetMemAllocInfoTest, Success) { std::vector info_data(size); ASSERT_SUCCESS(urUSMGetMemAllocInfo(context, ptr, alloc_info, size, info_data.data(), nullptr)); + switch (alloc_info) { + case UR_USM_ALLOC_INFO_DEVICE: { + auto returned_device = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_device, device); + break; + } + case UR_USM_ALLOC_INFO_SIZE: { + auto returned_size = reinterpret_cast(info_data.data()); + ASSERT_GE(*returned_size, allocation_size); + break; + } + case UR_USM_ALLOC_INFO_BASE_PTR: { + auto returned_ptr = reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_ptr, ptr); + break; + } + case UR_USM_ALLOC_INFO_POOL: { + auto returned_pool = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_pool, pool); + break; + } + case UR_USM_ALLOC_INFO_TYPE: { + auto returned_type = + reinterpret_cast(info_data.data()); + ASSERT_EQ(*returned_type, UR_USM_TYPE_DEVICE); + break; + } + default: + break; + } } using urUSMGetMemAllocInfoNegativeTest = uur::urUSMDeviceAllocTest; From cbd581fbe4182ac443aa17edf2214cd05369a110 Mon Sep 17 00:00:00 2001 From: omarahmed1111 Date: Wed, 28 Feb 2024 11:00:02 +0000 Subject: [PATCH 2/2] Add clarification about size to usm spec and program associated device --- include/ur_api.h | 8 +++++--- scripts/core/program.yml | 1 + scripts/core/usm.yml | 6 +++--- source/adapters/hip/program.cpp | 2 +- source/adapters/null/ur_nullddi.cpp | 6 +++--- source/loader/layers/tracing/ur_trcddi.cpp | 6 +++--- source/loader/layers/validation/ur_valddi.cpp | 6 +++--- source/loader/ur_ldrddi.cpp | 6 +++--- source/loader/ur_libapi.cpp | 8 +++++--- source/ur_api.cpp | 8 +++++--- 10 files changed, 32 insertions(+), 25 deletions(-) diff --git a/include/ur_api.h b/include/ur_api.h index d4ea8d3404..b97f4518b6 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -3449,7 +3449,7 @@ urUSMHostAlloc( ur_context_handle_t hContext, ///< [in] handle of the context object const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate - size_t size, ///< [in] size in bytes of the USM memory object to be allocated + size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ); @@ -3497,7 +3497,7 @@ urUSMDeviceAlloc( ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_usm_desc_t *pUSMDesc, ///< [in][optional] USM memory allocation descriptor ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate - size_t size, ///< [in] size in bytes of the USM memory object to be allocated + size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ); @@ -3546,7 +3546,7 @@ urUSMSharedAlloc( ur_device_handle_t hDevice, ///< [in] handle of the device object const ur_usm_desc_t *pUSMDesc, ///< [in][optional] Pointer to USM memory allocation descriptor. ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate - size_t size, ///< [in] size in bytes of the USM memory object to be allocated + size_t size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ); @@ -4117,6 +4117,8 @@ urProgramCreateWithIL( /// - Following a successful call to this entry point, `phProgram` will /// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or /// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`. +/// - The device specified by `hDevice` must be device associated with +/// context. /// /// @remarks /// _Analogues_ diff --git a/scripts/core/program.yml b/scripts/core/program.yml index 98dcc1d267..65c86e5a5b 100644 --- a/scripts/core/program.yml +++ b/scripts/core/program.yml @@ -128,6 +128,7 @@ analogue: details: - "The application may call this function from simultaneous threads." - "Following a successful call to this entry point, `phProgram` will contain a binary of type $X_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or $X_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`." + - "The device specified by `hDevice` must be device associated with context." params: - type: $x_context_handle_t name: hContext diff --git a/scripts/core/usm.yml b/scripts/core/usm.yml index fbd81aa8f8..7ba75bc865 100644 --- a/scripts/core/usm.yml +++ b/scripts/core/usm.yml @@ -248,7 +248,7 @@ params: desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate" - type: "size_t" name: size - desc: "[in] size in bytes of the USM memory object to be allocated" + desc: "[in] minimum size in bytes of the USM memory object to be allocated" - type: void** name: ppMem desc: "[out] pointer to USM host memory object" @@ -293,7 +293,7 @@ params: desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate" - type: "size_t" name: size - desc: "[in] size in bytes of the USM memory object to be allocated" + desc: "[in] minimum size in bytes of the USM memory object to be allocated" - type: void** name: ppMem desc: "[out] pointer to USM device memory object" @@ -339,7 +339,7 @@ params: desc: "[in][optional] Pointer to a pool created using urUSMPoolCreate" - type: "size_t" name: size - desc: "[in] size in bytes of the USM memory object to be allocated" + desc: "[in] minimum size in bytes of the USM memory object to be allocated" - type: void** name: ppMem desc: "[out] pointer to USM shared memory object" diff --git a/source/adapters/hip/program.cpp b/source/adapters/hip/program.cpp index 04f2c44559..1ee862804a 100644 --- a/source/adapters/hip/program.cpp +++ b/source/adapters/hip/program.cpp @@ -368,7 +368,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName, case UR_PROGRAM_INFO_NUM_DEVICES: return ReturnValue(1u); case UR_PROGRAM_INFO_DEVICES: - return ReturnValue(hProgram->getContext()->getDevices()[0], 1); + return ReturnValue(&hProgram->getContext()->getDevices()[0], 1); case UR_PROGRAM_INFO_SOURCE: return ReturnValue(hProgram->Binary); case UR_PROGRAM_INFO_BINARY_SIZES: diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index a85547d2d1..0c0826d948 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -1268,7 +1268,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) try { ur_result_t result = UR_RESULT_SUCCESS; @@ -1296,7 +1296,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) try { ur_result_t result = UR_RESULT_SUCCESS; @@ -1324,7 +1324,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) try { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 78c9a223e7..dff3686d45 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -1331,7 +1331,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { auto pfnHostAlloc = context.urDdiTable.USM.pfnHostAlloc; @@ -1363,7 +1363,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) { auto pfnDeviceAlloc = context.urDdiTable.USM.pfnDeviceAlloc; @@ -1396,7 +1396,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { auto pfnSharedAlloc = context.urDdiTable.USM.pfnSharedAlloc; diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index c3b009a724..e928bef615 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -1768,7 +1768,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { auto pfnHostAlloc = context.urDdiTable.USM.pfnHostAlloc; @@ -1825,7 +1825,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) { auto pfnDeviceAlloc = context.urDdiTable.USM.pfnDeviceAlloc; @@ -1892,7 +1892,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { auto pfnSharedAlloc = context.urDdiTable.USM.pfnSharedAlloc; diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index dac56ddd1d..1a6539ed8f 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -1712,7 +1712,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -1747,7 +1747,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -1785,7 +1785,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 01cc285752..7708ba1171 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -2204,7 +2204,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) try { auto pfnHostAlloc = ur_lib::context->urDdiTable.USM.pfnHostAlloc; @@ -2263,7 +2263,7 @@ ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) try { auto pfnDeviceAlloc = ur_lib::context->urDdiTable.USM.pfnDeviceAlloc; @@ -2323,7 +2323,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) try { auto pfnSharedAlloc = ur_lib::context->urDdiTable.USM.pfnSharedAlloc; @@ -2940,6 +2940,8 @@ ur_result_t UR_APICALL urProgramCreateWithIL( /// - Following a successful call to this entry point, `phProgram` will /// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or /// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`. +/// - The device specified by `hDevice` must be device associated with +/// context. /// /// @remarks /// _Analogues_ diff --git a/source/ur_api.cpp b/source/ur_api.cpp index e3b1ba0481..8da55eea2b 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -1892,7 +1892,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -1945,7 +1945,7 @@ ur_result_t UR_APICALL urUSMDeviceAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM device memory object ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -1999,7 +1999,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( ur_usm_pool_handle_t pool, ///< [in][optional] Pointer to a pool created using urUSMPoolCreate size_t - size, ///< [in] size in bytes of the USM memory object to be allocated + size, ///< [in] minimum size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -2503,6 +2503,8 @@ ur_result_t UR_APICALL urProgramCreateWithIL( /// - Following a successful call to this entry point, `phProgram` will /// contain a binary of type ::UR_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or /// ::UR_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`. +/// - The device specified by `hDevice` must be device associated with +/// context. /// /// @remarks /// _Analogues_