Skip to content

Commit 590ed41

Browse files
author
Ivan Karachun
committed
Relaxed requirement for SYCL-2020's set_arg.
Signed-off-by: Ivan Karachun <[email protected]>
1 parent d0a396b commit 590ed41

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

sycl/include/CL/sycl/handler.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,16 @@ class __SYCL_EXPORT handler {
386386
static_cast<int>(AccessTarget), ArgIndex);
387387
}
388388

389+
template <typename T> struct ShouldEnableSetArgHelper {
390+
static constexpr bool value = std::is_trivially_copyable<T>::value
391+
#if CL_SYCL_LANGUAGE_VERSION <= 121
392+
&& std::is_standard_layout<T>::value
393+
#endif
394+
;
395+
};
396+
389397
template <typename T>
390-
typename std::enable_if<std::is_trivially_copyable<T>::value &&
391-
std::is_standard_layout<T>::value,
392-
void>::type
398+
typename std::enable_if<ShouldEnableSetArgHelper<T>::value, void>::type
393399
setArgHelper(int ArgIndex, T &&Arg) {
394400
void *StoredArg = (void *)storePlainArg(Arg);
395401

0 commit comments

Comments
 (0)