Skip to content

Commit 1b8de5e

Browse files
pciolkoszwmaxey
andauthored
Require CUDA 12.9 for host numa implementation of pinned memory pool (#7856) (#7872)
(cherry picked from commit 413e89a) Co-authored-by: Wesley Maxey <71408887+wmaxey@users.noreply.github.com>
1 parent 19e1b87 commit 1b8de5e

File tree

14 files changed

+55
-55
lines changed

14 files changed

+55
-55
lines changed

cudax/examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ file(
3737
cccl_get_cudatoolkit()
3838

3939
# Example requires pinned_memory_resource.
40-
if (CUDAToolkit_VERSION VERSION_LESS 12.6)
40+
if (CUDAToolkit_VERSION VERSION_LESS 12.9)
4141
list(REMOVE_ITEM example_srcs async_buffer_add.cu cub_reduce.cu)
4242
endif()
4343

cudax/test/cuco/hyperloglog/test_hyperloglog.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ C2H_TEST("HyperLogLog precision constructor", "[hyperloglog]")
215215
REQUIRE(estimator.estimate() == 0);
216216
}
217217

218-
#if _CCCL_CTK_AT_LEAST(12, 6) // Pinned memory resource is only supported with CTK 12.6 and later
218+
#if _CCCL_CTK_AT_LEAST(12, 9) // Pinned memory resource is only supported with CTK 12.9 and later
219219
C2H_TEST("Hyperloglog estimate works with pinned memory pool", "[hyperloglog]")
220220
{
221221
using T = int32_t;
@@ -243,4 +243,4 @@ C2H_TEST("Hyperloglog estimate works with pinned memory pool", "[hyperloglog]")
243243

244244
REQUIRE(relative_error < tolerance_factor * relative_standard_deviation);
245245
}
246-
#endif // _CCCL_CTK_AT_LEAST(12, 6)
246+
#endif // _CCCL_CTK_AT_LEAST(12, 9)

docs/libcudacxx/runtime/legacy_resources.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For the full memory resource model and property system, see
1616
.. _libcudacxx-memory-resource-legacy-pinned-memory-resource:
1717

1818
Provides pinned (page-locked) host allocations using ``cudaMallocHost`` and ``cudaFreeHost``. This resource is
19-
*synchronous-only* and is intended as a compatibility fallback. For CUDA 12.6 and later, prefer
19+
*synchronous-only* and is intended as a compatibility fallback. For CUDA 12.9 and later, prefer
2020
``cuda::pinned_memory_resource``.
2121

2222
.. code:: cpp

docs/libcudacxx/runtime/memory_pools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Memory pool objects implement the :ref:`cuda::memory_resource <libcudacxx-extend
99

1010
For the full memory resource model and property system, see :ref:`Memory Resources (Extended API) <libcudacxx-extended-api-memory-resources>`.
1111

12-
Host memory pools are supported on CUDA 12.6 and later. Managed memory pools are supported on CUDA 13.0 and later and are not supported on Windows. For those cases use :ref:`cuda::mr::legacy_pinned_memory_resource <libcudacxx-memory-resource-legacy-pinned-memory-resource>` and :ref:`cuda::mr::legacy_managed_memory_resource <libcudacxx-memory-resource-legacy-managed-memory-resource>` instead.
12+
Host memory pools are supported on CUDA 12.9 and later. Managed memory pools are supported on CUDA 13.0 and later and are not supported on Windows. For those cases use :ref:`cuda::mr::legacy_pinned_memory_resource <libcudacxx-memory-resource-legacy-pinned-memory-resource>` and :ref:`cuda::mr::legacy_managed_memory_resource <libcudacxx-memory-resource-legacy-managed-memory-resource>` instead.
1313

1414
``cuda::device_memory_pool``
1515
----------------------------
@@ -102,7 +102,7 @@ Availability: CCCL 3.2.0 / CUDA 13.2 (requires CTK 13.0+). Not supported on Wind
102102

103103
``cuda::pinned_memory_pool`` allocates pinned (page-locked) host memory using CUDA's memory pool API. Pinned memory enables faster host-to-device transfers and can be accessed from all devices. The pool can be optionally created for a specific host NUMA node.
104104

105-
Availability: CCCL 3.2.0 / CUDA 13.2 (requires CTK 12.6+)
105+
Availability: CCCL 3.2.0 / CUDA 13.2 (requires CTK 12.9+)
106106

107107
Example:
108108

@@ -137,7 +137,7 @@ Example:
137137

138138
``cuda::pinned_memory_pool_ref`` is a non-owning reference to a pinned memory pool.
139139

140-
Availability: CCCL 3.2.0 / CUDA 13.2 (requires CTK 12.6+)
140+
Availability: CCCL 3.2.0 / CUDA 13.2 (requires CTK 12.9+)
141141

142142
Default Memory Pools
143143
--------------------

libcudacxx/include/cuda/__memory_pool/memory_pool_base.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ inline bool __is_host_memory_pool_supported()
178178
// of the default pool just to be sure
179179
# if _CCCL_CTK_AT_LEAST(13, 0)
180180
return ::cuda::device_attributes::host_memory_pools_supported(cuda::device_ref{0});
181-
# elif _CCCL_CTK_AT_LEAST(12, 6)
181+
# elif _CCCL_CTK_AT_LEAST(12, 9)
182182
return ::cuda::device_attributes::host_numa_memory_pools_supported(cuda::device_ref{0});
183183
# else
184184
return false;
@@ -206,12 +206,12 @@ inline void __verify_device_supports_stream_ordered_allocations(
206206
::cuda::__throw_cuda_error(::cudaErrorNotSupported, "managed memory pools are not supported");
207207
}
208208
# endif // _CCCL_CTK_AT_LEAST(13, 0)
209-
# if _CCCL_CTK_AT_LEAST(12, 6)
209+
# if _CCCL_CTK_AT_LEAST(12, 9)
210210
if (__location.type == ::CU_MEM_LOCATION_TYPE_HOST && !__is_host_memory_pool_supported())
211211
{
212212
::cuda::__throw_cuda_error(::cudaErrorNotSupported, "host memory pools are not supported");
213213
}
214-
# endif // _CCCL_CTK_AT_LEAST(12, 6)
214+
# endif // _CCCL_CTK_AT_LEAST(12, 9)
215215
}
216216

217217
//! @brief Check whether the specified `cudaMemAllocationHandleType` is
@@ -228,7 +228,7 @@ inline void __verify_device_supports_export_handle_type(
228228
return;
229229
}
230230
if (__location.type != ::CU_MEM_LOCATION_TYPE_DEVICE
231-
# if _CCCL_CTK_AT_LEAST(12, 6)
231+
# if _CCCL_CTK_AT_LEAST(12, 9)
232232
&& __location.type != ::CU_MEM_LOCATION_TYPE_HOST_NUMA
233233
# endif
234234
)

libcudacxx/include/cuda/__memory_pool/pinned_memory_pool.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
//! allocates pinned memory.
3737
_CCCL_BEGIN_NAMESPACE_CUDA
3838

39-
# if _CCCL_CTK_AT_LEAST(12, 6)
39+
# if _CCCL_CTK_AT_LEAST(12, 9)
4040

4141
_CCCL_DIAG_PUSH
4242
_CCCL_DIAG_SUPPRESS_CLANG("-Wmissing-braces")
@@ -205,7 +205,7 @@ static_assert(::cuda::mr::resource_with<pinned_memory_pool, ::cuda::mr::host_acc
205205

206206
_CCCL_DIAG_POP
207207

208-
# endif // _CCCL_CTK_AT_LEAST(12, 6)
208+
# endif // _CCCL_CTK_AT_LEAST(12, 9)
209209

210210
_CCCL_END_NAMESPACE_CUDA
211211

libcudacxx/include/cuda/__memory_resource/legacy_pinned_memory_resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
_CCCL_BEGIN_NAMESPACE_CUDA_MR
3939

4040
//! @brief legacy_pinned_memory_resource uses `cudaMallocHost` / `cudaFreeAsync` for allocation / deallocation.
41-
//! @note This memory resource will be deprecated in the future. For CUDA 12.6 and above, use
41+
//! @note This memory resource will be deprecated in the future. For CUDA 12.9 and above, use
4242
//! `cuda::pinned_memory_resource` instead, which is the long-term replacement.
4343
class legacy_pinned_memory_resource
4444
{

libcudacxx/test/libcudacxx/cuda/containers/buffer/constructor.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ C2H_CCCLRT_TEST("cuda::buffer constructors with legacy resource", "[container][b
465465
STATIC_CHECK(!decltype(buffer2)::properties_list::has_property(cuda::mr::device_accessible{}));
466466
}
467467

468-
#if _CCCL_CTK_AT_LEAST(12, 6)
468+
#if _CCCL_CTK_AT_LEAST(12, 9)
469469
C2H_CCCLRT_TEST("cuda::make_buffer narrowing properties", "[container][buffer]")
470470
{
471471
if (!cuda::__is_host_memory_pool_supported())
@@ -492,7 +492,7 @@ C2H_CCCLRT_TEST("cuda::make_buffer narrowing properties", "[container][buffer]")
492492
CCCLRT_CHECK(equal_range(buf_host));
493493
CCCLRT_CHECK(buf_device.size() == 2);
494494
}
495-
#endif // ^^^ _CCCL_CTK_AT_LEAST(12, 6) ^^^
495+
#endif // ^^^ _CCCL_CTK_AT_LEAST(12, 9) ^^^
496496

497497
C2H_CCCLRT_TEST("cuda::make_buffer with memory_pool_ref", "[container][buffer]")
498498
{

libcudacxx/test/libcudacxx/cuda/containers/buffer/helper.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ struct extract_properties<cuda::buffer<T, Properties...>>
189189
{
190190
if constexpr (cuda::mr::__is_host_accessible<Properties...>)
191191
{
192-
#if _CCCL_CTK_AT_LEAST(12, 6)
192+
#if _CCCL_CTK_AT_LEAST(12, 9)
193193
return offset_by_alignment_resource(cuda::pinned_default_memory_pool());
194-
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 6) ^^^ / vvv _CCCL_CTK_BELOW(12, 6) vvv
194+
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 9) ^^^ / vvv _CCCL_CTK_BELOW(12, 9) vvv
195195
throw std::runtime_error("Host accessible memory pools are not supported");
196-
#endif // ^^^ _CCCL_CTK_BELOW(12, 6) ^^^
196+
#endif // ^^^ _CCCL_CTK_BELOW(12, 9) ^^^
197197
}
198198
else
199199
{
@@ -220,12 +220,12 @@ struct extract_properties<cuda::buffer<T, Properties...>>
220220
using matching_resource = memory_resource_wrapper<other_property, Properties...>;
221221
};
222222

223-
#if _CCCL_CTK_AT_LEAST(12, 6)
223+
#if _CCCL_CTK_AT_LEAST(12, 9)
224224
using test_types = c2h::type_list<cuda::buffer<int, cuda::mr::host_accessible>,
225225
cuda::buffer<unsigned long long, cuda::mr::device_accessible>,
226226
cuda::buffer<int, cuda::mr::host_accessible, cuda::mr::device_accessible>>;
227-
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 6) ^^^ / vvv _CCCL_CTK_BELOW(12, 6) vvv
227+
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 9) ^^^ / vvv _CCCL_CTK_BELOW(12, 9) vvv
228228
using test_types = c2h::type_list<cuda::buffer<int, cuda::mr::device_accessible>>;
229-
#endif // ^^^ _CCCL_CTK_BELOW(12, 6) ^^^
229+
#endif // ^^^ _CCCL_CTK_BELOW(12, 9) ^^^
230230

231231
#endif // CUDA_TEST_CONTAINER_VECTOR_HELPER_H

libcudacxx/test/libcudacxx/cuda/containers/buffer/properties.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
#include "helper.h"
2121
#include "types.h"
2222

23-
#if _CCCL_CTK_AT_LEAST(12, 6)
23+
#if _CCCL_CTK_AT_LEAST(12, 9)
2424
using property_test_types =
2525
c2h::type_list<cuda::buffer<int, cuda::mr::host_accessible>,
2626
cuda::buffer<int, cuda::mr::device_accessible>,
2727
cuda::buffer<int, cuda::mr::host_accessible, cuda::mr::device_accessible>>;
28-
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 6) ^^^ / vvv _CCCL_CTK_BELOW(12, 6) vvv
28+
#else // ^^^ _CCCL_CTK_AT_LEAST(12, 9) ^^^ / vvv _CCCL_CTK_BELOW(12, 9) vvv
2929
using property_test_types = c2h::type_list<cuda::buffer<int, cuda::mr::device_accessible>>;
30-
#endif // ^^^ _CCCL_CTK_BELOW(12, 6) ^^^
30+
#endif // ^^^ _CCCL_CTK_BELOW(12, 9) ^^^
3131

3232
C2H_CCCLRT_TEST("cuda::buffer properties", "[container][buffer]", property_test_types)
3333
{

0 commit comments

Comments
 (0)