Skip to content

Commit 9efd43a

Browse files
[SYCL][NFC] Public headers cleanup (#15536)
The main change is that specializations of `UrInfoCode` were moved into library, because they are not used in public headers. Also removed some of unnecessary `#include`s here and there.
1 parent 184949d commit 9efd43a

19 files changed

+95
-45
lines changed

sycl/include/sycl/context.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <sycl/backend_types.hpp> // for backend, backend_return_t
1313
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
1414
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
15-
#include <sycl/detail/helpers.hpp> // for context_impl
1615
#include <sycl/detail/info_desc_helpers.hpp> // for is_context_info_desc
1716
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
1817
#include <sycl/platform.hpp> // for platform

sycl/include/sycl/detail/info_desc_helpers.hpp

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
#pragma once
1010

11-
#include <ur_api.h>
12-
1311
#include <type_traits> // for true_type
1412

1513
// FIXME: .def files included to this file use all sorts of SYCL objects like
@@ -22,8 +20,6 @@
2220
namespace sycl {
2321
inline namespace _V1 {
2422
namespace detail {
25-
template <typename T> struct PiInfoCode;
26-
template <typename T> struct UrInfoCode;
2723
template <typename T> struct is_platform_info_desc : std::false_type {};
2824
template <typename T> struct is_context_info_desc : std::false_type {};
2925
template <typename T> struct is_device_info_desc : std::false_type {};
@@ -47,10 +43,6 @@ template <typename T> struct is_backend_info_desc : std::false_type {};
4743
// Similar approach to limit valid get_backend_info template argument
4844

4945
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, UrCode) \
50-
template <> struct UrInfoCode<info::DescType::Desc> { \
51-
static constexpr ur_##DescType##_info_t value = \
52-
static_cast<ur_##DescType##_info_t>(UrCode); \
53-
}; \
5446
template <> \
5547
struct is_##DescType##_info_desc<info::DescType::Desc> : std::true_type { \
5648
using return_type = info::DescType::Desc::return_type; \
@@ -63,9 +55,6 @@ template <typename T> struct is_backend_info_desc : std::false_type {};
6355
#undef __SYCL_PARAM_TRAITS_SPEC
6456

6557
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, UrCode) \
66-
template <> struct UrInfoCode<info::DescType::Desc> { \
67-
static constexpr ur_profiling_info_t value = UrCode; \
68-
}; \
6958
template <> \
7059
struct is_##DescType##_info_desc<info::DescType::Desc> : std::true_type { \
7160
using return_type = info::DescType::Desc::return_type; \
@@ -92,25 +81,14 @@ struct IsKernelInfo<info::kernel_device_specific::ext_codeplay_num_regs>
9281
: std::true_type {};
9382

9483
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, UrCode) \
95-
template <> struct UrInfoCode<info::DescType::Desc> { \
96-
static constexpr typename std::conditional< \
97-
IsSubGroupInfo<info::DescType::Desc>::value, \
98-
ur_kernel_sub_group_info_t, \
99-
std::conditional<IsKernelInfo<info::DescType::Desc>::value, \
100-
ur_kernel_info_t, \
101-
ur_kernel_group_info_t>::type>::type value = UrCode; \
102-
}; \
10384
template <> \
10485
struct is_##DescType##_info_desc<info::DescType::Desc> : std::true_type { \
10586
using return_type = info::DescType::Desc::return_type; \
10687
};
10788
#include <sycl/info/kernel_device_specific_traits.def>
10889
#undef __SYCL_PARAM_TRAITS_SPEC
90+
10991
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, UrCode) \
110-
template <> struct UrInfoCode<info::DescType::Desc> { \
111-
static constexpr ur_device_info_t value = \
112-
static_cast<ur_device_info_t>(UrCode); \
113-
}; \
11492
template <> \
11593
struct is_##DescType##_info_desc<info::DescType::Desc> : std::true_type { \
11694
using return_type = info::DescType::Desc::return_type; \
@@ -122,11 +100,8 @@ struct IsKernelInfo<info::kernel_device_specific::ext_codeplay_num_regs>
122100

123101
#undef __SYCL_PARAM_TRAITS_SPEC
124102
#undef __SYCL_PARAM_TRAITS_SPEC_SPECIALIZED
103+
125104
#define __SYCL_PARAM_TRAITS_SPEC(Namespace, DescType, Desc, ReturnT, UrCode) \
126-
template <> struct UrInfoCode<Namespace::info::DescType::Desc> { \
127-
static constexpr ur_device_info_t value = \
128-
static_cast<ur_device_info_t>(UrCode); \
129-
}; \
130105
template <> \
131106
struct is_##DescType##_info_desc<Namespace::info::DescType::Desc> \
132107
: std::true_type { \

sycl/include/sycl/exception.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// 4.9.2 Exception Class Interface
1212

13-
#include <sycl/detail/cl.h> // for cl_int
1413
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
1514
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
1615
#include <sycl/detail/string.hpp>

sycl/include/sycl/handler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <sycl/accessor.hpp>
1313
#include <sycl/context.hpp>
1414
#include <sycl/detail/cg_types.hpp>
15+
#include <sycl/detail/cl.h>
1516
#include <sycl/detail/common.hpp>
1617
#include <sycl/detail/defines_elementary.hpp>
1718
#include <sycl/detail/export.hpp>

sycl/include/sycl/stream.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <sycl/detail/defines.hpp> // for __SYCL_SPECIAL_CLASS, __S...
1818
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
1919
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
20-
#include <sycl/detail/item_base.hpp> // for id, range
2120
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
2221
#include <sycl/ext/oneapi/bfloat16.hpp> // for bfloat16
2322
#include <sycl/group.hpp> // for group

sycl/source/detail/context_info.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#pragma once
1010

1111
#include <detail/context_impl.hpp>
12+
#include <detail/ur_info_code.hpp>
1213
#include <sycl/detail/common.hpp>
1314
#include <sycl/detail/info_desc_helpers.hpp>
1415
#include <sycl/info/info_desc.hpp>

sycl/source/detail/device_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <detail/device_impl.hpp>
1010
#include <detail/device_info.hpp>
1111
#include <detail/platform_impl.hpp>
12+
#include <detail/ur_info_code.hpp>
1213
#include <sycl/detail/ur.hpp>
1314
#include <sycl/device.hpp>
1415

sycl/source/detail/device_info.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <detail/platform_impl.hpp>
1414
#include <detail/platform_util.hpp>
1515
#include <detail/program_manager/program_manager.hpp>
16+
#include <detail/ur_info_code.hpp>
1617
#include <sycl/detail/defines.hpp>
1718
#include <sycl/detail/os_util.hpp>
1819
#include <sycl/detail/ur.hpp>

sycl/source/detail/event_info.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <detail/adapter.hpp>
1212
#include <detail/event_impl.hpp>
13+
#include <detail/ur_info_code.hpp>
1314
#include <sycl/detail/common.hpp>
1415
#include <sycl/detail/info_desc_helpers.hpp>
1516
#include <sycl/info/info_desc.hpp>

sycl/source/detail/kernel_info.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#pragma once
1010

1111
#include <detail/error_handling/error_handling.hpp>
12+
#include <detail/ur_info_code.hpp>
1213
#include <sycl/detail/common.hpp>
1314
#include <sycl/detail/info_desc_helpers.hpp>
1415
#include <sycl/detail/ur.hpp>

0 commit comments

Comments
 (0)