Skip to content

Commit b4aedf0

Browse files
authored
[SYCL][ABI-break] Cleanup get_info ABI entry points (#20770)
We are in the abi breaking window, so we can cleanup these entries. Co-authored-by: Steffen Larsen [email protected]
1 parent 7f1b981 commit b4aedf0

File tree

5 files changed

+21
-256
lines changed

5 files changed

+21
-256
lines changed

sycl/source/detail/device_impl.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -467,62 +467,6 @@ device_impl::getImmediateProgressGuarantee(
467467
return forward_progress_guarantee::weakly_parallel;
468468
}
469469

470-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
471-
#define EXPORT_GET_INFO(PARAM) \
472-
template <> \
473-
__SYCL_EXPORT PARAM::return_type device_impl::get_info<PARAM>() const { \
474-
return get_info_abi_workaround<PARAM>(); \
475-
}
476-
477-
// clang-format off
478-
EXPORT_GET_INFO(ext::intel::info::device::device_id)
479-
EXPORT_GET_INFO(ext::intel::info::device::pci_address)
480-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count)
481-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_simd_width)
482-
EXPORT_GET_INFO(ext::intel::info::device::gpu_slices)
483-
EXPORT_GET_INFO(ext::intel::info::device::gpu_subslices_per_slice)
484-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count_per_subslice)
485-
EXPORT_GET_INFO(ext::intel::info::device::gpu_hw_threads_per_eu)
486-
EXPORT_GET_INFO(ext::intel::info::device::max_mem_bandwidth)
487-
EXPORT_GET_INFO(ext::intel::info::device::uuid)
488-
EXPORT_GET_INFO(ext::intel::info::device::free_memory)
489-
EXPORT_GET_INFO(ext::intel::info::device::memory_clock_rate)
490-
EXPORT_GET_INFO(ext::intel::info::device::memory_bus_width)
491-
EXPORT_GET_INFO(ext::intel::info::device::max_compute_queue_indices)
492-
EXPORT_GET_INFO(ext::intel::esimd::info::device::has_2d_block_io_support)
493-
EXPORT_GET_INFO(ext::intel::info::device::current_clock_throttle_reasons)
494-
EXPORT_GET_INFO(ext::intel::info::device::fan_speed)
495-
EXPORT_GET_INFO(ext::intel::info::device::min_power_limit)
496-
EXPORT_GET_INFO(ext::intel::info::device::max_power_limit)
497-
498-
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::supports_fusion)
499-
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::max_registers_per_work_group)
500-
501-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_global_work_groups)
502-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<1>)
503-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<2>)
504-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<3>)
505-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
506-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
507-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
508-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
509-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
510-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::sub_group>)
511-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::architecture)
512-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::matrix_combinations)
513-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::image_row_pitch_align)
514-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_row_pitch)
515-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_width)
516-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_height)
517-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::mipmap_max_anisotropy)
518-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::component_devices)
519-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::composite_device)
520-
EXPORT_GET_INFO(ext::oneapi::info::device::num_compute_units)
521-
// clang-format on
522-
523-
#undef EXPORT_GET_INFO
524-
#endif
525-
526470
} // namespace detail
527471
} // namespace _V1
528472
} // namespace sycl

sycl/source/detail/device_impl.hpp

Lines changed: 19 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
379379
struct InfoInitializer {
380380
template <typename Desc>
381381
static void init(device_impl &device, typename Desc::return_type &value) {
382-
value = device.
383-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
384-
get_info
385-
#else
386-
get_info_abi_workaround
387-
#endif
388-
<Desc, true /* InitializingCache */>();
382+
value = device.get_info<Desc, true /* InitializingCache */>();
389383
}
390384
};
391385

@@ -562,23 +556,8 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
562556
///
563557
/// \return device info of type described in Table 4.20.
564558

565-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
566559
template <typename Param, bool InitializingCache = false>
567560
decltype(auto) get_info() const {
568-
#define CALL_GET_INFO get_info
569-
#else
570-
// We've been exporting
571-
// `device_impl::get_info<ext::<whatever>::info::device::<descriptor>` for no
572-
// reason. Have to keep doing that until next ABI breaking window. Also, old
573-
// gcc doesn't allow in-class specializations, so they have to go out-of-class
574-
// which happens later then implicit instantiatons of delegating to
575-
// `get_info<other_descriptor>`. As such, all such calls have to go through
576-
// `get_info_abi_workaround` for which we need this ugly macro:
577-
#define CALL_GET_INFO get_info_abi_workaround
578-
template <typename Param> typename Param::return_type get_info() const;
579-
template <typename Param, bool InitializingCache = false>
580-
decltype(auto) get_info_abi_workaround() const {
581-
#endif
582561
using execution_scope = ext::oneapi::experimental::execution_scope;
583562

584563
// With the return type of this function being automatically
@@ -614,12 +593,12 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
614593
}
615594
CASE(info::device::max_work_item_sizes<2>) {
616595
range<3> r3 =
617-
CALL_GET_INFO<info::device::max_work_item_sizes<3>, DependentFalse>();
596+
get_info<info::device::max_work_item_sizes<3>, DependentFalse>();
618597
return range<2>{r3[1], r3[2]};
619598
}
620599
CASE(info::device::max_work_item_sizes<1>) {
621600
range<3> r3 =
622-
CALL_GET_INFO<info::device::max_work_item_sizes<3>, DependentFalse>();
601+
get_info<info::device::max_work_item_sizes<3>, DependentFalse>();
623602
return range<1>{r3[2]};
624603
}
625604

@@ -710,8 +689,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
710689
';');
711690
}
712691
CASE(info::device::built_in_kernel_ids) {
713-
auto names =
714-
CALL_GET_INFO<info::device::built_in_kernels, DependentFalse>();
692+
auto names = get_info<info::device::built_in_kernels, DependentFalse>();
715693

716694
std::vector<kernel_id> ids;
717695
ids.reserve(names.size());
@@ -893,25 +871,25 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
893871

894872
CASE(info::device::ext_oneapi_max_global_work_groups) {
895873
// Deprecated alias.
896-
return CALL_GET_INFO<
874+
return get_info<
897875
ext::oneapi::experimental::info::device::max_global_work_groups,
898876
DependentFalse>();
899877
}
900878
CASE(info::device::ext_oneapi_max_work_groups_1d) {
901879
// Deprecated alias.
902-
return CALL_GET_INFO<
880+
return get_info<
903881
ext::oneapi::experimental::info::device::max_work_groups<1>,
904882
DependentFalse>();
905883
}
906884
CASE(info::device::ext_oneapi_max_work_groups_2d) {
907885
// Deprecated alias.
908-
return CALL_GET_INFO<
886+
return get_info<
909887
ext::oneapi::experimental::info::device::max_work_groups<2>,
910888
DependentFalse>();
911889
}
912890
CASE(info::device::ext_oneapi_max_work_groups_3d) {
913891
// Deprecated alias.
914-
return CALL_GET_INFO<
892+
return get_info<
915893
ext::oneapi::experimental::info::device::max_work_groups<3>,
916894
DependentFalse>();
917895
}
@@ -936,7 +914,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
936914
return static_cast<size_t>((std::numeric_limits<int>::max)());
937915
}
938916
CASE(ext::oneapi::experimental::info::device::max_work_groups<3>) {
939-
size_t Limit = CALL_GET_INFO<
917+
size_t Limit = get_info<
940918
ext::oneapi::experimental::info::device::max_global_work_groups,
941919
DependentFalse>();
942920

@@ -949,15 +927,15 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
949927
std::min(Limit, result[0]));
950928
}
951929
CASE(ext::oneapi::experimental::info::device::max_work_groups<2>) {
952-
id<3> max_3d = CALL_GET_INFO<
953-
ext::oneapi::experimental::info::device::max_work_groups<3>,
954-
DependentFalse>();
930+
id<3> max_3d =
931+
get_info<ext::oneapi::experimental::info::device::max_work_groups<3>,
932+
DependentFalse>();
955933
return id<2>{max_3d[1], max_3d[2]};
956934
}
957935
CASE(ext::oneapi::experimental::info::device::max_work_groups<1>) {
958-
id<3> max_3d = CALL_GET_INFO<
959-
ext::oneapi::experimental::info::device::max_work_groups<3>,
960-
DependentFalse>();
936+
id<3> max_3d =
937+
get_info<ext::oneapi::experimental::info::device::max_work_groups<3>,
938+
DependentFalse>();
961939
return id<1>{max_3d[2]};
962940
}
963941

@@ -1493,7 +1471,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
14931471
}
14941472
}
14951473
CASE(ext_oneapi_is_composite) {
1496-
auto components = CALL_GET_INFO<
1474+
auto components = get_info<
14971475
sycl::ext::oneapi::experimental::info::device::component_devices>();
14981476
// Any device with ext_oneapi_is_composite aspect will have at least two
14991477
// constituent component devices.
@@ -1650,12 +1628,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
16501628
extOneapiArchitectureIs(ext::oneapi::experimental::architecture Arch) const {
16511629

16521630
return Arch ==
1653-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1654-
get_info
1655-
#else
1656-
get_info_abi_workaround
1657-
#endif
1658-
<ext::oneapi::experimental::info::device::architecture>();
1631+
get_info<ext::oneapi::experimental::info::device::architecture>();
16591632
}
16601633

16611634
bool extOneapiArchitectureIs(
@@ -1666,12 +1639,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
16661639
get_category_max_architecture(Category);
16671640
if (CategoryMinArch.has_value() && CategoryMaxArch.has_value()) {
16681641
auto Arch =
1669-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
1670-
get_info
1671-
#else
1672-
get_info_abi_workaround
1673-
#endif
1674-
<ext::oneapi::experimental::info::device::architecture>();
1642+
get_info<ext::oneapi::experimental::info::device::architecture>();
16751643
return CategoryMinArch <= Arch && Arch <= CategoryMaxArch;
16761644
}
16771645
return false;
@@ -1969,7 +1937,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
19691937
// sycl_ext_oneapi_device_architecture, the runtime exception is
19701938
// omitted, and std::nullopt is returned.
19711939
try {
1972-
return CALL_GET_INFO<
1940+
return get_info<
19731941
ext::oneapi::experimental::info::device::architecture>();
19741942
} catch (sycl::exception &e) {
19751943
if (e.code() != errc::runtime)
@@ -2358,66 +2326,6 @@ class devices_range : public iterator_range<devices_iterator> {
23582326
}
23592327
};
23602328

2361-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
2362-
template <typename Param>
2363-
typename Param::return_type device_impl::get_info() const {
2364-
return get_info_abi_workaround<Param>();
2365-
}
2366-
2367-
#define EXPORT_GET_INFO(PARAM) \
2368-
template <> \
2369-
__SYCL_EXPORT PARAM::return_type device_impl::get_info<PARAM>() const;
2370-
2371-
// clang-format off
2372-
EXPORT_GET_INFO(ext::intel::info::device::device_id)
2373-
EXPORT_GET_INFO(ext::intel::info::device::pci_address)
2374-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count)
2375-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_simd_width)
2376-
EXPORT_GET_INFO(ext::intel::info::device::gpu_slices)
2377-
EXPORT_GET_INFO(ext::intel::info::device::gpu_subslices_per_slice)
2378-
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count_per_subslice)
2379-
EXPORT_GET_INFO(ext::intel::info::device::gpu_hw_threads_per_eu)
2380-
EXPORT_GET_INFO(ext::intel::info::device::max_mem_bandwidth)
2381-
EXPORT_GET_INFO(ext::intel::info::device::uuid)
2382-
EXPORT_GET_INFO(ext::intel::info::device::free_memory)
2383-
EXPORT_GET_INFO(ext::intel::info::device::memory_clock_rate)
2384-
EXPORT_GET_INFO(ext::intel::info::device::memory_bus_width)
2385-
EXPORT_GET_INFO(ext::intel::info::device::max_compute_queue_indices)
2386-
EXPORT_GET_INFO(ext::intel::esimd::info::device::has_2d_block_io_support)
2387-
EXPORT_GET_INFO(ext::intel::info::device::current_clock_throttle_reasons)
2388-
EXPORT_GET_INFO(ext::intel::info::device::fan_speed)
2389-
EXPORT_GET_INFO(ext::intel::info::device::min_power_limit)
2390-
EXPORT_GET_INFO(ext::intel::info::device::max_power_limit)
2391-
2392-
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::supports_fusion)
2393-
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::max_registers_per_work_group)
2394-
2395-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_global_work_groups)
2396-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<1>)
2397-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<2>)
2398-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<3>)
2399-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
2400-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
2401-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
2402-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
2403-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
2404-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::sub_group>)
2405-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::architecture)
2406-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::matrix_combinations)
2407-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::image_row_pitch_align)
2408-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_row_pitch)
2409-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_width)
2410-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_height)
2411-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::mipmap_max_anisotropy)
2412-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::component_devices)
2413-
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::composite_device)
2414-
EXPORT_GET_INFO(ext::oneapi::info::device::num_compute_units)
2415-
// clang-format on
2416-
2417-
#undef EXPORT_GET_INFO
2418-
#endif
2419-
2420-
#undef CALL_GET_INFO
24212329
} // namespace detail
24222330
} // namespace _V1
24232331
} // namespace sycl

sycl/source/device.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,8 @@ detail::ABINeutralT_t<typename detail::is_device_info_desc<Param>::return_type>
127127
device::get_info_impl() const {
128128
static_assert(
129129
std::is_same_v<typename detail::is_device_info_desc<Param>::return_type,
130-
decltype(impl->template
131-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
132-
get_info
133-
#else
134-
get_info_abi_workaround
135-
#endif
136-
<Param, true /* InitializingCache */>())>);
130+
decltype(impl->template get_info<
131+
Param, true /* InitializingCache */>())>);
137132
return detail::convert_to_abi_neutral(impl->template get_info<Param>());
138133
}
139134

0 commit comments

Comments
 (0)