Skip to content

Commit 042d6f3

Browse files
authored
[SYCL][UR] Add long long vector width device info support (#21783)
Add support for preferred/native vector width long long. Spec: KhronosGroup/SYCL-Docs#961
1 parent f54c8a1 commit 042d6f3

18 files changed

Lines changed: 128 additions & 6 deletions

File tree

sycl/include/sycl/info/device_traits.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ __SYCL_PARAM_TRAITS_SPEC(device, preferred_vector_width_int, uint32_t,
3232
UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT)
3333
__SYCL_PARAM_TRAITS_SPEC(device, preferred_vector_width_long, uint32_t,
3434
UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG)
35+
__SYCL_PARAM_TRAITS_SPEC(device, preferred_vector_width_long_long, uint32_t,
36+
UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG)
3537
__SYCL_PARAM_TRAITS_SPEC(device, preferred_vector_width_float, uint32_t,
3638
UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT)
3739
__SYCL_PARAM_TRAITS_SPEC(device, preferred_vector_width_double, uint32_t,
@@ -46,6 +48,8 @@ __SYCL_PARAM_TRAITS_SPEC(device, native_vector_width_int, uint32_t,
4648
UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT)
4749
__SYCL_PARAM_TRAITS_SPEC(device, native_vector_width_long, uint32_t,
4850
UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG)
51+
__SYCL_PARAM_TRAITS_SPEC(device, native_vector_width_long_long, uint32_t,
52+
UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG)
4953
__SYCL_PARAM_TRAITS_SPEC(device, native_vector_width_float, uint32_t,
5054
UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT)
5155
__SYCL_PARAM_TRAITS_SPEC(device, native_vector_width_double, uint32_t,

sycl/source/detail/ur_device_info_ret_types.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, uint32_t)
3939
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, uint32_t)
4040
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, uint32_t)
4141
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, uint32_t)
42+
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG, uint32_t)
4243
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, uint32_t)
4344
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, uint32_t)
4445
MAP(UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, uint32_t)
4546
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, uint32_t)
4647
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, uint32_t)
4748
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, uint32_t)
4849
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, uint32_t)
50+
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG, uint32_t)
4951
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, uint32_t)
5052
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, uint32_t)
5153
MAP(UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, uint32_t)

sycl/test-e2e/Basic/info.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ int main() {
233233
dev, "Preferred vector width int");
234234
print_info<info::device::preferred_vector_width_long, std::uint32_t>(
235235
dev, "Preferred vector width long");
236+
print_info<info::device::preferred_vector_width_long_long, std::uint32_t>(
237+
dev, "Preferred vector width long long");
236238
print_info<info::device::preferred_vector_width_float, std::uint32_t>(
237239
dev, "Preferred vector width float");
238240
print_info<info::device::preferred_vector_width_double, std::uint32_t>(
@@ -247,6 +249,8 @@ int main() {
247249
dev, "Native vector width int");
248250
print_info<info::device::native_vector_width_long, std::uint32_t>(
249251
dev, "Native vector width long");
252+
print_info<info::device::native_vector_width_long_long, std::uint32_t>(
253+
dev, "Native vector width long long");
250254
print_info<info::device::native_vector_width_float, std::uint32_t>(
251255
dev, "Native vector width float");
252256
print_info<info::device::native_vector_width_double, std::uint32_t>(

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,13 +3882,15 @@ _ZNK4sycl3_V16device13get_info_implINS0_4info6device29ext_oneapi_cuda_cluster_gr
38823882
_ZNK4sycl3_V16device13get_info_implINS0_4info6device29ext_oneapi_max_work_groups_1dEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38833883
_ZNK4sycl3_V16device13get_info_implINS0_4info6device29ext_oneapi_max_work_groups_2dEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38843884
_ZNK4sycl3_V16device13get_info_implINS0_4info6device29ext_oneapi_max_work_groups_3dEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
3885+
_ZNK4sycl3_V16device13get_info_implINS0_4info6device29native_vector_width_long_longEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38853886
_ZNK4sycl3_V16device13get_info_implINS0_4info6device29preferred_vector_width_doubleEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38863887
_ZNK4sycl3_V16device13get_info_implINS0_4info6device30partition_type_affinity_domainEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38873888
_ZNK4sycl3_V16device13get_info_implINS0_4info6device31atomic_fence_order_capabilitiesEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38883889
_ZNK4sycl3_V16device13get_info_implINS0_4info6device31atomic_fence_scope_capabilitiesEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38893890
_ZNK4sycl3_V16device13get_info_implINS0_4info6device31ext_intel_gpu_hw_threads_per_euEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38903891
_ZNK4sycl3_V16device13get_info_implINS0_4info6device32atomic_memory_order_capabilitiesEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38913892
_ZNK4sycl3_V16device13get_info_implINS0_4info6device32atomic_memory_scope_capabilitiesEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
3893+
_ZNK4sycl3_V16device13get_info_implINS0_4info6device32preferred_vector_width_long_longEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38923894
_ZNK4sycl3_V16device13get_info_implINS0_4info6device33ext_intel_gpu_subslices_per_sliceEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38933895
_ZNK4sycl3_V16device13get_info_implINS0_4info6device33ext_oneapi_max_global_work_groupsEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv
38943896
_ZNK4sycl3_V16device13get_info_implINS0_4info6device33usm_restricted_shared_allocationsEEENS0_6detail11ABINeutralTINS6_19is_device_info_descIT_E11return_typeEE4typeEv

sycl/test/abi/sycl_symbols_windows.dump

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
??$get_info_impl@Unative_vector_width_half@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
166166
??$get_info_impl@Unative_vector_width_int@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
167167
??$get_info_impl@Unative_vector_width_long@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
168+
??$get_info_impl@Unative_vector_width_long_long@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
168169
??$get_info_impl@Unative_vector_width_short@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
169170
??$get_info_impl@Unode_mask@device@info@intel@ext@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
170171
??$get_info_impl@Unum_args@kernel@info@_V1@sycl@@@kernel@_V1@sycl@@AEBAIXZ
@@ -185,6 +186,7 @@
185186
??$get_info_impl@Upreferred_vector_width_half@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
186187
??$get_info_impl@Upreferred_vector_width_int@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
187188
??$get_info_impl@Upreferred_vector_width_long@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
189+
??$get_info_impl@Upreferred_vector_width_long_long@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
188190
??$get_info_impl@Upreferred_vector_width_short@device@info@_V1@sycl@@@device@_V1@sycl@@AEBAIXZ
189191
??$get_info_impl@Uprintf_buffer_size@device@info@_V1@sycl@@@device@_V1@sycl@@AEBA_KXZ
190192
??$get_info_impl@Uprofile@device@info@_V1@sycl@@@device@_V1@sycl@@AEBA?AVstring@detail@12@XZ

unified-runtime/include/unified-runtime/ur_api.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,6 +2374,10 @@ typedef enum ur_device_info_t {
23742374
UR_DEVICE_INFO_LUID = 129,
23752375
/// [uint32_t][optional-query] return device Windows node mask
23762376
UR_DEVICE_INFO_NODE_MASK = 130,
2377+
/// [uint32_t] preferred vector width for long long
2378+
UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG = 131,
2379+
/// [uint32_t] native vector width for long long
2380+
UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG = 132,
23772381
/// [::ur_bool_t] Returns true if the device supports the use of
23782382
/// command-buffers.
23792383
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000,

unified-runtime/include/unified-runtime/ur_print.hpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,6 +3172,12 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
31723172
case UR_DEVICE_INFO_NODE_MASK:
31733173
os << "UR_DEVICE_INFO_NODE_MASK";
31743174
break;
3175+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG:
3176+
os << "UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG";
3177+
break;
3178+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG:
3179+
os << "UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG";
3180+
break;
31753181
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
31763182
os << "UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP";
31773183
break;
@@ -4986,6 +4992,32 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,
49864992

49874993
os << ")";
49884994
} break;
4995+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG: {
4996+
const uint32_t *tptr = (const uint32_t *)ptr;
4997+
if (sizeof(uint32_t) > size) {
4998+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t)
4999+
<< ")";
5000+
return UR_RESULT_ERROR_INVALID_SIZE;
5001+
}
5002+
os << (const void *)(tptr) << " (";
5003+
5004+
os << *tptr;
5005+
5006+
os << ")";
5007+
} break;
5008+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG: {
5009+
const uint32_t *tptr = (const uint32_t *)ptr;
5010+
if (sizeof(uint32_t) > size) {
5011+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t)
5012+
<< ")";
5013+
return UR_RESULT_ERROR_INVALID_SIZE;
5014+
}
5015+
os << (const void *)(tptr) << " (";
5016+
5017+
os << *tptr;
5018+
5019+
os << ")";
5020+
} break;
49895021
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
49905022
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
49915023
if (sizeof(ur_bool_t) > size) {

unified-runtime/scripts/core/device.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ etors:
470470
desc: "[uint8_t[]][optional-query] return device Windows LUID"
471471
- name: NODE_MASK
472472
desc: "[uint32_t][optional-query] return device Windows node mask"
473+
- name: PREFERRED_VECTOR_WIDTH_LONG_LONG
474+
desc: "[uint32_t] preferred vector width for long long"
475+
- name: NATIVE_VECTOR_WIDTH_LONG_LONG
476+
desc: "[uint32_t] native vector width for long long"
473477
--- #--------------------------------------------------------------------------
474478
type: function
475479
desc: "Retrieves various information about device"

unified-runtime/source/adapters/cuda/device.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
129129
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: {
130130
return ReturnValue(1u);
131131
}
132-
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: {
132+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG:
133+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG: {
133134
return ReturnValue(1u);
134135
}
135136
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: {
@@ -150,7 +151,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
150151
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: {
151152
return ReturnValue(1u);
152153
}
153-
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: {
154+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG:
155+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG: {
154156
return ReturnValue(1u);
155157
}
156158
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: {

unified-runtime/source/adapters/hip/device.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
137137
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT: {
138138
return ReturnValue(1u);
139139
}
140-
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG: {
140+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG:
141+
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG_LONG: {
141142
return ReturnValue(1u);
142143
}
143144
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT: {
@@ -158,7 +159,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
158159
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT: {
159160
return ReturnValue(1u);
160161
}
161-
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG: {
162+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG:
163+
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG_LONG: {
162164
return ReturnValue(1u);
163165
}
164166
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT: {

0 commit comments

Comments
 (0)