exec_policy.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2025, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
22 #pragma once
23 
24 #include <rmm/cuda_stream_view.hpp>
25 #include <rmm/detail/export.hpp>
26 #include <rmm/detail/thrust_namespace.h>
28 #include <rmm/resource_ref.hpp>
29 
30 #include <thrust/system/cuda/execution_policy.h>
31 #include <thrust/version.h>
32 
33 namespace RMM_NAMESPACE {
44  thrust::detail::execute_with_allocator<mr::thrust_allocator<char>,
45  thrust::cuda_cub::execute_on_stream_base>;
46 
52  public:
61 };
62 
67  thrust::detail::execute_with_allocator<mr::thrust_allocator<char>,
68  thrust::cuda_cub::execute_on_stream_nosync_base>;
69 
77  public:
86 };
87  // end of group
89 } // namespace RMM_NAMESPACE
Strongly-typed non-owning wrapper for CUDA streams with default constructor.
Definition: cuda_stream_view.hpp:39
Helper class usable as a Thrust CUDA execution policy that uses RMM for temporary memory allocation o...
Definition: exec_policy.hpp:76
exec_policy_nosync(cuda_stream_view stream=cuda_stream_default, device_async_resource_ref 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:51
exec_policy(cuda_stream_view stream=cuda_stream_default, device_async_resource_ref 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:122
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
Alias for a cuda::mr::async_resource_ref with the property cuda::mr::device_accessible.
Definition: resource_ref.hpp:40
device_async_resource_ref get_current_device_resource_ref()
Get the device_async_resource_ref for the current device.
Definition: per_device_resource.hpp:411
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:68
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:45