Skip to content

Commit 9601c4c

Browse files
committed
Propagate is_device_copyable onto const
Signed-off-by: Steffen Larsen <[email protected]>
1 parent f565f5c commit 9601c4c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sycl/include/CL/sycl/types.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,12 @@ struct is_device_copyable<
23992399
T, std::enable_if_t<std::is_trivially_copyable<T>::value>>
24002400
: std::true_type {};
24012401

2402+
// Specializations of device copyable should propagate onto constants.
2403+
template <typename T>
2404+
struct is_device_copyable<
2405+
const T, std::enable_if_t<!std::is_trivially_copyable<const T>::value>>
2406+
: is_device_copyable<T> {};
2407+
24022408
#if __cplusplus >= 201703L
24032409
template <typename T>
24042410
inline constexpr bool is_device_copyable_v = is_device_copyable<T>::value;

0 commit comments

Comments
 (0)