Skip to content

Commit 782de26

Browse files
Rename UnsupportedOnDevice -> SupportedOnDevice
1 parent 8200e4f commit 782de26

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

sycl/include/sycl/accessor.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,16 +2945,16 @@ struct std::hash<
29452945
: public sycl::detail::sycl_obj_hash<
29462946
sycl::accessor<DataT, Dimensions, AccessMode, AccessTarget,
29472947
IsPlaceholder>,
2948-
true /*UnsupportedOnDevice*/> {};
2948+
false /*SupportedOnDevice*/> {};
29492949

29502950
template <typename DataT, int Dimensions, sycl::access_mode AccessMode>
29512951
struct std::hash<sycl::host_accessor<DataT, Dimensions, AccessMode>>
29522952
: public sycl::detail::sycl_obj_hash<
29532953
sycl::host_accessor<DataT, Dimensions, AccessMode>,
2954-
true /*UnsupportedOnDevice*/> {};
2954+
false /*SupportedOnDevice*/> {};
29552955

29562956
template <typename DataT, int Dimensions>
29572957
struct std::hash<sycl::local_accessor<DataT, Dimensions>>
29582958
: public sycl::detail::sycl_obj_hash<
29592959
sycl::local_accessor<DataT, Dimensions>,
2960-
true /*UnsupportedOnDevice*/> {};
2960+
false /*SupportedOnDevice*/> {};

sycl/include/sycl/accessor_image.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ struct std::hash<
13641364
: public sycl::detail::sycl_obj_hash<
13651365
sycl::unsampled_image_accessor<DataT, Dimensions, AccessMode,
13661366
AccessTarget>,
1367-
true /*UnsupportedOnDevice*/> {};
1367+
false /*SupportedOnDevice*/> {};
13681368

13691369
template <typename DataT, int Dimensions, sycl::access_mode AccessMode>
13701370
struct std::hash<
@@ -1377,7 +1377,7 @@ template <typename DataT, int Dimensions, sycl::image_target AccessTarget>
13771377
struct std::hash<sycl::sampled_image_accessor<DataT, Dimensions, AccessTarget>>
13781378
: public sycl::detail::sycl_obj_hash<
13791379
sycl::sampled_image_accessor<DataT, Dimensions, AccessTarget>,
1380-
true /*UnsupportedOnDevice*/> {};
1380+
false /*SupportedOnDevice*/> {};
13811381

13821382
template <typename DataT, int Dimensions>
13831383
struct std::hash<sycl::host_sampled_image_accessor<DataT, Dimensions>>

sycl/include/sycl/detail/impl_utils.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ T createSyclObjFromImpl(
5959
return createSyclObjFromImpl<T>(ImplRef.shared_from_this());
6060
}
6161

62-
template <typename T, bool UnsupportedOnDevice = false> struct sycl_obj_hash {
62+
template <typename T, bool SupportedOnDevice = true> struct sycl_obj_hash {
6363
size_t operator()(const T &Obj) const {
64-
if constexpr (UnsupportedOnDevice) {
64+
if constexpr (SupportedOnDevice) {
65+
auto &Impl = sycl::detail::getSyclObjImpl(Obj);
66+
return std::hash<std::decay_t<decltype(Impl)>>{}(Impl);
67+
} else {
6568
#ifdef __SYCL_DEVICE_ONLY__
6669
(void)Obj;
6770
return 0;
6871
#else
6972
auto &Impl = sycl::detail::getSyclObjImpl(Obj);
7073
return std::hash<std::decay_t<decltype(Impl)>>{}(Impl);
7174
#endif
72-
} else {
73-
auto &Impl = sycl::detail::getSyclObjImpl(Obj);
74-
return std::hash<std::decay_t<decltype(Impl)>>{}(Impl);
7575
}
7676
}
7777
};

sycl/include/sycl/sampler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ struct image_sampler {
149149
template <>
150150
struct std::hash<sycl::sampler>
151151
: public sycl::detail::sycl_obj_hash<sycl::sampler,
152-
true /*UnsupportedOnDevice*/> {};
152+
false /*SupportedOnDevice*/> {};

sycl/include/sycl/stream.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,4 +1308,4 @@ inline const stream &operator<<(const stream &Out, const T &RHS) {
13081308
template <>
13091309
struct std::hash<sycl::stream>
13101310
: public sycl::detail::sycl_obj_hash<sycl::stream,
1311-
true /*UnsupportedOnDevice*/> {};
1311+
false /*SupportedOnDevice*/> {};

0 commit comments

Comments
 (0)