diff --git a/include/ur_api.h b/include/ur_api.h index e5c6012eed..a074d740e3 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -1632,28 +1632,30 @@ typedef enum ur_device_info_t { ///< available for this device. UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS = 106, ///< [::ur_bool_t] support the ::urKernelSetSpecializationConstants entry ///< point - UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 107, ///< [uint32_t][optional-query] return the width in bits of the memory bus + UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 107, ///< [::ur_bool_t] support the ::urProgramSetSpecializationConstants entry + ///< point + UR_DEVICE_INFO_MEMORY_BUS_WIDTH = 108, ///< [uint32_t][optional-query] return the width in bits of the memory bus ///< interface of the device. - UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 108, ///< [size_t[3]] return max 3D work groups - UR_DEVICE_INFO_ASYNC_BARRIER = 109, ///< [::ur_bool_t] return true if Async Barrier is supported - UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 110, ///< [::ur_bool_t] return true if specifying memory channels is supported - UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED = 111, ///< [::ur_bool_t] Return true if the device supports enqueueing commands + UR_DEVICE_INFO_MAX_WORK_GROUPS_3D = 109, ///< [size_t[3]] return max 3D work groups + UR_DEVICE_INFO_ASYNC_BARRIER = 110, ///< [::ur_bool_t] return true if Async Barrier is supported + UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT = 111, ///< [::ur_bool_t] return true if specifying memory channels is supported + UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED = 112, ///< [::ur_bool_t] Return true if the device supports enqueueing commands ///< to read and write pipes from the host. - UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112, ///< [uint32_t][optional-query] The maximum number of registers available + UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 113, ///< [uint32_t][optional-query] The maximum number of registers available ///< per block. - UR_DEVICE_INFO_IP_VERSION = 113, ///< [uint32_t][optional-query] The device IP version. The meaning of the + UR_DEVICE_INFO_IP_VERSION = 114, ///< [uint32_t][optional-query] The device IP version. The meaning of the ///< device IP version is implementation-defined, but newer devices should ///< have a higher version than older devices. - UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114, ///< [::ur_bool_t] return true if the device supports virtual memory. - UR_DEVICE_INFO_ESIMD_SUPPORT = 115, ///< [::ur_bool_t] return true if the device supports ESIMD. - UR_DEVICE_INFO_COMPONENT_DEVICES = 116, ///< [::ur_device_handle_t[]][optional-query] The set of component devices + UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 115, ///< [::ur_bool_t] return true if the device supports virtual memory. + UR_DEVICE_INFO_ESIMD_SUPPORT = 116, ///< [::ur_bool_t] return true if the device supports ESIMD. + UR_DEVICE_INFO_COMPONENT_DEVICES = 117, ///< [::ur_device_handle_t[]][optional-query] The set of component devices ///< contained by this composite device. - UR_DEVICE_INFO_COMPOSITE_DEVICE = 117, ///< [::ur_device_handle_t][optional-query] The composite device containing + UR_DEVICE_INFO_COMPOSITE_DEVICE = 118, ///< [::ur_device_handle_t][optional-query] The composite device containing ///< this component device. - UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the + UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 119, ///< [::ur_bool_t] return true if the device supports the ///< `EnqueueDeviceGlobalVariableWrite` and ///< `EnqueueDeviceGlobalVariableRead` entry points. - UR_DEVICE_INFO_USM_POOL_SUPPORT = 119, ///< [::ur_bool_t] return true if the device supports USM pooling. Pertains + UR_DEVICE_INFO_USM_POOL_SUPPORT = 120, ///< [::ur_bool_t] return true if the device supports USM pooling. Pertains ///< to the `USMPool` entry points and usage of the `pool` parameter of the ///< USM alloc entry points. UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of @@ -4726,6 +4728,10 @@ typedef struct ur_specialization_constant_info_t { /// @brief Set an array of specialization constants on a Program. /// /// @details +/// - This entry point is optional, the application should query for support +/// with device query +/// ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS passed to +/// ::urDeviceGetInfo. /// - The application may call this function from simultaneous threads for /// the same device. /// - The implementation of this function should be thread-safe. @@ -4745,6 +4751,8 @@ typedef struct ur_specialization_constant_info_t { /// + `NULL == pSpecConstants` /// - ::UR_RESULT_ERROR_INVALID_SIZE /// + `count == 0` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS query is false /// - ::UR_RESULT_ERROR_INVALID_VALUE /// + A pSpecConstant entry contains a size that does not match that of the specialization constant in the module. /// + A pSpecConstant entry contains a nullptr pValue. diff --git a/include/ur_print.hpp b/include/ur_print.hpp index c350f206c6..9f58a88c20 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -2600,6 +2600,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: os << "UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS"; break; + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: + os << "UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS"; + break; case UR_DEVICE_INFO_MEMORY_BUS_WIDTH: os << "UR_DEVICE_INFO_MEMORY_BUS_WIDTH"; break; @@ -3998,6 +4001,18 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info os << ")"; } break; + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: { + const ur_bool_t *tptr = (const ur_bool_t *)ptr; + if (sizeof(ur_bool_t) > size) { + os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; case UR_DEVICE_INFO_MEMORY_BUS_WIDTH: { const uint32_t *tptr = (const uint32_t *)ptr; if (sizeof(uint32_t) > size) { diff --git a/scripts/core/device.yml b/scripts/core/device.yml index ce671c24d6..aed57756e2 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -417,6 +417,8 @@ etors: available for this device. - name: KERNEL_SET_SPECIALIZATION_CONSTANTS desc: "[$x_bool_t] support the $xKernelSetSpecializationConstants entry point" + - name: PROGRAM_SET_SPECIALIZATION_CONSTANTS + desc: "[$x_bool_t] support the $xProgramSetSpecializationConstants entry point" - name: MEMORY_BUS_WIDTH desc: "[uint32_t][optional-query] return the width in bits of the memory bus interface of the device." - name: MAX_WORK_GROUPS_3D diff --git a/scripts/core/program.yml b/scripts/core/program.yml index 0449a58d6d..037b65ccc5 100644 --- a/scripts/core/program.yml +++ b/scripts/core/program.yml @@ -528,6 +528,7 @@ desc: "Set an array of specialization constants on a Program." class: $xProgram name: SetSpecializationConstants details: + - "This entry point is optional, the application should query for support with device query $X_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS passed to $xDeviceGetInfo." - "The application may call this function from simultaneous threads for the same device." - "The implementation of this function should be thread-safe." - "`hProgram` must have been created with the $xProgramCreateWithIL entry point." @@ -546,6 +547,8 @@ params: returns: - $X_RESULT_ERROR_INVALID_SIZE: - "`count == 0`" + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If $X_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS query is false" - $X_RESULT_ERROR_INVALID_VALUE: - "A pSpecConstant entry contains a size that does not match that of the specialization constant in the module." - "A pSpecConstant entry contains a nullptr pValue." diff --git a/source/adapters/cuda/device.cpp b/source/adapters/cuda/device.cpp index 10c4e1d1af..bcdfe8f6dd 100644 --- a/source/adapters/cuda/device.cpp +++ b/source/adapters/cuda/device.cpp @@ -1065,6 +1065,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(AddressBuffer, strnlen(AddressBuffer, AddressBufferSize - 1) + 1); } + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: return ReturnValue(static_cast(false)); // TODO: Investigate if this information is available on CUDA. diff --git a/source/adapters/hip/device.cpp b/source/adapters/hip/device.cpp index c5ccee5bf4..6ea2ba8395 100644 --- a/source/adapters/hip/device.cpp +++ b/source/adapters/hip/device.cpp @@ -789,6 +789,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(ur_bool_t{false}); } + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: { + return ReturnValue(ur_bool_t{false}); + } + case UR_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES: { ur_memory_order_capability_flags_t Capabilities = UR_MEMORY_ORDER_CAPABILITY_FLAG_RELAXED | diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 373826f0fd..d26cef79f2 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -1154,6 +1154,8 @@ ur_result_t urDeviceGetInfo( // L0 does not support sampling 1D USM sampled image data. return ReturnValue(false); } + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: + return ReturnValue(true); case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: return ReturnValue(false); case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: diff --git a/source/adapters/native_cpu/device.cpp b/source/adapters/native_cpu/device.cpp index b00892d040..6f3234ab0b 100644 --- a/source/adapters/native_cpu/device.cpp +++ b/source/adapters/native_cpu/device.cpp @@ -428,6 +428,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_LOW_POWER_EVENTS_EXP: return ReturnValue(false); + + case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: + return ReturnValue(false); + default: DIE_NO_IMPLEMENTATION; } diff --git a/source/adapters/opencl/device.cpp b/source/adapters/opencl/device.cpp index dc5343b51c..4ed3eeb3b0 100644 --- a/source/adapters/opencl/device.cpp +++ b/source/adapters/opencl/device.cpp @@ -7,6 +7,7 @@ //===-----------------------------------------------------------------===// #include "device.hpp" +#include "adapter.hpp" #include "common.hpp" #include "platform.hpp" @@ -1125,6 +1126,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(UUID); } + case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: { + return ReturnValue( + ur::cl::getAdapter()->clSetProgramSpecializationConstant != nullptr); + } + // We can't query to check if these are supported, they will need to be // manually updated if support is ever implemented. case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 48d03afa20..7db6fea5dc 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -3531,6 +3531,10 @@ ur_result_t UR_APICALL urProgramGetBuildInfo( /// @brief Set an array of specialization constants on a Program. /// /// @details +/// - This entry point is optional, the application should query for support +/// with device query +/// ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS passed to +/// ::urDeviceGetInfo. /// - The application may call this function from simultaneous threads for /// the same device. /// - The implementation of this function should be thread-safe. @@ -3550,6 +3554,8 @@ ur_result_t UR_APICALL urProgramGetBuildInfo( /// + `NULL == pSpecConstants` /// - ::UR_RESULT_ERROR_INVALID_SIZE /// + `count == 0` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS query is false /// - ::UR_RESULT_ERROR_INVALID_VALUE /// + A pSpecConstant entry contains a size that does not match that of the specialization constant in the module. /// + A pSpecConstant entry contains a nullptr pValue. diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 948fc36261..129065a4d4 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -3019,6 +3019,10 @@ ur_result_t UR_APICALL urProgramGetBuildInfo( /// @brief Set an array of specialization constants on a Program. /// /// @details +/// - This entry point is optional, the application should query for support +/// with device query +/// ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS passed to +/// ::urDeviceGetInfo. /// - The application may call this function from simultaneous threads for /// the same device. /// - The implementation of this function should be thread-safe. @@ -3038,6 +3042,8 @@ ur_result_t UR_APICALL urProgramGetBuildInfo( /// + `NULL == pSpecConstants` /// - ::UR_RESULT_ERROR_INVALID_SIZE /// + `count == 0` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If ::UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS query is false /// - ::UR_RESULT_ERROR_INVALID_VALUE /// + A pSpecConstant entry contains a size that does not match that of the specialization constant in the module. /// + A pSpecConstant entry contains a nullptr pValue. diff --git a/test/conformance/device/device_adapter_native_cpu.match b/test/conformance/device/device_adapter_native_cpu.match index 2764ad4fd1..fc0ccf48b2 100644 --- a/test/conformance/device/device_adapter_native_cpu.match +++ b/test/conformance/device/device_adapter_native_cpu.match @@ -13,4 +13,3 @@ urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_WORK_GROUPS_3D urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ASYNC_BARRIER urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES -urDeviceGetInfoTest.Success/UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS diff --git a/test/conformance/device/urDeviceGetInfo.cpp b/test/conformance/device/urDeviceGetInfo.cpp index 1fc8e6ca7f..f8cfeb7ae3 100644 --- a/test/conformance/device/urDeviceGetInfo.cpp +++ b/test/conformance/device/urDeviceGetInfo.cpp @@ -106,6 +106,7 @@ static std::unordered_map device_info_size_map = { {UR_DEVICE_INFO_BFLOAT16, sizeof(ur_bool_t)}, {UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, sizeof(uint32_t)}, {UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, sizeof(ur_bool_t)}, + {UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS, sizeof(ur_bool_t)}, {UR_DEVICE_INFO_MEMORY_BUS_WIDTH, sizeof(uint32_t)}, {UR_DEVICE_INFO_MAX_WORK_GROUPS_3D, sizeof(size_t[3])}, {UR_DEVICE_INFO_ASYNC_BARRIER, sizeof(ur_bool_t)}, diff --git a/test/conformance/program/program_adapter_cuda.match b/test/conformance/program/program_adapter_cuda.match index 11bf1c3e67..7db886399f 100644 --- a/test/conformance/program/program_adapter_cuda.match +++ b/test/conformance/program/program_adapter_cuda.match @@ -4,10 +4,3 @@ urProgramBuildTest.BuildFailure/* {{OPT}}urProgramCreateWithILTest.BuildInvalidProgram/* # This test flakily fails {{OPT}}urProgramGetBuildInfoSingleTest.LogIsNullTerminated/* -{{OPT}}urProgramSetSpecializationConstantsTest.Success/* -{{OPT}}urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_hip.match b/test/conformance/program/program_adapter_hip.match index 2bf556541d..9d393eb93a 100644 --- a/test/conformance/program/program_adapter_hip.match +++ b/test/conformance/program/program_adapter_hip.match @@ -4,12 +4,3 @@ urProgramBuildTest.BuildFailure/* # HIP hasn't implemented urProgramLink {{OPT}}urProgramLinkTest.Success/* - -# Hip doesn't support specialization constants -urProgramSetSpecializationConstantsTest.Success/* -urProgramSetSpecializationConstantsTest.UseDefaultValue/* -urProgramSetSpecializationConstantsTest.InvalidValueSize/* -urProgramSetSpecializationConstantsTest.InvalidValueId/* -urProgramSetSpecializationConstantsTest.InvalidValuePtr/* -urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* -urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/program_adapter_native_cpu.match b/test/conformance/program/program_adapter_native_cpu.match index bd04ab9e8c..c6df22331c 100644 --- a/test/conformance/program/program_adapter_native_cpu.match +++ b/test/conformance/program/program_adapter_native_cpu.match @@ -75,5 +75,6 @@ {{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueSize/* {{OPT}}urProgramSetSpecializationConstantsTest.InvalidValueId/* {{OPT}}urProgramSetSpecializationConstantsTest.InvalidValuePtr/* +{{OPT}}urProgramSetSpecializationConstantsNegativeTest.Unsupported/* {{OPT}}urProgramSetMultipleSpecializationConstantsTest.MultipleCalls/* {{OPT}}urProgramSetMultipleSpecializationConstantsTest.SingleCall/* diff --git a/test/conformance/program/urProgramSetSpecializationConstants.cpp b/test/conformance/program/urProgramSetSpecializationConstants.cpp index 949c5c323e..06251f3e03 100644 --- a/test/conformance/program/urProgramSetSpecializationConstants.cpp +++ b/test/conformance/program/urProgramSetSpecializationConstants.cpp @@ -9,6 +9,16 @@ struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { void SetUp() override { program_name = "spec_constant"; UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); + + bool supports_kernel_spec_constant = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS, + sizeof(supports_kernel_spec_constant), + &supports_kernel_spec_constant, nullptr)); + if (!supports_kernel_spec_constant) { + GTEST_SKIP() + << "Device does not support setting program spec constants."; + } } uint32_t spec_value = 42; @@ -18,12 +28,47 @@ struct urProgramSetSpecializationConstantsTest : uur::urKernelExecutionTest { }; UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramSetSpecializationConstantsTest); +struct urProgramSetSpecializationConstantsNegativeTest + : uur::urKernelExecutionTest { + void SetUp() override { + program_name = "spec_constant"; + UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); + + bool supports_kernel_spec_constant = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS, + sizeof(supports_kernel_spec_constant), + &supports_kernel_spec_constant, nullptr)); + if (supports_kernel_spec_constant) { + GTEST_SKIP() + << "Device does supports setting program spec constants."; + } + } + + uint32_t spec_value = 42; + uint32_t default_spec_value = 1000; // Must match the one in the SYCL source + ur_specialization_constant_info_t info = {0, sizeof(spec_value), + &spec_value}; +}; +UUR_INSTANTIATE_KERNEL_TEST_SUITE_P( + urProgramSetSpecializationConstantsNegativeTest); + struct urProgramSetMultipleSpecializationConstantsTest : uur::urKernelExecutionTest { // The types of spec constants in this program are {uint32_t, uint64_t, bool} void SetUp() override { program_name = "spec_constant_multiple"; UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); + + bool supports_kernel_spec_constant = false; + ASSERT_SUCCESS(urDeviceGetInfo( + device, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS, + sizeof(supports_kernel_spec_constant), + &supports_kernel_spec_constant, nullptr)); + if (!supports_kernel_spec_constant) { + GTEST_SKIP() + << "Device does not support setting program spec constants."; + } } }; UUR_INSTANTIATE_KERNEL_TEST_SUITE_P( @@ -43,6 +88,11 @@ TEST_P(urProgramSetSpecializationConstantsTest, Success) { ValidateBuffer(buffer, sizeof(spec_value), spec_value); } +TEST_P(urProgramSetSpecializationConstantsNegativeTest, Unsupported) { + ASSERT_EQ_RESULT(UR_RESULT_ERROR_UNSUPPORTED_FEATURE, + urProgramSetSpecializationConstants(program, 1, &info)); +} + TEST_P(urProgramSetSpecializationConstantsTest, UseDefaultValue) { ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, diff --git a/tools/urinfo/urinfo.hpp b/tools/urinfo/urinfo.hpp index 9b052fee39..19bd57a50f 100644 --- a/tools/urinfo/urinfo.hpp +++ b/tools/urinfo/urinfo.hpp @@ -307,6 +307,9 @@ inline void printDeviceInfos(ur_device_handle_t hDevice, printDeviceInfo( hDevice, UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS); std::cout << prefix; + printDeviceInfo( + hDevice, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS); + std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_MEMORY_BUS_WIDTH); std::cout << prefix; printDeviceInfo(hDevice, UR_DEVICE_INFO_MAX_WORK_GROUPS_3D);