CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
cuv::allocator< value_type, size_type, host_memory_space > Struct Template Reference

specialization of template allocator for host_memory_space More...

#include <accessors.hpp>

Public Member Functions

void alloc (value_type **ptr, size_type size) const
 Allocate memory for host matrices.
void alloc2d (value_type **ptr, size_type &pitch, size_type height, size_type width) const
 Allocate 2D memory.
void dealloc (value_type **ptr) const
 allocate memory
void alloc (const value_type **ptr, size_type size) const
 Allocate memory for host matrices - const allocator should never be called!
void dealloc (const value_type **ptr) const
 Deallocate memory for host matrices- const allocator should never be called!
void copy (value_type *dst, const value_type *src, size_type size, host_memory_space)
 copy from host to host
template<class value_type2 >
void copy (value_type *dst, const value_type2 *src, size_type size, host_memory_space)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.copy from host to host (different memory types)
void copy (value_type *dst, const value_type *src, size_type size, dev_memory_space)
 copy from device to host
void copy (const value_type *dst, const value_type *src, size_type size, host_memory_space) const
 throw assertion (should never be called)
void copy (const value_type *dst, const value_type *src, size_type size, dev_memory_space) const
 throw assertion (should never be called)
void copy2d (value_type *dst, const value_type *src, size_type dpitch, size_type spitch, size_type h, size_type w, host_memory_space)
 copy from host_memory_space
void copy2d (value_type *dst, const value_type *src, size_type dpitch, size_type spitch, size_type h, size_type w, dev_memory_space)
 copy from dev_memory_space

Detailed Description

template<class value_type, class size_type>
struct cuv::allocator< value_type, size_type, host_memory_space >

specialization of template allocator for host_memory_space

The gcc compiler can deal directly with this, so we do not need to hide the implementation in a .cu file.

Definition at line 104 of file accessors.hpp.

Member Function Documentation

template<class value_type , class size_type >
void cuv::allocator< value_type, size_type, host_memory_space >::alloc ( value_type **  ptr,
size_type  size 
) const

Allocate memory for host matrices.

Parameters
ptrAddress of pointer which will be set to allocated memory
sizeSize of array which should be allocated

This is the instance of the alloc function that is called by host vectors.

template<class value_type , class size_type >
void cuv::allocator< value_type, size_type, host_memory_space >::alloc ( const value_type **  ptr,
size_type  size 
) const
inline

Allocate memory for host matrices - const allocator should never be called!

Parameters
ptrAddress of pointer which will be set to allocated memory
sizeSize of array which should be allocated

This is the instance of the alloc function that is called by const host vectors.

Definition at line 139 of file accessors.hpp.

template<class value_type , class size_type >
void cuv::allocator< value_type, size_type, host_memory_space >::alloc2d ( value_type **  ptr,
size_type &  pitch,
size_type  height,
size_type  width 
) const

Allocate 2D memory.

Parameters
ptrAddress of pointer which will be set to allocated memory
pitchOUT size of one "line" in memory in bytes
heightnumber of lines in memory
widthnumber elements in one line
template<class value_type , class size_type >
void cuv::allocator< value_type, size_type, host_memory_space >::dealloc ( value_type **  ptr) const

allocate memory

Deallocate memory for host matrices

Parameters
ptrAddress of pointer that will be freed

This is the instance of the dealloc function that is called by host vectors.

template<class value_type , class size_type >
void cuv::allocator< value_type, size_type, host_memory_space >::dealloc ( const value_type **  ptr) const
inline

Deallocate memory for host matrices- const allocator should never be called!

Parameters
ptrAddress of pointer that will be freed

This is the instance of the dealloc function that is called by host vectors.

Definition at line 149 of file accessors.hpp.


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