diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.construction.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.construction.pass.cpp index 672a4fae96..12b8e969de 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.construction.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.construction.pass.cpp @@ -50,15 +50,12 @@ struct async_resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const async_resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const async_resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const async_resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const async_resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.conversion.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.conversion.pass.cpp index 15a04c2b71..e3e8bd8a2a 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.conversion.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.conversion.pass.cpp @@ -55,15 +55,12 @@ struct resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.fail.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.fail.cpp index 1116a13e11..4db52db56b 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.fail.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.fail.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // cuda::mr::async_resource_ref equality diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.pass.cpp index a4feced151..0d194714ea 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.equality.pass.cpp @@ -52,15 +52,12 @@ struct async_resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const async_resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const async_resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const async_resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const async_resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.inheritance.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.inheritance.pass.cpp index 2f6f3bf883..bf1ede4495 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.inheritance.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.inheritance.pass.cpp @@ -41,15 +41,12 @@ struct async_resource_base { bool operator!=(const async_resource_base& other) const { return false; } _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const async_resource_base&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const async_resource_base&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const async_resource_base& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const async_resource_base& res, Property) noexcept { return 42; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.properties.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.properties.pass.cpp index 73ba361686..9392d84152 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.properties.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.async_resource_ref/async_resource_ref.properties.pass.cpp @@ -59,15 +59,12 @@ struct async_resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const async_resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const async_resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const async_resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const async_resource& res, Property) noexcept { return res._val; } }; @@ -89,25 +86,25 @@ static_assert( (2 * sizeof(void*))); _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires !cuda::property_with_value) // + (requires (!cuda::property_with_value)) // int InvokeIfWithValue(const Ref& ref) { return -1; } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires cuda::property_with_value) // + (requires cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires cuda::property_with_value) // + (requires cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires !cuda::property_with_value) // + (requires (!cuda::property_with_value)) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); return 1; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.construction.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.construction.pass.cpp index 1374700a84..e838a3a286 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.construction.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.construction.pass.cpp @@ -40,15 +40,12 @@ struct resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.conversion.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.conversion.pass.cpp index d93430935b..15f7331c74 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.conversion.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.conversion.pass.cpp @@ -55,15 +55,12 @@ struct resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.fail.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.fail.cpp index 8c43807797..0efff529d3 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.fail.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.fail.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // cuda::mr::resource_ref equality diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.pass.cpp index d4b8f4b3ea..40ce8ef9ca 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.equality.pass.cpp @@ -41,15 +41,12 @@ struct resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource& res, Property) noexcept { return res._val; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.inheritance.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.inheritance.pass.cpp index 6add9c7ad9..0754b52be8 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.inheritance.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.inheritance.pass.cpp @@ -36,15 +36,12 @@ struct resource_base { bool operator!=(const resource_base& other) const { return false; } _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource_base&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource_base&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource_base& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource_base& res, Property) noexcept { return 42; } }; diff --git a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.properties.pass.cpp b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.properties.pass.cpp index b2641f5b44..0338c7b76f 100644 --- a/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.properties.pass.cpp +++ b/.upstream-tests/test/cuda/memory_resource/memory_resource.resource_ref/resource_ref.properties.pass.cpp @@ -50,15 +50,12 @@ struct resource { int _val = 0; _LIBCUDACXX_TEMPLATE(class Property) - (requires !cuda::property_with_value && - _CUDA_VSTD::_One_of) // - friend void get_property(const resource&, Property) noexcept {} + (requires (!cuda::property_with_value) && _CUDA_VSTD::_One_of) // + friend void get_property(const resource&, Property) noexcept {} _LIBCUDACXX_TEMPLATE(class Property) - (requires cuda::property_with_value&& - _CUDA_VSTD::_One_of) // - friend typename Property::value_type - get_property(const resource& res, Property) noexcept { + (requires cuda::property_with_value && _CUDA_VSTD::_One_of) // + friend typename Property::value_type get_property(const resource& res, Property) noexcept { return res._val; } }; @@ -78,25 +75,25 @@ static_assert(sizeof(cuda::mr::resource_ref, (2 * sizeof(void*))); _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires !cuda::property_with_value) // + (requires (!cuda::property_with_value)) // int InvokeIfWithValue(const Ref& ref) { return -1; } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires cuda::property_with_value) // + (requires cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires cuda::property_with_value) // + (requires cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } _LIBCUDACXX_TEMPLATE(class Property, class Ref) -(requires !cuda::property_with_value) // + (requires (!cuda::property_with_value)) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); return 1; diff --git a/include/cuda/memory_resource b/include/cuda/memory_resource index 181770d0d3..b8f555ddcd 100644 --- a/include/cuda/memory_resource +++ b/include/cuda/memory_resource @@ -588,11 +588,11 @@ public: } _LIBCUDACXX_TEMPLATE(class _Property) - (requires !property_with_value<_Property> && _CUDA_VSTD::_One_of<_Property, _Properties...>) // + (requires (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::_One_of<_Property, _Properties...>) // friend void get_property(const basic_resource_ref &, _Property) noexcept {} _LIBCUDACXX_TEMPLATE(class _Property) - (requires property_with_value<_Property> &&_CUDA_VSTD::_One_of<_Property, _Properties...>) // + (requires property_with_value<_Property> _LIBCUDACXX_AND _CUDA_VSTD::_One_of<_Property, _Properties...>) // friend __property_value_t<_Property> get_property( const basic_resource_ref &__res, _Property) noexcept { return __res._Property_vtable<_Property>::__property_fn(__res.__object);