mgcpp
A C++ Math Library Based on CUDA
Public Types | Public Member Functions | List of all members
mgcpp::allocator< Type > Class Template Reference

#include <allocator.hpp>

Public Types

using host_value_type = Type
 
using host_pointer = host_value_type *
 
using host_const_pointer = host_value_type const *
 
using device_value_type = typename device_value_type< Type >::type
 
using device_pointer = device_value_type *
 
using device_const_pointer = device_value_type const *
 
template<typename NewType >
using rebind_alloc = allocator< NewType >
 

Public Member Functions

 allocator ()
 
 allocator (memory_resource *host, device_memory_resource *device)
 
template<class U >
 allocator (const allocator< U > &other)
 
host_pointer allocate_host (size_t n)
 
void deallocate_host (host_pointer p, size_t n)
 
device_pointer allocate_device (size_t n)
 
void deallocate_device (device_pointer p, size_t n)
 
void copy_from_host (device_pointer device, device_const_pointer host, size_t n) const
 
void copy_to_host (device_pointer host, device_const_pointer device, size_t n) const
 
allocator select_on_container_copy_construction () const
 
memory_resourcehost_resource () const noexcept
 
device_memory_resourcedevice_resource () const noexcept
 
size_t device_id () const noexcept
 

Member Typedef Documentation

◆ device_const_pointer

template<typename Type>
using mgcpp::allocator< Type >::device_const_pointer = device_value_type const*

◆ device_pointer

template<typename Type>
using mgcpp::allocator< Type >::device_pointer = device_value_type*

◆ device_value_type

template<typename Type>
using mgcpp::allocator< Type >::device_value_type = typename device_value_type<Type>::type

◆ host_const_pointer

template<typename Type>
using mgcpp::allocator< Type >::host_const_pointer = host_value_type const*

◆ host_pointer

template<typename Type>
using mgcpp::allocator< Type >::host_pointer = host_value_type*

◆ host_value_type

template<typename Type>
using mgcpp::allocator< Type >::host_value_type = Type

◆ rebind_alloc

template<typename Type>
template<typename NewType >
using mgcpp::allocator< Type >::rebind_alloc = allocator<NewType>

Constructor & Destructor Documentation

◆ allocator() [1/3]

template<typename Type>
mgcpp::allocator< Type >::allocator ( )

◆ allocator() [2/3]

template<typename Type>
mgcpp::allocator< Type >::allocator ( memory_resource host,
device_memory_resource device 
)

◆ allocator() [3/3]

template<typename Type>
template<class U >
mgcpp::allocator< Type >::allocator ( const allocator< U > &  other)

Member Function Documentation

◆ allocate_device()

template<typename Type>
device_pointer mgcpp::allocator< Type >::allocate_device ( size_t  n)

◆ allocate_host()

template<typename Type>
host_pointer mgcpp::allocator< Type >::allocate_host ( size_t  n)

◆ copy_from_host()

template<typename Type>
void mgcpp::allocator< Type >::copy_from_host ( device_pointer  device,
device_const_pointer  host,
size_t  n 
) const

◆ copy_to_host()

template<typename Type>
void mgcpp::allocator< Type >::copy_to_host ( device_pointer  host,
device_const_pointer  device,
size_t  n 
) const

◆ deallocate_device()

template<typename Type>
void mgcpp::allocator< Type >::deallocate_device ( device_pointer  p,
size_t  n 
)

◆ deallocate_host()

template<typename Type>
void mgcpp::allocator< Type >::deallocate_host ( host_pointer  p,
size_t  n 
)

◆ device_id()

template<typename Type>
size_t mgcpp::allocator< Type >::device_id ( ) const
noexcept

◆ device_resource()

template<typename Type>
device_memory_resource* mgcpp::allocator< Type >::device_resource ( ) const
noexcept

◆ host_resource()

template<typename Type>
memory_resource* mgcpp::allocator< Type >::host_resource ( ) const
noexcept

◆ select_on_container_copy_construction()

template<typename Type>
allocator mgcpp::allocator< Type >::select_on_container_copy_construction ( ) const

The documentation for this class was generated from the following file: