Skip to content

Commit 90e3973

Browse files
committed
add a regression test for #8037
1 parent 0ead6ad commit 90e3973

File tree

1 file changed

+19
-0
lines changed
  • libcudacxx/test/libcudacxx/cuda/memory_resource/any_resource

1 file changed

+19
-0
lines changed

libcudacxx/test/libcudacxx/cuda/memory_resource/any_resource/any_resource.cu

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,23 @@ TEMPLATE_TEST_CASE_METHOD(test_fixture, "Empty property set", "[container][resou
329329
mr.deallocate_sync(this, this->bytes(0), this->align(0));
330330
}
331331
}
332+
333+
struct my_resource_wrapper
334+
{
335+
explicit my_resource_wrapper(cuda::mr::resource_ref<cuda::mr::device_accessible>);
336+
337+
void* allocate(cuda::stream_ref, ::cuda::std::size_t, ::cuda::std::size_t);
338+
void deallocate(cuda::stream_ref, void*, ::cuda::std::size_t, ::cuda::std::size_t) noexcept;
339+
void* allocate_sync(::cuda::std::size_t, ::cuda::std::size_t);
340+
void deallocate_sync(void*, ::cuda::std::size_t, ::cuda::std::size_t) noexcept;
341+
bool operator==(my_resource_wrapper const&) const;
342+
bool operator!=(my_resource_wrapper const&) const;
343+
friend void get_property(my_resource_wrapper const&, cuda::mr::device_accessible) noexcept {}
344+
};
345+
346+
// See https://github.com/NVIDIA/cccl/issues/8037
347+
TEST_CASE("regression test for NVIDIA/cccl#8037", "[container][resource]")
348+
{
349+
STATIC_REQUIRE(cuda::std::move_constructible<my_resource_wrapper>);
350+
}
332351
#endif // __CUDA_ARCH__

0 commit comments

Comments
 (0)