prefetch.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <rmm/cuda_device.hpp>
10 #include <rmm/detail/error.hpp>
11 #include <rmm/detail/export.hpp>
12 #include <rmm/error.hpp>
13 
14 #include <cuda/std/span>
15 
16 namespace RMM_NAMESPACE {
17 
37 void prefetch(void const* ptr,
38  std::size_t size,
39  rmm::cuda_device_id device,
40  rmm::cuda_stream_view stream);
41 
53 template <typename T>
54 void prefetch(cuda::std::span<T const> data,
55  rmm::cuda_device_id device,
56  rmm::cuda_stream_view stream)
57 {
58  prefetch(data.data(), data.size_bytes(), device, stream);
59 }
60  // end of group
62 
63 } // namespace RMM_NAMESPACE
Strongly-typed non-owning wrapper for CUDA streams with default constructor.
Definition: cuda_stream_view.hpp:28
void prefetch(cuda::std::span< T const > data, rmm::cuda_device_id device, rmm::cuda_stream_view 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