exec_policy.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
11 #pragma once
12 
13 #include <rmm/cuda_stream_view.hpp>
14 #include <rmm/detail/export.hpp>
15 #include <rmm/detail/thrust_namespace.h>
17 #include <rmm/resource_ref.hpp>
18 
19 #include <thrust/system/cuda/execution_policy.h>
20 #include <thrust/version.h>
21 
22 namespace RMM_NAMESPACE {
33  thrust::detail::execute_with_allocator<mr::thrust_allocator<char>,
34  thrust::cuda_cub::execute_on_stream_base>;
35 
41  public:
48  explicit exec_policy(
50  cuda::mr::any_resource<cuda::mr::device_accessible> mr = mr::get_current_device_resource_ref());
51 };
52 
57  thrust::detail::execute_with_allocator<mr::thrust_allocator<char>,
58  thrust::cuda_cub::execute_on_stream_nosync_base>;
59 
67  public:
76  cuda::mr::any_resource<cuda::mr::device_accessible> mr = mr::get_current_device_resource_ref());
77 };
78  // end of group
80 } // namespace RMM_NAMESPACE
Strongly-typed non-owning wrapper for CUDA streams with default constructor.
Definition: cuda_stream_view.hpp:28
Helper class usable as a Thrust CUDA execution policy that uses RMM for temporary memory allocation o...
Definition: exec_policy.hpp:66
exec_policy_nosync(cuda_stream_view stream=cuda_stream_default, cuda::mr::any_resource< cuda::mr::device_accessible > mr=mr::get_current_device_resource_ref())
Construct a new execution policy object.
Helper class usable as a Thrust CUDA execution policy that uses RMM for temporary memory allocation o...
Definition: exec_policy.hpp:40
exec_policy(cuda_stream_view stream=cuda_stream_default, cuda::mr::any_resource< cuda::mr::device_accessible > mr=mr::get_current_device_resource_ref())
Construct a new execution policy object.
static constexpr cuda_stream_view cuda_stream_default
Static cuda_stream_view of the default stream (stream 0), for convenience.
Definition: cuda_stream_view.hpp:111
device_async_resource_ref get_current_device_resource_ref()
Get the device_async_resource_ref for the current device.
Definition: per_device_resource.hpp:223
thrust::detail::execute_with_allocator< mr::thrust_allocator< char >, thrust::cuda_cub::execute_on_stream_nosync_base > thrust_exec_policy_nosync_t
Asynchronous execution policy for allocations using Thrust.
Definition: exec_policy.hpp:58
thrust::detail::execute_with_allocator< mr::thrust_allocator< char >, thrust::cuda_cub::execute_on_stream_base > thrust_exec_policy_t
Synchronous execution policy for allocations using Thrust.
Definition: exec_policy.hpp:34