From fa714f816eb439ec2ab9706560471bc7e387e996 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 31 Jan 2025 07:43:26 +0100 Subject: [PATCH] Try and get rapids green (#3503) * Drop unneeded mdspan macros * Guard `cub/detail/launcher/cuda_runtime.cuh` by a cuda compliler * Fix formatting issue * Fix bug in contiguous storage --- cub/cub/util_device.cuh | 4 ++- libcudacxx/include/cuda/std/__mdspan/config.h | 26 ------------------- .../mdspan.mdspan.cons/ctad_c_array.pass.cpp | 4 +-- .../ctad_const_c_array.pass.cpp | 2 +- 4 files changed, 6 insertions(+), 30 deletions(-) diff --git a/cub/cub/util_device.cuh b/cub/cub/util_device.cuh index 0ff0f76df9f..ca18aa24fb0 100644 --- a/cub/cub/util_device.cuh +++ b/cub/cub/util_device.cuh @@ -787,4 +787,6 @@ private: CUB_NAMESPACE_END -#include // to complete the definition of TripleChevronFactory +#if _CCCL_HAS_CUDA_COMPILER +# include // to complete the definition of TripleChevronFactory +#endif // _CCCL_HAS_CUDA_COMPILER diff --git a/libcudacxx/include/cuda/std/__mdspan/config.h b/libcudacxx/include/cuda/std/__mdspan/config.h index 9f1c9898dd2..4cbeffc18c2 100644 --- a/libcudacxx/include/cuda/std/__mdspan/config.h +++ b/libcudacxx/include/cuda/std/__mdspan/config.h @@ -245,32 +245,6 @@ static_assert(__MDSPAN_CPLUSPLUS >= __MDSPAN_CXX_STD_14, "mdspan requires C++14 # endif # endif -# if __MDSPAN_USE_BRACKET_OPERATOR -# define __MDSPAN_OP(mds, ...) mds[__VA_ARGS__] -// Corentins demo compiler for subscript chokes on empty [] call, -// though I believe the proposal supports it? -# ifdef __MDSPAN_NO_EMPTY_BRACKET_OPERATOR -# define __MDSPAN_OP0(mds) mds.accessor().access(mds.data_handle(), 0) -# else -# define __MDSPAN_OP0(mds) mds[] -# endif -# define __MDSPAN_OP1(mds, a) mds[a] -# define __MDSPAN_OP2(mds, a, b) mds[a, b] -# define __MDSPAN_OP3(mds, a, b, c) mds[a, b, c] -# define __MDSPAN_OP4(mds, a, b, c, d) mds[a, b, c, d] -# define __MDSPAN_OP5(mds, a, b, c, d, e) mds[a, b, c, d, e] -# define __MDSPAN_OP6(mds, a, b, c, d, e, f) mds[a, b, c, d, e, f] -# else -# define __MDSPAN_OP(mds, ...) mds(__VA_ARGS__) -# define __MDSPAN_OP0(mds) mds() -# define __MDSPAN_OP1(mds, a) mds(a) -# define __MDSPAN_OP2(mds, a, b) mds(a, b) -# define __MDSPAN_OP3(mds, a, b, c) mds(a, b, c) -# define __MDSPAN_OP4(mds, a, b, c, d) mds(a, b, c, d) -# define __MDSPAN_OP5(mds, a, b, c, d, e) mds(a, b, c, d, e) -# define __MDSPAN_OP6(mds, a, b, c, d, e, f) mds(a, b, c, d, e, f) -# endif - #endif // _CCCL_STD_VER > 2011 #endif // _LIBCUDACXX___MDSPAN_CONFIG_HPP diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_c_array.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_c_array.pass.cpp index 930a772b596..9288d444402 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_c_array.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_c_array.pass.cpp @@ -32,7 +32,7 @@ int main(int, char**) assert(m.rank_dynamic() == 0); assert(m.static_extent(0) == 5); assert(m.extent(0) == 5); - assert(__MDSPAN_OP(m, 2) == 3); + assert(m[2] == 3); cuda::std::mdspan m2(data, 3); @@ -43,7 +43,7 @@ int main(int, char**) assert(m2.rank() == 1); assert(m2.rank_dynamic() == 1); assert(m2.extent(0) == 3); - assert(__MDSPAN_OP(m2, 2) == 3); + assert(m2[2] == 3); } #endif diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_const_c_array.pass.cpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_const_c_array.pass.cpp index 7957a3cdd39..04656311604 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_const_c_array.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/mdspan.mdspan.cons/ctad_const_c_array.pass.cpp @@ -32,7 +32,7 @@ int main(int, char**) assert(m.rank_dynamic() == 0); assert(m.static_extent(0) == 5); assert(m.extent(0) == 5); - assert(__MDSPAN_OP(m, 2) == 3); + assert(m[2] == 3); } #endif