Brick Library 0.1
Performance-portable stencil datalayout & codegen
Macros | Functions
brick-cuda.h File Reference

For using bricks with CUDA. More...

#include <cassert>
#include <brick.h>
#include <cuda_runtime.h>
#include "dev_shl.h"
Include dependency graph for brick-cuda.h:

Go to the source code of this file.

Macros

#define cudaCheck(x)   x
 Check the return of CUDA calls, do nothing during release build. More...
 

Functions

template<typename T >
void _cudaCheck (T e, const char *func, const char *call, const int line)
 Internal for cudaCheck(x) More...
 
template<unsigned dims>
BrickInfo< dims > movBrickInfo (BrickInfo< dims > &bInfo, cudaMemcpyKind kind)
 Moving BrickInfo to or from GPU (allocate new) More...
 
BrickStorage movBrickStorage (BrickStorage &bStorage, cudaMemcpyKind kind)
 Moving BrickStorage to or from GPU (allocate new) More...
 

Detailed Description

For using bricks with CUDA.

Macro Definition Documentation

◆ cudaCheck

#define cudaCheck (   x)    x

Check the return of CUDA calls, do nothing during release build.

Function Documentation

◆ _cudaCheck()

template<typename T >
void _cudaCheck ( e,
const char *  func,
const char *  call,
const int  line 
)

Internal for cudaCheck(x)

◆ movBrickInfo()

template<unsigned dims>
BrickInfo< dims > movBrickInfo ( BrickInfo< dims > &  bInfo,
cudaMemcpyKind  kind 
)

Moving BrickInfo to or from GPU (allocate new)

Template Parameters
dimsimplicit when used with bInfo argument
Parameters
bInfoBrickInfo to copy from host or GPU
kindCurrently must be cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost
Returns
a new BrickInfo struct allocated on the destination

◆ movBrickStorage()

BrickStorage movBrickStorage ( BrickStorage bStorage,
cudaMemcpyKind  kind 
)
inline

Moving BrickStorage to or from GPU (allocate new)

Parameters
bStorageBrickStorage to copy from
kindCurrently must be either cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost
Returns
a new BrickStorage struct allocated on the destination