Class Data_Namespace::TypedThrustAllocator

template<typename T>
class TypedThrustAllocator : public Data_Namespace::detail::TypedThrustAllocatorState, public thrust::mr::allocator<T, detail::TypedThrustAllocatorState::DeviceResource>

a Templated version of Data_Namespace::ThrustAllocator that can be used as a custom allocator in thrust device containers such as thrust::device_vector. Note that this class derives from thrust::mr::allocator in order to meet the requirements of an Allocator

// creates a thrust allocator on device 0
ThrustAllocator thrust_allocator(data_mgr, 0);
// creates a device vector that allocates storage via the above ThrustAllocator
thrust::device_vector<int, TypedThrustAllocator<int>>
vec(10, TypedThrustAllocator<int>(thrust_allocator));

Public Functions

TypedThrustAllocator(ThrustAllocator &thrust_allocator)
TypedThrustAllocator(const TypedThrustAllocator &other)
TypedThrustAllocator(TypedThrustAllocator &&other)
__host__ __device__ void Data_Namespace::TypedThrustAllocator::operator=(const TypedThrustAllocator < T > & other)

Private Types

template<>
using Base = thrust::mr::allocator<T, detail::TypedThrustAllocatorState::DeviceResource>