prefetch.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <rmm/cuda_device.hpp>
9 #include <rmm/detail/error.hpp>
10 #include <rmm/detail/export.hpp>
11 #include <rmm/error.hpp>
12 
13 #include <cuda/std/span>
14 #include <cuda/stream>
15 
16 RMM_NAMESPACE_BEGIN
17 
37 void prefetch(void const* ptr,
38  std::size_t size,
39  rmm::cuda_device_id device,
40  cuda::stream_ref stream);
41 
53 template <typename T>
54 void prefetch(cuda::std::span<T const> data, rmm::cuda_device_id device, cuda::stream_ref stream)
55 {
56  prefetch(data.data(), data.size_bytes(), device, stream);
57 }
58  // end of group
60 
61 RMM_NAMESPACE_END
void prefetch(cuda::std::span< T const > data, rmm::cuda_device_id device, cuda::stream_ref stream)
Prefetch a span of memory to the specified device on the specified stream.
Definition: prefetch.hpp:54
Strong type for a CUDA device identifier.
Definition: cuda_device.hpp:27