Thrust 集成

group Thrust 集成

类型定义

template<typename T>
using device_vector = thrust::device_vector<T, rmm::mr::thrust_allocator<T>>

使用 RMM 进行内存分配的 thrust::device_vector 别名。

using thrust_exec_policy_t = thrust::detail::execute_with_allocator<mr::thrust_allocator<char>, thrust::cuda_cub::execute_on_stream_base>

使用 thrust 进行分配的同步执行策略。

using thrust_exec_policy_nosync_t = thrust_exec_policy_t

当与 Thrust < 1.16.0 一起使用时,thrust_exec_policy_nosync_t 是 thrust_exec_policy_t 的别名。

using exec_policy_nosync = exec_policy

当与 Thrust < 1.16.0 一起使用时,exec_policy_nosync 是 exec_policy 的别名。

class exec_policy : public thrust_exec_policy_t
#include <exec_policy.hpp>

可用作 Thrust CUDA 执行策略的辅助类,用于在指定的流上使用 RMM 进行临时内存分配。

公共函数

inline explicit exec_policy(cuda_stream_view stream = cuda_stream_default, device_async_resource_ref mr = mr::get_current_device_resource_ref())

构造新的执行策略对象。

参数:
  • stream – 在其上分配临时内存的流

  • mr – 用于分配临时内存的资源