Reference documentation for deal.II version 9.0.0
Classes | Functions
Utilities::CUDA Namespace Reference

Classes

struct  Handle
 

Functions

template<typename T >
void malloc (T *&pointer, const unsigned int n_elements)
 
template<typename T >
void free (T *&pointer)
 
template<typename T >
void copy_to_host (const T *pointer_dev, std::vector< T > &vector_host)
 
template<typename T >
void copy_to_dev (const std::vector< T > &vector_host, T *pointer_dev)
 

Detailed Description

A namespace for utility structures for CUDA.

Function Documentation

◆ malloc()

template<typename T >
void Utilities::CUDA::malloc ( T *&  pointer,
const unsigned int  n_elements 
)
inline

Allocate n_elements on the device.

Definition at line 74 of file cuda.h.

◆ free()

template<typename T >
void Utilities::CUDA::free ( T *&  pointer)
inline

Free memory on the device.

Definition at line 84 of file cuda.h.

◆ copy_to_host()

template<typename T >
void Utilities::CUDA::copy_to_host ( const T *  pointer_dev,
std::vector< T > &  vector_host 
)
inline

Copy the elements in pointer_dev to the host in vector_host.

Definition at line 95 of file cuda.h.

◆ copy_to_dev()

template<typename T >
void Utilities::CUDA::copy_to_dev ( const std::vector< T > &  vector_host,
T *  pointer_dev 
)
inline

Copy the elements in vector_host to the device in pointer_dev. The memory needs to be allocate on the device before this function is called.

Definition at line 109 of file cuda.h.