check transfer  0.1
Check data transfer for SDAccell OpenCL application
Public Types | Public Member Functions | List of all members
aligned_allocator< T > Struct Template Reference

#include <xcl2.hpp>

Public Types

using value_type = T
 

Public Member Functions

T * allocate (std::size_t num)
 
void deallocate (T *p, std::size_t num)
 

Detailed Description

template<typename T>
struct aligned_allocator< T >

Definition at line 52 of file xcl2.hpp.

Member Typedef Documentation

◆ value_type

template<typename T >
using aligned_allocator< T >::value_type = T

Definition at line 54 of file xcl2.hpp.

Member Function Documentation

◆ allocate()

template<typename T >
T* aligned_allocator< T >::allocate ( std::size_t  num)
inline

Definition at line 55 of file xcl2.hpp.

56  {
57  void* ptr = nullptr;
58  if (posix_memalign(&ptr,4096,num*sizeof(T)))
59  throw std::bad_alloc();
60  return reinterpret_cast<T*>(ptr);
61  }

◆ deallocate()

template<typename T >
void aligned_allocator< T >::deallocate ( T *  p,
std::size_t  num 
)
inline

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