milupHPC documentation
Namespaces | Functions
cuda Namespace Reference

Namespaces

namespace  math
 Device/CUDA math functions.
 

Functions

template<typename... Arguments>
real launch (bool timeKernel, const ExecutionPolicy &policy, void(*f)(Arguments...), Arguments... args)
 CUDA execution wrapper function. More...
 
template<typename... Arguments>
real launch (bool timeKernel, void(*f)(Arguments... args), Arguments... args)
 CUDA execution wrapper function. More...
 
template<typename T >
void copy (T *h_var, T *d_var, std::size_t count=1, To::Target copyTo=To::device)
 Copy between host and device and vice-versa. More...
 
template<typename T >
void set (T *d_var, T val, std::size_t count=1)
 Set device memory to a specific value. More...
 
template<typename T >
void malloc (T *&d_var, std::size_t count)
 Allocate device memory. More...
 
template<typename T >
void free (T *d_var)
 Free device memory. More...
 

Function Documentation

◆ copy()

template<typename T >
void cuda::copy ( T *  h_var,
T *  d_var,
std::size_t  count = 1,
To::Target  copyTo = To::device 
)

Copy between host and device and vice-versa.

Wrapping CUDA runtime function cudaMemcpy().

Template Parameters
TVariable type to be copied
Parameters
h_varHost variable
d_varDevice variable
countAmount of variable to be copied
copyToCopy from device to host or from host to device

Definition at line 30 of file cuda_runtime.h.

◆ free()

template<typename T >
void cuda::free ( T *  d_var)

Free device memory.

Template Parameters
TVariable type to be freed
Parameters
d_varDevice variable to be freed

Definition at line 81 of file cuda_runtime.h.

◆ launch() [1/2]

template<typename... Arguments>
real cuda::launch ( bool  timeKernel,
const ExecutionPolicy &  policy,
void(*)(Arguments...)  f,
Arguments...  args 
)

CUDA execution wrapper function.

Template Parameters
ArgumentsCUDA kernel arguments
Parameters
timeKerneltime execution of kernel
policyExecution policy
fCUDA kernel (function pointer)
argsCUDA kernel actual arguments
Returns
execution time

Definition at line 114 of file cuda_launcher.cuh.

◆ launch() [2/2]

template<typename... Arguments>
real cuda::launch ( bool  timeKernel,
void(*)(Arguments... args)  f,
Arguments...  args 
)

CUDA execution wrapper function.

Template Parameters
ArgumentsCUDA kernel arguments
Parameters
timeKerneltime execution of kernel
fCUDA kernel (function pointer)
argsCUDA kernel actual arguments
Returns
execution time

Definition at line 153 of file cuda_launcher.cuh.

◆ malloc()

template<typename T >
void cuda::malloc ( T *&  d_var,
std::size_t  count 
)

Allocate device memory.

Wrapping CUDA runtime function cudaMalloc().

Template Parameters
TVariable type to be allocated
Parameters
d_varDevice variable pointing to device memory allocated
countAmount of variables or subsequent memory location to be allocated

Definition at line 70 of file cuda_runtime.h.

◆ set()

template<typename T >
void cuda::set ( T *  d_var,
T  val,
std::size_t  count = 1 
)

Set device memory to a specific value.

Wrapping CUDA runtime function cudaMemset().

Template Parameters
TVariable type to be set
Parameters
d_varDevice variable or memory to be set
valValue the device memory to be set
countAmount of variables or subsequent memory location to be set

Definition at line 56 of file cuda_runtime.h.


milupHPC - cuda Namespace Reference
Generated on Wed Aug 31 2022 12:16:53 by Doxygen 1.9.3