Skip to content

Commit

Permalink
Try and get rapids green (#3503)
Browse files Browse the repository at this point in the history
* Drop unneeded mdspan macros

* Guard `cub/detail/launcher/cuda_runtime.cuh` by a cuda compliler

* Fix formatting issue

* Fix bug in contiguous storage
  • Loading branch information
miscco committed Jan 31, 2025
1 parent 00438ad commit fa714f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
4 changes: 3 additions & 1 deletion cub/cub/util_device.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,6 @@ private:

CUB_NAMESPACE_END

#include <cub/detail/launcher/cuda_runtime.cuh> // to complete the definition of TripleChevronFactory
#if _CCCL_HAS_CUDA_COMPILER
# include <cub/detail/launcher/cuda_runtime.cuh> // to complete the definition of TripleChevronFactory
#endif // _CCCL_HAS_CUDA_COMPILER
26 changes: 0 additions & 26 deletions libcudacxx/include/cuda/std/__mdspan/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fa714f8

Please sign in to comment.