cuda-cccl 0.3.1__cp310-cp310-manylinux_2_24_aarch64.whl → 0.3.2__cp310-cp310-manylinux_2_24_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cuda-cccl might be problematic. Click here for more details.

Files changed (185) hide show
  1. cuda/cccl/headers/include/cub/agent/agent_histogram.cuh +354 -572
  2. cuda/cccl/headers/include/cub/block/block_adjacent_difference.cuh +6 -8
  3. cuda/cccl/headers/include/cub/block/block_discontinuity.cuh +24 -14
  4. cuda/cccl/headers/include/cub/block/block_exchange.cuh +5 -0
  5. cuda/cccl/headers/include/cub/block/block_histogram.cuh +4 -0
  6. cuda/cccl/headers/include/cub/block/block_load.cuh +4 -0
  7. cuda/cccl/headers/include/cub/block/block_radix_rank.cuh +1 -0
  8. cuda/cccl/headers/include/cub/block/block_reduce.cuh +1 -0
  9. cuda/cccl/headers/include/cub/block/block_scan.cuh +12 -2
  10. cuda/cccl/headers/include/cub/block/block_store.cuh +3 -2
  11. cuda/cccl/headers/include/cub/detail/mdspan_utils.cuh +34 -30
  12. cuda/cccl/headers/include/cub/detail/ptx-json-parser.h +1 -1
  13. cuda/cccl/headers/include/cub/device/device_for.cuh +118 -40
  14. cuda/cccl/headers/include/cub/device/device_reduce.cuh +6 -7
  15. cuda/cccl/headers/include/cub/device/device_segmented_reduce.cuh +12 -13
  16. cuda/cccl/headers/include/cub/device/device_transform.cuh +122 -91
  17. cuda/cccl/headers/include/cub/device/dispatch/dispatch_merge.cuh +2 -3
  18. cuda/cccl/headers/include/cub/device/dispatch/dispatch_reduce.cuh +4 -3
  19. cuda/cccl/headers/include/cub/device/dispatch/dispatch_reduce_deterministic.cuh +1 -1
  20. cuda/cccl/headers/include/cub/device/dispatch/dispatch_streaming_reduce.cuh +4 -5
  21. cuda/cccl/headers/include/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh +0 -1
  22. cuda/cccl/headers/include/cub/device/dispatch/dispatch_topk.cuh +3 -5
  23. cuda/cccl/headers/include/cub/device/dispatch/dispatch_transform.cuh +13 -5
  24. cuda/cccl/headers/include/cub/device/dispatch/kernels/for_each.cuh +72 -37
  25. cuda/cccl/headers/include/cub/device/dispatch/kernels/transform.cuh +22 -27
  26. cuda/cccl/headers/include/cub/device/dispatch/tuning/tuning_transform.cuh +61 -70
  27. cuda/cccl/headers/include/cub/thread/thread_reduce.cuh +24 -17
  28. cuda/cccl/headers/include/cub/warp/warp_load.cuh +6 -6
  29. cuda/cccl/headers/include/cub/warp/warp_reduce.cuh +7 -2
  30. cuda/cccl/headers/include/cub/warp/warp_scan.cuh +7 -3
  31. cuda/cccl/headers/include/cub/warp/warp_store.cuh +1 -0
  32. cuda/cccl/headers/include/cuda/__barrier/barrier_block_scope.h +19 -0
  33. cuda/cccl/headers/include/cuda/__cccl_config +1 -0
  34. cuda/cccl/headers/include/cuda/__cmath/fast_modulo_division.h +3 -74
  35. cuda/cccl/headers/include/cuda/__cmath/mul_hi.h +146 -0
  36. cuda/cccl/headers/include/cuda/__complex/get_real_imag.h +0 -4
  37. cuda/cccl/headers/include/cuda/__device/arch_id.h +176 -0
  38. cuda/cccl/headers/include/cuda/__device/arch_traits.h +239 -317
  39. cuda/cccl/headers/include/cuda/__device/attributes.h +4 -3
  40. cuda/cccl/headers/include/cuda/__device/compute_capability.h +171 -0
  41. cuda/cccl/headers/include/cuda/__device/device_ref.h +0 -10
  42. cuda/cccl/headers/include/cuda/__device/physical_device.h +1 -26
  43. cuda/cccl/headers/include/cuda/__event/event.h +26 -26
  44. cuda/cccl/headers/include/cuda/__event/event_ref.h +5 -5
  45. cuda/cccl/headers/include/cuda/__event/timed_event.h +9 -7
  46. cuda/cccl/headers/include/cuda/__fwd/devices.h +4 -4
  47. cuda/cccl/headers/include/cuda/__iterator/constant_iterator.h +46 -31
  48. cuda/cccl/headers/include/cuda/__iterator/strided_iterator.h +79 -47
  49. cuda/cccl/headers/include/cuda/__iterator/tabulate_output_iterator.h +59 -36
  50. cuda/cccl/headers/include/cuda/__iterator/transform_input_output_iterator.h +79 -49
  51. cuda/cccl/headers/include/cuda/__iterator/transform_iterator.h +74 -48
  52. cuda/cccl/headers/include/cuda/__iterator/transform_output_iterator.h +80 -55
  53. cuda/cccl/headers/include/cuda/__iterator/zip_common.h +2 -12
  54. cuda/cccl/headers/include/cuda/__iterator/zip_iterator.h +15 -19
  55. cuda/cccl/headers/include/cuda/__iterator/zip_transform_iterator.h +59 -60
  56. cuda/cccl/headers/include/cuda/__mdspan/host_device_accessor.h +127 -60
  57. cuda/cccl/headers/include/cuda/__mdspan/host_device_mdspan.h +178 -3
  58. cuda/cccl/headers/include/cuda/__mdspan/restrict_accessor.h +38 -8
  59. cuda/cccl/headers/include/cuda/__mdspan/restrict_mdspan.h +67 -1
  60. cuda/cccl/headers/include/cuda/__memory/ptr_in_range.h +93 -0
  61. cuda/cccl/headers/include/cuda/__memory_resource/get_memory_resource.h +4 -4
  62. cuda/cccl/headers/include/cuda/__memory_resource/properties.h +44 -0
  63. cuda/cccl/headers/include/cuda/__memory_resource/resource.h +1 -1
  64. cuda/cccl/headers/include/cuda/__memory_resource/resource_ref.h +4 -6
  65. cuda/cccl/headers/include/cuda/__nvtx/nvtx3.h +2 -1
  66. cuda/cccl/headers/include/cuda/__runtime/ensure_current_context.h +5 -4
  67. cuda/cccl/headers/include/cuda/__stream/stream.h +8 -8
  68. cuda/cccl/headers/include/cuda/__stream/stream_ref.h +17 -16
  69. cuda/cccl/headers/include/cuda/__utility/in_range.h +65 -0
  70. cuda/cccl/headers/include/cuda/cmath +1 -0
  71. cuda/cccl/headers/include/cuda/devices +3 -0
  72. cuda/cccl/headers/include/cuda/memory +1 -0
  73. cuda/cccl/headers/include/cuda/std/__algorithm/equal_range.h +2 -2
  74. cuda/cccl/headers/include/cuda/std/__algorithm/find.h +1 -1
  75. cuda/cccl/headers/include/cuda/std/__algorithm/includes.h +2 -4
  76. cuda/cccl/headers/include/cuda/std/__algorithm/lower_bound.h +1 -1
  77. cuda/cccl/headers/include/cuda/std/__algorithm/make_projected.h +7 -15
  78. cuda/cccl/headers/include/cuda/std/__algorithm/min_element.h +1 -1
  79. cuda/cccl/headers/include/cuda/std/__algorithm/minmax_element.h +1 -2
  80. cuda/cccl/headers/include/cuda/std/__algorithm/partial_sort_copy.h +2 -2
  81. cuda/cccl/headers/include/cuda/std/__algorithm/upper_bound.h +1 -1
  82. cuda/cccl/headers/include/cuda/std/__cccl/algorithm_wrapper.h +36 -0
  83. cuda/cccl/headers/include/cuda/std/__cccl/builtin.h +46 -49
  84. cuda/cccl/headers/include/cuda/std/__cccl/execution_space.h +6 -0
  85. cuda/cccl/headers/include/cuda/std/__cccl/host_std_lib.h +52 -0
  86. cuda/cccl/headers/include/cuda/std/__cccl/memory_wrapper.h +36 -0
  87. cuda/cccl/headers/include/cuda/std/__cccl/numeric_wrapper.h +36 -0
  88. cuda/cccl/headers/include/cuda/std/__cmath/isnan.h +3 -2
  89. cuda/cccl/headers/include/cuda/std/__complex/complex.h +3 -2
  90. cuda/cccl/headers/include/cuda/std/__complex/literals.h +14 -34
  91. cuda/cccl/headers/include/cuda/std/__complex/nvbf16.h +2 -1
  92. cuda/cccl/headers/include/cuda/std/__complex/nvfp16.h +4 -3
  93. cuda/cccl/headers/include/cuda/std/__concepts/invocable.h +2 -2
  94. cuda/cccl/headers/include/cuda/std/__cstdlib/malloc.h +3 -2
  95. cuda/cccl/headers/include/cuda/std/__functional/bind.h +10 -13
  96. cuda/cccl/headers/include/cuda/std/__functional/function.h +5 -8
  97. cuda/cccl/headers/include/cuda/std/__functional/invoke.h +71 -335
  98. cuda/cccl/headers/include/cuda/std/__functional/mem_fn.h +1 -2
  99. cuda/cccl/headers/include/cuda/std/__functional/reference_wrapper.h +3 -3
  100. cuda/cccl/headers/include/cuda/std/__functional/weak_result_type.h +0 -6
  101. cuda/cccl/headers/include/cuda/std/__fwd/allocator.h +13 -0
  102. cuda/cccl/headers/include/cuda/std/__fwd/char_traits.h +13 -0
  103. cuda/cccl/headers/include/cuda/std/__fwd/complex.h +13 -4
  104. cuda/cccl/headers/include/cuda/std/__fwd/mdspan.h +23 -0
  105. cuda/cccl/headers/include/cuda/std/__fwd/pair.h +13 -0
  106. cuda/cccl/headers/include/cuda/std/__fwd/string.h +22 -0
  107. cuda/cccl/headers/include/cuda/std/__fwd/string_view.h +14 -0
  108. cuda/cccl/headers/include/cuda/std/__internal/features.h +0 -5
  109. cuda/cccl/headers/include/cuda/std/__internal/namespaces.h +21 -0
  110. cuda/cccl/headers/include/cuda/std/__iterator/iterator_traits.h +5 -5
  111. cuda/cccl/headers/include/cuda/std/__mdspan/extents.h +7 -1
  112. cuda/cccl/headers/include/cuda/std/__mdspan/mdspan.h +53 -39
  113. cuda/cccl/headers/include/cuda/std/__memory/allocator.h +3 -3
  114. cuda/cccl/headers/include/cuda/std/__memory/construct_at.h +1 -3
  115. cuda/cccl/headers/include/cuda/std/__optional/optional_base.h +1 -0
  116. cuda/cccl/headers/include/cuda/std/__ranges/compressed_movable_box.h +892 -0
  117. cuda/cccl/headers/include/cuda/std/__ranges/movable_box.h +2 -2
  118. cuda/cccl/headers/include/cuda/std/__type_traits/is_primary_template.h +7 -5
  119. cuda/cccl/headers/include/cuda/std/__type_traits/result_of.h +1 -1
  120. cuda/cccl/headers/include/cuda/std/__utility/pair.h +0 -5
  121. cuda/cccl/headers/include/cuda/std/bitset +1 -1
  122. cuda/cccl/headers/include/cuda/std/detail/libcxx/include/__config +15 -12
  123. cuda/cccl/headers/include/cuda/std/detail/libcxx/include/variant +11 -9
  124. cuda/cccl/headers/include/cuda/std/inplace_vector +4 -4
  125. cuda/cccl/headers/include/cuda/std/numbers +5 -0
  126. cuda/cccl/headers/include/cuda/std/string_view +146 -11
  127. cuda/cccl/headers/include/cuda/stream_ref +5 -0
  128. cuda/cccl/headers/include/cuda/utility +1 -0
  129. cuda/cccl/headers/include/nv/target +7 -2
  130. cuda/cccl/headers/include/thrust/allocate_unique.h +1 -1
  131. cuda/cccl/headers/include/thrust/detail/allocator/allocator_traits.h +309 -33
  132. cuda/cccl/headers/include/thrust/detail/allocator/copy_construct_range.h +151 -4
  133. cuda/cccl/headers/include/thrust/detail/allocator/destroy_range.h +60 -3
  134. cuda/cccl/headers/include/thrust/detail/allocator/fill_construct_range.h +45 -3
  135. cuda/cccl/headers/include/thrust/detail/allocator/malloc_allocator.h +31 -6
  136. cuda/cccl/headers/include/thrust/detail/allocator/tagged_allocator.h +29 -16
  137. cuda/cccl/headers/include/thrust/detail/allocator/temporary_allocator.h +41 -4
  138. cuda/cccl/headers/include/thrust/detail/allocator/value_initialize_range.h +42 -4
  139. cuda/cccl/headers/include/thrust/detail/complex/ccosh.h +3 -3
  140. cuda/cccl/headers/include/thrust/detail/internal_functional.h +1 -1
  141. cuda/cccl/headers/include/thrust/detail/memory_algorithms.h +1 -1
  142. cuda/cccl/headers/include/thrust/detail/temporary_array.h +1 -1
  143. cuda/cccl/headers/include/thrust/detail/type_traits.h +1 -1
  144. cuda/cccl/headers/include/thrust/device_delete.h +18 -3
  145. cuda/cccl/headers/include/thrust/device_free.h +16 -3
  146. cuda/cccl/headers/include/thrust/device_new.h +29 -8
  147. cuda/cccl/headers/include/thrust/host_vector.h +1 -1
  148. cuda/cccl/headers/include/thrust/iterator/tabulate_output_iterator.h +5 -2
  149. cuda/cccl/headers/include/thrust/mr/disjoint_pool.h +1 -1
  150. cuda/cccl/headers/include/thrust/mr/pool.h +1 -1
  151. cuda/cccl/headers/include/thrust/system/cuda/detail/find.h +13 -115
  152. cuda/cccl/headers/include/thrust/system/cuda/detail/mismatch.h +8 -2
  153. cuda/cccl/headers/include/thrust/type_traits/is_contiguous_iterator.h +7 -7
  154. cuda/compute/__init__.py +2 -0
  155. cuda/compute/_bindings.pyi +43 -1
  156. cuda/compute/_bindings_impl.pyx +156 -7
  157. cuda/compute/algorithms/_scan.py +108 -36
  158. cuda/compute/algorithms/_transform.py +32 -11
  159. cuda/compute/cu12/_bindings_impl.cpython-310-aarch64-linux-gnu.so +0 -0
  160. cuda/compute/cu12/cccl/libcccl.c.parallel.so +0 -0
  161. cuda/compute/cu13/_bindings_impl.cpython-310-aarch64-linux-gnu.so +0 -0
  162. cuda/compute/cu13/cccl/libcccl.c.parallel.so +0 -0
  163. cuda/compute/iterators/__init__.py +2 -0
  164. cuda/compute/iterators/_factories.py +28 -0
  165. cuda/compute/iterators/_iterators.py +206 -1
  166. cuda/compute/numba_utils.py +2 -2
  167. cuda/compute/typing.py +2 -0
  168. {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/METADATA +1 -1
  169. {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/RECORD +171 -175
  170. cuda/cccl/headers/include/thrust/detail/algorithm_wrapper.h +0 -37
  171. cuda/cccl/headers/include/thrust/detail/allocator/allocator_traits.inl +0 -371
  172. cuda/cccl/headers/include/thrust/detail/allocator/copy_construct_range.inl +0 -242
  173. cuda/cccl/headers/include/thrust/detail/allocator/destroy_range.inl +0 -137
  174. cuda/cccl/headers/include/thrust/detail/allocator/fill_construct_range.inl +0 -99
  175. cuda/cccl/headers/include/thrust/detail/allocator/malloc_allocator.inl +0 -68
  176. cuda/cccl/headers/include/thrust/detail/allocator/tagged_allocator.inl +0 -86
  177. cuda/cccl/headers/include/thrust/detail/allocator/temporary_allocator.inl +0 -79
  178. cuda/cccl/headers/include/thrust/detail/allocator/value_initialize_range.inl +0 -98
  179. cuda/cccl/headers/include/thrust/detail/device_delete.inl +0 -52
  180. cuda/cccl/headers/include/thrust/detail/device_free.inl +0 -47
  181. cuda/cccl/headers/include/thrust/detail/device_new.inl +0 -61
  182. cuda/cccl/headers/include/thrust/detail/memory_wrapper.h +0 -40
  183. cuda/cccl/headers/include/thrust/detail/numeric_wrapper.h +0 -37
  184. {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/WHEEL +0 -0
  185. {cuda_cccl-0.3.1.dist-info → cuda_cccl-0.3.2.dist-info}/licenses/LICENSE +0 -0
@@ -23,6 +23,19 @@
23
23
 
24
24
  #include <cuda/std/__cccl/prologue.h>
25
25
 
26
+ // std:: forward declarations
27
+
28
+ #if _CCCL_HAS_HOST_STD_LIB()
29
+ _CCCL_BEGIN_NAMESPACE_STD
30
+
31
+ template <class _Tp>
32
+ class allocator;
33
+
34
+ _CCCL_END_NAMESPACE_STD
35
+ #endif // _CCCL_HAS_HOST_STD_LIB()
36
+
37
+ // cuda::std:: forward declarations
38
+
26
39
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
27
40
 
28
41
  template <class _Tp>
@@ -23,6 +23,19 @@
23
23
 
24
24
  #include <cuda/std/__cccl/prologue.h>
25
25
 
26
+ // std:: forward declarations
27
+
28
+ #if _CCCL_HAS_HOST_STD_LIB()
29
+ _CCCL_BEGIN_NAMESPACE_STD
30
+
31
+ template <class _CharT>
32
+ struct char_traits;
33
+
34
+ _CCCL_END_NAMESPACE_STD
35
+ #endif // _CCCL_HAS_HOST_STD_LIB()
36
+
37
+ // cuda::std:: forward declarations
38
+
26
39
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
27
40
 
28
41
  template <class _CharT>
@@ -20,12 +20,21 @@
20
20
  # pragma system_header
21
21
  #endif // no system header
22
22
 
23
- #if !_CCCL_COMPILER(NVRTC)
24
- # include <complex>
25
- #endif // !_CCCL_COMPILER(NVRTC)
26
-
27
23
  #include <cuda/std/__cccl/prologue.h>
28
24
 
25
+ // std:: forward declarations
26
+
27
+ #if _CCCL_HAS_HOST_STD_LIB()
28
+ _CCCL_BEGIN_NAMESPACE_STD
29
+
30
+ template <class>
31
+ class complex;
32
+
33
+ _CCCL_END_NAMESPACE_STD
34
+ #endif // _CCCL_HAS_HOST_STD_LIB()
35
+
36
+ // cuda::std:: forward declarations
37
+
29
38
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
30
39
 
31
40
  template <class _Tp>
@@ -83,6 +83,29 @@ inline constexpr bool __is_std_mdspan_v = false;
83
83
  template <class _ElementType, class _Extents, class _LayoutPolicy, class _AccessorPolicy>
84
84
  inline constexpr bool __is_std_mdspan_v<mdspan<_ElementType, _Extents, _LayoutPolicy, _AccessorPolicy>> = true;
85
85
 
86
+ template <typename _Layout>
87
+ inline constexpr bool __is_any_mdspan_layout_mapping_left_v = false;
88
+
89
+ template <typename _Extents>
90
+ inline constexpr bool __is_any_mdspan_layout_mapping_left_v<layout_left::mapping<_Extents>> = true;
91
+
92
+ template <typename _Layout>
93
+ inline constexpr bool __is_any_mdspan_layout_mapping_right_v = false;
94
+
95
+ template <typename _Extents>
96
+ inline constexpr bool __is_any_mdspan_layout_mapping_right_v<layout_right::mapping<_Extents>> = true;
97
+
98
+ template <typename _Layout>
99
+ inline constexpr bool __is_any_mdspan_layout_mapping_left_or_right_v =
100
+ __is_any_mdspan_layout_mapping_left_v<_Layout> || __is_any_mdspan_layout_mapping_right_v<_Layout>;
101
+
102
+ // TODO (fbusato): Add support for layout_right_padded and layout_left_padded
103
+ // template<>
104
+ // inline constexpr bool __is_any_mdspan_layout_mapping_right_v<layout_right_padded> = true;
105
+
106
+ // template<>
107
+ // inline constexpr bool __is_any_mdspan_layout_mapping_right_v<layout_left_padded> = true;
108
+
86
109
  _CCCL_END_NAMESPACE_CUDA_STD
87
110
 
88
111
  #include <cuda/std/__cccl/epilogue.h>
@@ -22,6 +22,19 @@
22
22
 
23
23
  #include <cuda/std/__cccl/prologue.h>
24
24
 
25
+ // std:: forward declarations
26
+
27
+ #if _CCCL_HAS_HOST_STD_LIB()
28
+ _CCCL_BEGIN_NAMESPACE_STD
29
+
30
+ template <class, class>
31
+ struct pair;
32
+
33
+ _CCCL_END_NAMESPACE_STD
34
+ #endif // _CCCL_HAS_HOST_STD_LIB()
35
+
36
+ // cuda::std:: forward declarations
37
+
25
38
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
26
39
 
27
40
  template <class, class>
@@ -26,6 +26,28 @@
26
26
 
27
27
  #include <cuda/std/__cccl/prologue.h>
28
28
 
29
+ // std:: forward declarations
30
+
31
+ #if _CCCL_HAS_HOST_STD_LIB()
32
+ _CCCL_BEGIN_NAMESPACE_STD
33
+
34
+ // libstdc++ puts basic_string to inline cxx11 namespace
35
+ # if _GLIBCXX_USE_CXX11_ABI
36
+ inline _GLIBCXX_BEGIN_NAMESPACE_CXX11
37
+ # endif // _GLIBCXX_USE_CXX11_ABI
38
+
39
+ template <class _CharT, class _Traits, class _Alloc>
40
+ class basic_string;
41
+
42
+ # if _GLIBCXX_USE_CXX11_ABI
43
+ _GLIBCXX_END_NAMESPACE_CXX11
44
+ # endif // _GLIBCXX_USE_CXX11_ABI
45
+
46
+ _CCCL_END_NAMESPACE_STD
47
+ #endif // _CCCL_HAS_HOST_STD_LIB()
48
+
49
+ // cuda::std:: forward declarations
50
+
29
51
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
30
52
 
31
53
  #if 0 // we don't support these features
@@ -24,6 +24,19 @@
24
24
 
25
25
  #include <cuda/std/__cccl/prologue.h>
26
26
 
27
+ // std:: forward declarations
28
+
29
+ #if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_string_view >= 201606L
30
+ _CCCL_BEGIN_NAMESPACE_STD
31
+
32
+ template <class _CharT, class _Traits>
33
+ class basic_string_view;
34
+
35
+ _CCCL_END_NAMESPACE_STD
36
+ #endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_string_view >= 201606L
37
+
38
+ // cuda::std:: forward declarations
39
+
27
40
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
28
41
 
29
42
  template <class _CharT, class _Traits = char_traits<_CharT>>
@@ -52,6 +65,7 @@ _CCCL_PREFERRED_NAME(wstring_view)
52
65
  #endif // _CCCL_HAS_WCHAR_T()
53
66
  basic_string_view;
54
67
  // clang-format on
68
+
55
69
  _CCCL_END_NAMESPACE_CUDA_STD
56
70
 
57
71
  #include <cuda/std/__cccl/epilogue.h>
@@ -69,9 +69,4 @@
69
69
  # define _LIBCUDACXX_HAS_NVBF16() 0
70
70
  #endif // _CCCL_HAS_NVBF16() && _CCCL_CTK_AT_LEAST(12, 2)
71
71
 
72
- // NVCC does not have a way of silencing non '_' prefixed UDLs
73
- #if !_CCCL_CUDA_COMPILER(NVCC) && !_CCCL_COMPILER(NVRTC)
74
- # define _LIBCUDACXX_HAS_STL_LITERALS
75
- #endif // !_CCCL_CUDA_COMPILER(NVCC) && !_CCCL_COMPILER(NVRTC)
76
-
77
72
  #endif // _CUDA_STD___INTERNAL_FEATURES_H
@@ -104,6 +104,27 @@
104
104
  # endif // not defined(_NVHPC_CUDA)
105
105
  #endif // not defined(CCCL_DISABLE_ARCH_DEPENDENT_NAMESPACE)
106
106
 
107
+ // Host standard library namespaces
108
+ #if _CCCL_HOST_STD_LIB(LIBSTDCXX)
109
+ // We don't appy attributes on forward declarations, so we omit the _GLIBCXX_VISIBILITY(default)
110
+ # if _GLIBCXX_INLINE_VERSION
111
+ # define _CCCL_BEGIN_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() namespace std { inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
112
+ # define _CCCL_END_NAMESPACE_STD _GLIBCXX_END_NAMESPACE_VERSION } _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK()
113
+ # else // ^^^ _GLIBCXX_INLINE_VERSION ^^^ / vvv !_GLIBCXX_INLINE_VERSION vvv
114
+ # define _CCCL_BEGIN_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() namespace std {
115
+ # define _CCCL_END_NAMESPACE_STD } _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK()
116
+ # endif // ^^^ !_GLIBCXX_INLINE_VERSION ^^^
117
+ #elif _CCCL_HOST_STD_LIB(LIBCXX)
118
+ # define _CCCL_BEGIN_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() _LIBCPP_BEGIN_NAMESPACE_STD
119
+ # define _CCCL_END_NAMESPACE_STD _LIBCPP_END_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK()
120
+ #elif _CCCL_HOST_STD_LIB(STL)
121
+ # define _CCCL_BEGIN_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() _STD_BEGIN
122
+ # define _CCCL_END_NAMESPACE_STD _STD_END _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK()
123
+ #else
124
+ # define _CCCL_BEGIN_NAMESPACE_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() namespace std {
125
+ # define _CCCL_END_NAMESPACE_STD } _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK()
126
+ #endif
127
+
107
128
  // Shorthands for different qualifiers
108
129
  # define _CUDA_VSTD_NOVERSION ::cuda::std
109
130
  # define _CUDA_VSTD ::cuda::std::_LIBCUDACXX_ABI_NAMESPACE
@@ -173,17 +173,17 @@ _CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_debug::_Safe_iterator<_Ty*, _Range>>::valu
173
173
  _CCCL_API inline auto __iter_concept_fn(::__gnu_debug::_Safe_iterator<_Ty*, _Range>, __priority_tag<3>)
174
174
  -> contiguous_iterator_tag;
175
175
  #endif // _GLIBCXX_DEBUG
176
- #if defined(__GLIBCXX__)
176
+ #if _CCCL_HOST_STD_LIB(LIBSTDCXX)
177
177
  _CCCL_TEMPLATE(class _Iter, class _Ty, class _Range)
178
178
  _CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_cxx::__normal_iterator<_Ty*, _Range>>::value)
179
179
  _CCCL_API inline auto __iter_concept_fn(::__gnu_cxx::__normal_iterator<_Ty*, _Range>, __priority_tag<3>)
180
180
  -> contiguous_iterator_tag;
181
- #endif // __GLIBCXX__
182
- #if defined(_LIBCPP_VERSION)
181
+ #endif // _CCCL_HOST_STD_LIB(LIBSTDCXX)
182
+ #if _CCCL_HOST_STD_LIB(LIBCXX)
183
183
  _CCCL_TEMPLATE(class _Iter, class _Ty)
184
184
  _CCCL_REQUIRES(_IsSame<_Iter, ::std::__wrap_iter<_Ty*>>::value)
185
185
  _CCCL_API inline auto __iter_concept_fn(::std::__wrap_iter<_Ty*>, __priority_tag<3>) -> contiguous_iterator_tag;
186
- #elif defined(_MSVC_STL_VERSION) || defined(_IS_WRS)
186
+ #elif _CCCL_HOST_STD_LIB(STL)
187
187
  _CCCL_TEMPLATE(class _Iter)
188
188
  _CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Array_iterator>::value)
189
189
  _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag;
@@ -208,7 +208,7 @@ _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_
208
208
  _CCCL_TEMPLATE(class _Iter)
209
209
  _CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Span_iterator>::value)
210
210
  _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag;
211
- #endif // _MSVC_STL_VERSION
211
+ #endif // _CCCL_HOST_STD_LIB(STL)
212
212
  _CCCL_TEMPLATE(class _Iter, class _Ty)
213
213
  _CCCL_REQUIRES(_IsSame<_Iter, _Ty*>::value)
214
214
  _CCCL_API inline auto __iter_concept_fn(_Ty*, __priority_tag<3>) -> contiguous_iterator_tag;
@@ -281,6 +281,9 @@ public:
281
281
  return _StaticValues::__get(__i);
282
282
  }
283
283
 
284
+ _CCCL_DIAG_PUSH
285
+ _CCCL_DIAG_SUPPRESS_MSVC(4702) // Unreachable code
286
+
284
287
  [[nodiscard]] _CCCL_API constexpr _TDynamic __value(size_t __i) const
285
288
  {
286
289
  if constexpr (__size_ > 0)
@@ -293,7 +296,10 @@ public:
293
296
  : static_cast<_TDynamic>(__static_val);
294
297
  }
295
298
 
296
- [[nodiscard]] _CCCL_API constexpr _TDynamic operator[](size_t __i) const
299
+ _CCCL_DIAG_POP // MSVC(4702) Unreachable code
300
+
301
+ [[nodiscard]] _CCCL_API constexpr _TDynamic
302
+ operator[](size_t __i) const
297
303
  {
298
304
  if constexpr (__size_ > 0)
299
305
  {
@@ -63,6 +63,44 @@
63
63
 
64
64
  _CCCL_BEGIN_NAMESPACE_CUDA_STD
65
65
 
66
+ template <class _Extents, class _LayoutPolicy, class _AccessorPolicy>
67
+ struct __mdspan_constraints
68
+ {
69
+ using extents_type = _Extents;
70
+ using layout_type = _LayoutPolicy;
71
+ using accessor_type = _AccessorPolicy;
72
+ using mapping_type = typename layout_type::template mapping<extents_type>;
73
+ using index_type = typename extents_type::index_type;
74
+ using data_handle_type = typename accessor_type::data_handle_type;
75
+
76
+ static constexpr bool __can_default_construct =
77
+ (_Extents::rank_dynamic() > 0) && is_default_constructible_v<data_handle_type>
78
+ && is_default_constructible_v<mapping_type> && is_default_constructible_v<accessor_type>;
79
+
80
+ template <class... _OtherIndexTypes>
81
+ static constexpr bool __can_construct_from_handle_and_variadic =
82
+ (__mdspan_detail::__matches_dynamic_rank<extents_type, sizeof...(_OtherIndexTypes)>
83
+ || __mdspan_detail::__matches_static_rank<extents_type, sizeof...(_OtherIndexTypes)>)
84
+ && __mdspan_detail::__all_convertible_to_index_type<index_type, _OtherIndexTypes...>
85
+ && is_constructible_v<mapping_type, extents_type> && is_default_constructible_v<accessor_type>;
86
+
87
+ template <class _OtherIndexType>
88
+ static constexpr bool __is_constructible_from_index_type =
89
+ is_convertible_v<const _OtherIndexType&, index_type>
90
+ && is_nothrow_constructible_v<index_type, const _OtherIndexType&> && is_constructible_v<mapping_type, extents_type>
91
+ && is_default_constructible_v<accessor_type>;
92
+
93
+ template <class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor>
94
+ static constexpr bool __is_convertible_from =
95
+ is_constructible_v<mapping_type, const typename _OtherLayoutPolicy::template mapping<_OtherExtents>&>
96
+ && is_constructible_v<accessor_type, const _OtherAccessor&>;
97
+
98
+ template <class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor>
99
+ static constexpr bool __is_implicit_convertible_from =
100
+ is_convertible_v<const typename _OtherLayoutPolicy::template mapping<_OtherExtents>&, mapping_type>
101
+ && is_convertible_v<const _OtherAccessor&, accessor_type>;
102
+ };
103
+
66
104
  template <class _ElementType, class _Extents, class _LayoutPolicy, class _AccessorPolicy>
67
105
  class mdspan
68
106
  : private __mdspan_ebco<typename _AccessorPolicy::data_handle_type,
@@ -83,6 +121,8 @@ private:
83
121
  template <class, class, class, class>
84
122
  friend class mdspan;
85
123
 
124
+ using __constraints = __mdspan_constraints<_Extents, _LayoutPolicy, _AccessorPolicy>;
125
+
86
126
  public:
87
127
  using extents_type = _Extents;
88
128
  using layout_type = _LayoutPolicy;
@@ -116,17 +156,11 @@ public:
116
156
  return mapping().extents().extent(__r);
117
157
  }
118
158
 
119
- public:
120
159
  //--------------------------------------------------------------------------------
121
160
  // [mdspan.mdspan.cons], mdspan constructors, assignment, and destructor
122
161
 
123
- template <class _Extents2>
124
- static constexpr bool __can_default_construct =
125
- (_Extents2::rank_dynamic() > 0) && is_default_constructible_v<data_handle_type>
126
- && is_default_constructible_v<mapping_type> && is_default_constructible_v<accessor_type>;
127
-
128
162
  _CCCL_TEMPLATE(class _Extents2 = _Extents)
129
- _CCCL_REQUIRES(__can_default_construct<_Extents2>)
163
+ _CCCL_REQUIRES(__mdspan_constraints<_Extents2, _LayoutPolicy, _AccessorPolicy>::__can_default_construct)
130
164
  _CCCL_API constexpr mdspan() noexcept(
131
165
  is_nothrow_default_constructible_v<data_handle_type> && is_nothrow_default_constructible_v<mapping_type>
132
166
  && is_nothrow_default_constructible_v<accessor_type>)
@@ -136,49 +170,36 @@ public:
136
170
  _CCCL_HIDE_FROM_ABI constexpr mdspan(const mdspan&) = default;
137
171
  _CCCL_HIDE_FROM_ABI constexpr mdspan(mdspan&&) = default;
138
172
 
139
- template <class... _OtherIndexTypes>
140
- static constexpr bool __can_construct_from_handle_and_variadic =
141
- (__mdspan_detail::__matches_dynamic_rank<extents_type, sizeof...(_OtherIndexTypes)>
142
- || __mdspan_detail::__matches_static_rank<extents_type, sizeof...(_OtherIndexTypes)>)
143
- && __mdspan_detail::__all_convertible_to_index_type<index_type, _OtherIndexTypes...>
144
- && is_constructible_v<mapping_type, extents_type> && is_default_constructible_v<accessor_type>;
145
-
146
173
  _CCCL_TEMPLATE(class... _OtherIndexTypes)
147
- _CCCL_REQUIRES(__can_construct_from_handle_and_variadic<_OtherIndexTypes...>)
174
+ _CCCL_REQUIRES(__constraints::template __can_construct_from_handle_and_variadic<_OtherIndexTypes...>)
148
175
  _CCCL_API explicit constexpr mdspan(data_handle_type __p, _OtherIndexTypes... __exts)
149
176
  : __base(::cuda::std::move(__p), extents_type(static_cast<index_type>(::cuda::std::move(__exts))...))
150
177
  {}
151
178
 
152
- template <class _OtherIndexType>
153
- static constexpr bool __is_constructible_from_index_type =
154
- is_convertible_v<const _OtherIndexType&, index_type>
155
- && is_nothrow_constructible_v<index_type, const _OtherIndexType&> && is_constructible_v<mapping_type, extents_type>
156
- && is_default_constructible_v<accessor_type>;
157
-
158
179
  _CCCL_TEMPLATE(class _OtherIndexType, size_t _Size)
159
180
  _CCCL_REQUIRES(__mdspan_detail::__matches_dynamic_rank<extents_type, _Size> _CCCL_AND
160
- __is_constructible_from_index_type<_OtherIndexType>)
181
+ __constraints::template __is_constructible_from_index_type<_OtherIndexType>)
161
182
  _CCCL_API constexpr mdspan(data_handle_type __p, const array<_OtherIndexType, _Size>& __exts)
162
183
  : __base(::cuda::std::move(__p), extents_type{__exts})
163
184
  {}
164
185
 
165
186
  _CCCL_TEMPLATE(class _OtherIndexType, size_t _Size)
166
187
  _CCCL_REQUIRES(__mdspan_detail::__matches_static_rank<extents_type, _Size> _CCCL_AND
167
- __is_constructible_from_index_type<_OtherIndexType>)
188
+ __constraints::template __is_constructible_from_index_type<_OtherIndexType>)
168
189
  _CCCL_API explicit constexpr mdspan(data_handle_type __p, const array<_OtherIndexType, _Size>& __exts)
169
190
  : __base(::cuda::std::move(__p), extents_type{__exts})
170
191
  {}
171
192
 
172
193
  _CCCL_TEMPLATE(class _OtherIndexType, size_t _Size)
173
194
  _CCCL_REQUIRES(__mdspan_detail::__matches_dynamic_rank<extents_type, _Size> _CCCL_AND
174
- __is_constructible_from_index_type<_OtherIndexType>)
195
+ __constraints::template __is_constructible_from_index_type<_OtherIndexType>)
175
196
  _CCCL_API constexpr mdspan(data_handle_type __p, span<_OtherIndexType, _Size> __exts)
176
197
  : __base(::cuda::std::move(__p), extents_type{__exts})
177
198
  {}
178
199
 
179
200
  _CCCL_TEMPLATE(class _OtherIndexType, size_t _Size)
180
201
  _CCCL_REQUIRES(__mdspan_detail::__matches_static_rank<extents_type, _Size> _CCCL_AND
181
- __is_constructible_from_index_type<_OtherIndexType>)
202
+ __constraints::template __is_constructible_from_index_type<_OtherIndexType>)
182
203
  _CCCL_API explicit constexpr mdspan(data_handle_type __p, span<_OtherIndexType, _Size> __exts)
183
204
  : __base(::cuda::std::move(__p), extents_type{__exts})
184
205
  {}
@@ -200,19 +221,11 @@ public:
200
221
  : __base(::cuda::std::move(__p), __m, __a)
201
222
  {}
202
223
 
203
- template <class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor>
204
- static constexpr bool __is_convertible_from =
205
- is_constructible_v<mapping_type, const typename _OtherLayoutPolicy::template mapping<_OtherExtents>&>
206
- && is_constructible_v<accessor_type, const _OtherAccessor&>;
207
-
208
- template <class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor>
209
- static constexpr bool __is_implicit_convertible_from =
210
- is_convertible_v<const typename _OtherLayoutPolicy::template mapping<_OtherExtents>&, mapping_type>
211
- && is_convertible_v<const _OtherAccessor&, accessor_type>;
212
-
213
224
  _CCCL_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor)
214
- _CCCL_REQUIRES(__is_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor> //
215
- _CCCL_AND __is_implicit_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor>)
225
+ _CCCL_REQUIRES(
226
+ __constraints::template __is_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor> //
227
+ _CCCL_AND
228
+ __constraints::template __is_implicit_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor>)
216
229
  _CCCL_API constexpr mdspan(const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& __other)
217
230
  : __base(__other.data_handle(), __other.mapping(), __other.accessor())
218
231
  {
@@ -241,8 +254,9 @@ public:
241
254
  }
242
255
 
243
256
  _CCCL_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor)
244
- _CCCL_REQUIRES(__is_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor> _CCCL_AND(
245
- !__is_implicit_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor>))
257
+ _CCCL_REQUIRES(
258
+ __constraints::template __is_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor> _CCCL_AND(
259
+ !__constraints::template __is_implicit_convertible_from<_OtherExtents, _OtherLayoutPolicy, _OtherAccessor>))
246
260
  _CCCL_API explicit constexpr mdspan(
247
261
  const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& __other)
248
262
  : __base(__other.data_handle(), __other.mapping(), __other.accessor())
@@ -34,9 +34,9 @@
34
34
  #include <cuda/std/__utility/forward.h>
35
35
  #include <cuda/std/cstddef>
36
36
 
37
- #if defined(_CCCL_HAS_CONSTEXPR_ALLOCATION) && !_CCCL_COMPILER(NVRTC)
38
- # include <memory>
39
- #endif // _CCCL_HAS_CONSTEXPR_ALLOCATION && !_CCCL_COMPILER(NVRTC)
37
+ #ifdef _CCCL_HAS_CONSTEXPR_ALLOCATION
38
+ # include <cuda/std/__cccl/memory_wrapper.h>
39
+ #endif // _CCCL_HAS_CONSTEXPR_ALLOCATION
40
40
 
41
41
  #include <cuda/std/__cccl/prologue.h>
42
42
 
@@ -43,9 +43,7 @@
43
43
  #endif // _CCCL_CUDA_COMPILER(CLANG)
44
44
 
45
45
  #if _CCCL_STD_VER >= 2020 // need to backfill ::std::construct_at
46
- # if !_CCCL_COMPILER(NVRTC)
47
- # include <memory>
48
- # endif // _CCCL_COMPILER(NVRTC)
46
+ # include <cuda/std/__cccl/memory_wrapper.h>
49
47
 
50
48
  # ifndef __cpp_lib_constexpr_dynamic_alloc
51
49
  namespace std
@@ -32,6 +32,7 @@
32
32
  #include <cuda/std/__type_traits/is_nothrow_constructible.h>
33
33
  #include <cuda/std/__type_traits/is_nothrow_copy_assignable.h>
34
34
  #include <cuda/std/__type_traits/is_nothrow_copy_constructible.h>
35
+ #include <cuda/std/__type_traits/is_nothrow_default_constructible.h>
35
36
  #include <cuda/std/__type_traits/is_nothrow_move_assignable.h>
36
37
  #include <cuda/std/__type_traits/is_nothrow_move_constructible.h>
37
38
  #include <cuda/std/__type_traits/is_object.h>