Skip to content

Commit 828b22a

Browse files
[SYCL] Move image-related code accessor.hpp -> accessor_image.hpp (#13754)
1 parent 91b840c commit 828b22a

File tree

4 files changed

+44
-52
lines changed

4 files changed

+44
-52
lines changed

sycl/include/sycl/accessor.hpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include <sycl/property_list.hpp> // for property_list
3939
#include <sycl/range.hpp> // for range
4040
#include <sycl/sampler.hpp> // for addressing_mode
41-
#include <sycl/types.hpp> // for vec
4241

4342
#include <cstddef> // for size_t
4443
#include <functional> // for hash
@@ -607,45 +606,6 @@ class __SYCL_EXPORT LocalAccessorBaseHost {
607606

608607
LocalAccessorImplPtr impl;
609608
};
610-
611-
template <int Dim, typename T> struct IsValidCoordDataT;
612-
template <typename T> struct IsValidCoordDataT<1, T> {
613-
constexpr static bool value = detail::is_contained<
614-
T, detail::type_list<opencl::cl_int, opencl::cl_float>>::type::value;
615-
};
616-
template <typename T> struct IsValidCoordDataT<2, T> {
617-
constexpr static bool value = detail::is_contained<
618-
T, detail::type_list<vec<opencl::cl_int, 2>,
619-
vec<opencl::cl_float, 2>>>::type::value;
620-
};
621-
template <typename T> struct IsValidCoordDataT<3, T> {
622-
constexpr static bool value = detail::is_contained<
623-
T, detail::type_list<vec<opencl::cl_int, 4>,
624-
vec<opencl::cl_float, 4>>>::type::value;
625-
};
626-
627-
template <int Dim, typename T> struct IsValidUnsampledCoord2020DataT;
628-
template <typename T> struct IsValidUnsampledCoord2020DataT<1, T> {
629-
constexpr static bool value = std::is_same_v<T, int>;
630-
};
631-
template <typename T> struct IsValidUnsampledCoord2020DataT<2, T> {
632-
constexpr static bool value = std::is_same_v<T, int2>;
633-
};
634-
template <typename T> struct IsValidUnsampledCoord2020DataT<3, T> {
635-
constexpr static bool value = std::is_same_v<T, int4>;
636-
};
637-
638-
template <int Dim, typename T> struct IsValidSampledCoord2020DataT;
639-
template <typename T> struct IsValidSampledCoord2020DataT<1, T> {
640-
constexpr static bool value = std::is_same_v<T, float>;
641-
};
642-
template <typename T> struct IsValidSampledCoord2020DataT<2, T> {
643-
constexpr static bool value = std::is_same_v<T, float2>;
644-
};
645-
template <typename T> struct IsValidSampledCoord2020DataT<3, T> {
646-
constexpr static bool value = std::is_same_v<T, float4>;
647-
};
648-
649609
} // namespace detail
650610

651611
/// Buffer accessor.

sycl/include/sycl/accessor_image.hpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,44 @@
1212
namespace sycl {
1313
inline namespace _V1 {
1414
namespace detail {
15+
template <int Dim, typename T> struct IsValidCoordDataT;
16+
template <typename T> struct IsValidCoordDataT<1, T> {
17+
constexpr static bool value = detail::is_contained<
18+
T, detail::type_list<opencl::cl_int, opencl::cl_float>>::type::value;
19+
};
20+
template <typename T> struct IsValidCoordDataT<2, T> {
21+
constexpr static bool value = detail::is_contained<
22+
T, detail::type_list<vec<opencl::cl_int, 2>,
23+
vec<opencl::cl_float, 2>>>::type::value;
24+
};
25+
template <typename T> struct IsValidCoordDataT<3, T> {
26+
constexpr static bool value = detail::is_contained<
27+
T, detail::type_list<vec<opencl::cl_int, 4>,
28+
vec<opencl::cl_float, 4>>>::type::value;
29+
};
30+
31+
template <int Dim, typename T> struct IsValidUnsampledCoord2020DataT;
32+
template <typename T> struct IsValidUnsampledCoord2020DataT<1, T> {
33+
constexpr static bool value = std::is_same_v<T, int>;
34+
};
35+
template <typename T> struct IsValidUnsampledCoord2020DataT<2, T> {
36+
constexpr static bool value = std::is_same_v<T, int2>;
37+
};
38+
template <typename T> struct IsValidUnsampledCoord2020DataT<3, T> {
39+
constexpr static bool value = std::is_same_v<T, int4>;
40+
};
41+
42+
template <int Dim, typename T> struct IsValidSampledCoord2020DataT;
43+
template <typename T> struct IsValidSampledCoord2020DataT<1, T> {
44+
constexpr static bool value = std::is_same_v<T, float>;
45+
};
46+
template <typename T> struct IsValidSampledCoord2020DataT<2, T> {
47+
constexpr static bool value = std::is_same_v<T, float2>;
48+
};
49+
template <typename T> struct IsValidSampledCoord2020DataT<3, T> {
50+
constexpr static bool value = std::is_same_v<T, float4>;
51+
};
52+
1553
void __SYCL_EXPORT unsampledImageConstructorNotification(
1654
void *ImageObj, void *AccessorObj,
1755
const std::optional<image_target> &Target, access::mode Mode,

sycl/test/include_deps/sycl_accessor.hpp.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,4 @@
117117
// CHECK-NEXT: properties/accessor_properties.hpp
118118
// CHECK-NEXT: properties/buffer_properties.hpp
119119
// CHECK-NEXT: sampler.hpp
120-
// CHECK-NEXT: types.hpp
121-
// CHECK-NEXT: marray.hpp
122-
// CHECK-NEXT: vector.hpp
123-
// CHECK-NEXT: detail/memcpy.hpp
124-
// CHECK-NEXT: detail/vector_convert.hpp
125-
// CHECK-NEXT: swizzles.def
126120
// CHECK-EMPTY:

sycl/test/include_deps/sycl_detail_core.hpp.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@
118118
// CHECK-NEXT: properties/accessor_properties.hpp
119119
// CHECK-NEXT: properties/buffer_properties.hpp
120120
// CHECK-NEXT: sampler.hpp
121-
// CHECK-NEXT: types.hpp
122-
// CHECK-NEXT: marray.hpp
123-
// CHECK-NEXT: vector.hpp
124-
// CHECK-NEXT: detail/memcpy.hpp
125-
// CHECK-NEXT: detail/vector_convert.hpp
126-
// CHECK-NEXT: swizzles.def
127121
// CHECK-NEXT: queue.hpp
128122
// CHECK-NEXT: detail/assert_happened.hpp
129123
// CHECK-NEXT: detail/cg_types.hpp
@@ -140,6 +134,12 @@
140134
// CHECK-NEXT: exception_list.hpp
141135
// CHECK-NEXT: image.hpp
142136
// CHECK-NEXT: detail/backend_traits.hpp
137+
// CHECK-NEXT: types.hpp
138+
// CHECK-NEXT: marray.hpp
139+
// CHECK-NEXT: vector.hpp
140+
// CHECK-NEXT: detail/memcpy.hpp
141+
// CHECK-NEXT: detail/vector_convert.hpp
142+
// CHECK-NEXT: swizzles.def
143143
// CHECK-NEXT: kernel_handler.hpp
144144
// CHECK-NEXT: nd_item.hpp
145145
// CHECK-NEXT: nd_range.hpp

0 commit comments

Comments
 (0)