Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions sycl/source/detail/device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,62 +467,6 @@ device_impl::getImmediateProgressGuarantee(
return forward_progress_guarantee::weakly_parallel;
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#define EXPORT_GET_INFO(PARAM) \
template <> \
__SYCL_EXPORT PARAM::return_type device_impl::get_info<PARAM>() const { \
return get_info_abi_workaround<PARAM>(); \
}

// clang-format off
EXPORT_GET_INFO(ext::intel::info::device::device_id)
EXPORT_GET_INFO(ext::intel::info::device::pci_address)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_simd_width)
EXPORT_GET_INFO(ext::intel::info::device::gpu_slices)
EXPORT_GET_INFO(ext::intel::info::device::gpu_subslices_per_slice)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count_per_subslice)
EXPORT_GET_INFO(ext::intel::info::device::gpu_hw_threads_per_eu)
EXPORT_GET_INFO(ext::intel::info::device::max_mem_bandwidth)
EXPORT_GET_INFO(ext::intel::info::device::uuid)
EXPORT_GET_INFO(ext::intel::info::device::free_memory)
EXPORT_GET_INFO(ext::intel::info::device::memory_clock_rate)
EXPORT_GET_INFO(ext::intel::info::device::memory_bus_width)
EXPORT_GET_INFO(ext::intel::info::device::max_compute_queue_indices)
EXPORT_GET_INFO(ext::intel::esimd::info::device::has_2d_block_io_support)
EXPORT_GET_INFO(ext::intel::info::device::current_clock_throttle_reasons)
EXPORT_GET_INFO(ext::intel::info::device::fan_speed)
EXPORT_GET_INFO(ext::intel::info::device::min_power_limit)
EXPORT_GET_INFO(ext::intel::info::device::max_power_limit)

EXPORT_GET_INFO(ext::codeplay::experimental::info::device::supports_fusion)
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::max_registers_per_work_group)

EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_global_work_groups)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<1>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<2>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<3>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::sub_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::architecture)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::matrix_combinations)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::image_row_pitch_align)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_row_pitch)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_width)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_height)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::mipmap_max_anisotropy)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::component_devices)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::composite_device)
EXPORT_GET_INFO(ext::oneapi::info::device::num_compute_units)
// clang-format on

#undef EXPORT_GET_INFO
#endif

} // namespace detail
} // namespace _V1
} // namespace sycl
130 changes: 19 additions & 111 deletions sycl/source/detail/device_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
struct InfoInitializer {
template <typename Desc>
static void init(device_impl &device, typename Desc::return_type &value) {
value = device.
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
get_info
#else
get_info_abi_workaround
#endif
<Desc, true /* InitializingCache */>();
value = device.get_info<Desc, true /* InitializingCache */>();
}
};

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

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

// With the return type of this function being automatically
Expand Down Expand Up @@ -614,12 +593,12 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
}
CASE(info::device::max_work_item_sizes<2>) {
range<3> r3 =
CALL_GET_INFO<info::device::max_work_item_sizes<3>, DependentFalse>();
get_info<info::device::max_work_item_sizes<3>, DependentFalse>();
return range<2>{r3[1], r3[2]};
}
CASE(info::device::max_work_item_sizes<1>) {
range<3> r3 =
CALL_GET_INFO<info::device::max_work_item_sizes<3>, DependentFalse>();
get_info<info::device::max_work_item_sizes<3>, DependentFalse>();
return range<1>{r3[2]};
}

Expand Down Expand Up @@ -710,8 +689,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
';');
}
CASE(info::device::built_in_kernel_ids) {
auto names =
CALL_GET_INFO<info::device::built_in_kernels, DependentFalse>();
auto names = get_info<info::device::built_in_kernels, DependentFalse>();

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

CASE(info::device::ext_oneapi_max_global_work_groups) {
// Deprecated alias.
return CALL_GET_INFO<
return get_info<
ext::oneapi::experimental::info::device::max_global_work_groups,
DependentFalse>();
}
CASE(info::device::ext_oneapi_max_work_groups_1d) {
// Deprecated alias.
return CALL_GET_INFO<
return get_info<
ext::oneapi::experimental::info::device::max_work_groups<1>,
DependentFalse>();
}
CASE(info::device::ext_oneapi_max_work_groups_2d) {
// Deprecated alias.
return CALL_GET_INFO<
return get_info<
ext::oneapi::experimental::info::device::max_work_groups<2>,
DependentFalse>();
}
CASE(info::device::ext_oneapi_max_work_groups_3d) {
// Deprecated alias.
return CALL_GET_INFO<
return get_info<
ext::oneapi::experimental::info::device::max_work_groups<3>,
DependentFalse>();
}
Expand All @@ -936,7 +914,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
return static_cast<size_t>((std::numeric_limits<int>::max)());
}
CASE(ext::oneapi::experimental::info::device::max_work_groups<3>) {
size_t Limit = CALL_GET_INFO<
size_t Limit = get_info<
ext::oneapi::experimental::info::device::max_global_work_groups,
DependentFalse>();

Expand All @@ -949,15 +927,15 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
std::min(Limit, result[0]));
}
CASE(ext::oneapi::experimental::info::device::max_work_groups<2>) {
id<3> max_3d = CALL_GET_INFO<
ext::oneapi::experimental::info::device::max_work_groups<3>,
DependentFalse>();
id<3> max_3d =
get_info<ext::oneapi::experimental::info::device::max_work_groups<3>,
DependentFalse>();
return id<2>{max_3d[1], max_3d[2]};
}
CASE(ext::oneapi::experimental::info::device::max_work_groups<1>) {
id<3> max_3d = CALL_GET_INFO<
ext::oneapi::experimental::info::device::max_work_groups<3>,
DependentFalse>();
id<3> max_3d =
get_info<ext::oneapi::experimental::info::device::max_work_groups<3>,
DependentFalse>();
return id<1>{max_3d[2]};
}

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

return Arch ==
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
get_info
#else
get_info_abi_workaround
#endif
<ext::oneapi::experimental::info::device::architecture>();
get_info<ext::oneapi::experimental::info::device::architecture>();
}

bool extOneapiArchitectureIs(
Expand All @@ -1666,12 +1639,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
get_category_max_architecture(Category);
if (CategoryMinArch.has_value() && CategoryMaxArch.has_value()) {
auto Arch =
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
get_info
#else
get_info_abi_workaround
#endif
<ext::oneapi::experimental::info::device::architecture>();
get_info<ext::oneapi::experimental::info::device::architecture>();
return CategoryMinArch <= Arch && Arch <= CategoryMaxArch;
}
return false;
Expand Down Expand Up @@ -1969,7 +1937,7 @@ class device_impl : public std::enable_shared_from_this<device_impl> {
// sycl_ext_oneapi_device_architecture, the runtime exception is
// omitted, and std::nullopt is returned.
try {
return CALL_GET_INFO<
return get_info<
ext::oneapi::experimental::info::device::architecture>();
} catch (sycl::exception &e) {
if (e.code() != errc::runtime)
Expand Down Expand Up @@ -2357,66 +2325,6 @@ class devices_range : public iterator_range<devices_iterator> {
}
};

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
template <typename Param>
typename Param::return_type device_impl::get_info() const {
return get_info_abi_workaround<Param>();
}

#define EXPORT_GET_INFO(PARAM) \
template <> \
__SYCL_EXPORT PARAM::return_type device_impl::get_info<PARAM>() const;

// clang-format off
EXPORT_GET_INFO(ext::intel::info::device::device_id)
EXPORT_GET_INFO(ext::intel::info::device::pci_address)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_simd_width)
EXPORT_GET_INFO(ext::intel::info::device::gpu_slices)
EXPORT_GET_INFO(ext::intel::info::device::gpu_subslices_per_slice)
EXPORT_GET_INFO(ext::intel::info::device::gpu_eu_count_per_subslice)
EXPORT_GET_INFO(ext::intel::info::device::gpu_hw_threads_per_eu)
EXPORT_GET_INFO(ext::intel::info::device::max_mem_bandwidth)
EXPORT_GET_INFO(ext::intel::info::device::uuid)
EXPORT_GET_INFO(ext::intel::info::device::free_memory)
EXPORT_GET_INFO(ext::intel::info::device::memory_clock_rate)
EXPORT_GET_INFO(ext::intel::info::device::memory_bus_width)
EXPORT_GET_INFO(ext::intel::info::device::max_compute_queue_indices)
EXPORT_GET_INFO(ext::intel::esimd::info::device::has_2d_block_io_support)
EXPORT_GET_INFO(ext::intel::info::device::current_clock_throttle_reasons)
EXPORT_GET_INFO(ext::intel::info::device::fan_speed)
EXPORT_GET_INFO(ext::intel::info::device::min_power_limit)
EXPORT_GET_INFO(ext::intel::info::device::max_power_limit)

EXPORT_GET_INFO(ext::codeplay::experimental::info::device::supports_fusion)
EXPORT_GET_INFO(ext::codeplay::experimental::info::device::max_registers_per_work_group)

EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_global_work_groups)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<1>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<2>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_work_groups<3>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::sub_group_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::root_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::work_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::work_item_progress_capabilities<ext::oneapi::experimental::execution_scope::sub_group>)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::architecture)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::matrix_combinations)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::image_row_pitch_align)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_row_pitch)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_width)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::max_image_linear_height)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::mipmap_max_anisotropy)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::component_devices)
EXPORT_GET_INFO(ext::oneapi::experimental::info::device::composite_device)
EXPORT_GET_INFO(ext::oneapi::info::device::num_compute_units)
// clang-format on

#undef EXPORT_GET_INFO
#endif

#undef CALL_GET_INFO
} // namespace detail
} // namespace _V1
} // namespace sycl
9 changes: 2 additions & 7 deletions sycl/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,8 @@ detail::ABINeutralT_t<typename detail::is_device_info_desc<Param>::return_type>
device::get_info_impl() const {
static_assert(
std::is_same_v<typename detail::is_device_info_desc<Param>::return_type,
decltype(impl->template
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
get_info
#else
get_info_abi_workaround
#endif
<Param, true /* InitializingCache */>())>);
decltype(impl->template get_info<
Param, true /* InitializingCache */>())>);
return detail::convert_to_abi_neutral(impl->template get_info<Param>());
}

Expand Down
Loading
Loading