Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions libcudacxx/include/cuda/__utility/__basic_any/semiregular.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ _CCCL_BEGIN_NAMESPACE_CUDA

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp>
_CCCL_PUBLIC_API auto __move_fn(_Tp& __src, void* __dst) noexcept
-> ::cuda::std::enable_if_t<::cuda::std::movable<_Tp>, void>
_CCCL_PUBLIC_API auto __move_fn(_Tp& __src, void* __dst) noexcept -> void
{
static_assert(::cuda::std::movable<_Tp>, "type must be movable");
::new (__dst) _Tp(static_cast<_Tp&&>(__src));
}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp>
[[nodiscard]] _CCCL_PUBLIC_API auto __try_move_fn(_Tp& __src, void* __dst, size_t __size, size_t __align)
-> ::cuda::std::enable_if_t<::cuda::std::movable<_Tp>, bool>
[[nodiscard]] _CCCL_PUBLIC_API auto __try_move_fn(_Tp& __src, void* __dst, size_t __size, size_t __align) -> bool
{
static_assert(::cuda::std::movable<_Tp>, "type must be movable");
if (::cuda::__is_small<_Tp>(__size, __align))
{
::new (__dst) _Tp(static_cast<_Tp&&>(__src));
Expand All @@ -81,9 +81,9 @@ template <class _Tp>

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp>
[[nodiscard]] _CCCL_PUBLIC_API auto __copy_fn(_Tp const& __src, void* __dst, size_t __size, size_t __align)
-> ::cuda::std::enable_if_t<::cuda::std::copyable<_Tp>, bool>
[[nodiscard]] _CCCL_PUBLIC_API auto __copy_fn(_Tp const& __src, void* __dst, size_t __size, size_t __align) -> bool
{
static_assert(::cuda::std::copyable<_Tp>, "type must be copyable");
if (::cuda::__is_small<_Tp>(__size, __align))
{
::new (__dst) _Tp(__src);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,23 @@ TEMPLATE_TEST_CASE_METHOD(test_fixture, "Empty property set", "[container][resou
mr.deallocate_sync(this, this->bytes(0), this->align(0));
}
}

struct my_resource_wrapper
{
explicit my_resource_wrapper(cuda::mr::resource_ref<cuda::mr::device_accessible>);

void* allocate(cuda::stream_ref, ::cuda::std::size_t, ::cuda::std::size_t);
void deallocate(cuda::stream_ref, void*, ::cuda::std::size_t, ::cuda::std::size_t) noexcept;
void* allocate_sync(::cuda::std::size_t, ::cuda::std::size_t);
void deallocate_sync(void*, ::cuda::std::size_t, ::cuda::std::size_t) noexcept;
bool operator==(my_resource_wrapper const&) const;
bool operator!=(my_resource_wrapper const&) const;
friend void get_property(my_resource_wrapper const&, cuda::mr::device_accessible) noexcept {}
};

// See https://github.com/NVIDIA/cccl/issues/8037
TEST_CASE("regression test for NVIDIA/cccl#8037", "[container][resource]")
{
STATIC_REQUIRE(cuda::std::move_constructible<my_resource_wrapper>);
}
#endif // __CUDA_ARCH__
Loading