Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion sycl/include/CL/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,19 @@ class __SYCL_EXPORT handler {
static_cast<int>(AccessTarget), ArgIndex);
}

template <typename T> void setArgHelper(int ArgIndex, T &&Arg) {
template <typename T> struct ShouldEnableSetArgHelper {
static constexpr bool value = std::is_trivially_copyable<T>::value
#ifdef CL_SYCL_LANGUAGE_VERSION
#if CL_SYCL_LANGUAGE_VERSION <= 121
&& std::is_standard_layout<T>::value
#endif
#endif
;
};

template <typename T>
typename std::enable_if<ShouldEnableSetArgHelper<T>::value, void>::type
setArgHelper(int ArgIndex, T &&Arg) {
void *StoredArg = (void *)storePlainArg(Arg);

if (!std::is_same<cl_mem, T>::value && std::is_pointer<T>::value) {
Expand Down