Skip to content

Commit

Permalink
Bugfix for device copyable of unique copy helper (#2004)
Browse files Browse the repository at this point in the history
The ValueType should not be necessary for device copyability because it is not a member field of the helper struct. It is only the return value of the callable. Therefore, we should not base device copyability on it.

Signed-off-by: Dan Hoeflinger <[email protected]>
  • Loading branch information
danhoeflinger authored Jan 24, 2025
1 parent 780705c commit a3ea7ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/oneapi/dpl/pstl/hetero/dpcpp/sycl_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct sycl::is_device_copyable<_ONEDPL_SPECIALIZE_FOR(oneapi::dpl::__internal::
template <typename _Predicate, typename _ValueType>
struct sycl::is_device_copyable<_ONEDPL_SPECIALIZE_FOR(oneapi::dpl::__internal::__create_mask_unique_copy, _Predicate,
_ValueType)>
: oneapi::dpl::__internal::__are_all_device_copyable<_Predicate, _ValueType>
: oneapi::dpl::__internal::__are_all_device_copyable<_Predicate>
{
};

Expand Down
4 changes: 4 additions & 0 deletions test/general/implementation_details/device_copyable.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ test_device_copyable()
static_assert(sycl::is_device_copyable_v<
oneapi::dpl::__internal::__create_mask_unique_copy<noop_device_copyable, int_device_copyable>>,
"__create_mask_unique_copy is not device copyable with device copyable types");
static_assert(sycl::is_device_copyable_v<
oneapi::dpl::__internal::__create_mask_unique_copy<noop_device_copyable,
int_non_device_copyable>>,
"__create_mask_unique_copy is incorrectly not device copyable because of non member field template arg");
//tuple
static_assert(sycl::is_device_copyable_v<oneapi::dpl::__internal::tuple<int_device_copyable, int_device_copyable>>,
"tuple is not device copyable with device copyable types");
Expand Down

0 comments on commit a3ea7ca

Please sign in to comment.