diff --git a/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison.pass.cpp b/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison.pass.cpp index 152f159061..03913f6194 100644 --- a/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison.pass.cpp @@ -18,7 +18,7 @@ template -class resource : public cuda::memory_resource { +class resource : public cuda::stream_ordered_memory_resource { public: int value = 0; private: @@ -26,11 +26,18 @@ class resource : public cuda::memory_resource { return nullptr; } + void *do_allocate_async(size_t, size_t, cuda::stream_view) override { + return nullptr; + } + void do_deallocate(void *, size_t, size_t) { } + void do_deallocate_async(void *, size_t, size_t, cuda::stream_view) override { + } + #ifdef _LIBCUDACXX_EXT_RTTI_ENABLED - bool do_is_equal(const cuda::memory_resource &other) const noexcept override { + bool do_is_equal(const cuda::memory_resource &other) const noexcept override { fprintf(stderr, "Comparison start: %p %p\n", this, &other); if (auto *other_ptr = dynamic_cast(&other)) { fprintf(stderr, "values: %d %d\n", value, other_ptr->value); @@ -51,7 +58,7 @@ int main(int argc, char **argv) { #if !defined(__CUDA_ARCH__) && defined(_LIBCUDACXX_EXT_RTTI_ENABLED) resource r1, r2, r3; resource r4; - cuda::basic_resource_view*, cuda::is_kind> v1_null; + cuda::basic_resource_view*, cuda::is_kind> v1_null; cuda::resource_view v2_null; assert(v1_null == v2_null); r1.value = 42; @@ -65,8 +72,8 @@ int main(int argc, char **argv) { assert(view_resource(&r1) != view_resource(&r3)); assert(view_resource(&r4) == view_resource(&r4)); cuda::resource_view v1 = &r1; - cuda::resource_view v2 = &r2; - cuda::resource_view v3 = &r3; + cuda::stream_ordered_resource_view v2 = &r2; + cuda::resource_view v3 = &r3; cuda::resource_view v4 = &r4; // compare views assert(v1 == v2); diff --git a/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison_incompatible.fail.cpp b/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison_incompatible.fail.cpp deleted file mode 100644 index d027d3d38a..0000000000 --- a/.upstream-tests/test/cuda/memory_resource/resource_view/resource_view_comparison_incompatible.fail.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of libcu++, the C++ Standard Library for your entire system, -// under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - - -#include -#include -#include -#include -#include -#include -#include - - -class resource : public cuda::memory_resource { -public: - int value = 0; -private: - void *do_allocate(size_t, size_t) override { - return nullptr; - } - - void do_deallocate(void *, size_t, size_t) { - } - - -#endif -}; - -int main(int argc, char **argv) { - resource::basic_resource_view, cuda::is_kind> v1_null; - resource_view v2_null; - v1_null == v2_null; - return 0; -} diff --git a/include/cuda/memory_resource b/include/cuda/memory_resource index 00acdde51d..3774057a5e 100644 --- a/include/cuda/memory_resource +++ b/include/cuda/memory_resource @@ -837,8 +837,6 @@ public: bool operator==(const cuda::basic_resource_view<_Ptr2, _Props2...> &__v2) const noexcept { using __view1_t = basic_resource_view; using __view2_t = basic_resource_view<_Ptr2, _Props2...>; - static_assert(cuda::is_view_convertible<__view1_t, __view2_t>::value || cuda::is_view_convertible<__view2_t, __view1_t>::value, - "The resource views are not compatible"); if (__pointer == nullptr || __v2.__pointer == nullptr) return __pointer == nullptr && __v2.__pointer == nullptr; return static_cast(__pointer)->is_equal(*__v2.__pointer);