6#ifndef BRICK_GPU_FUNCS_H
7#define BRICK_GPU_FUNCS_H
9#if !(defined(BRICK_BRICK_CUDA_H) || defined(BRICK_BRICK_HIP_H))
10#error "Include either brick-cuda.h or brick-hip.h for generic GPU defines"
23#define gpuCheck(x) _gpuCheck(x, #x, __FILE__, __LINE__)
28void _gpuCheck(T e,
const char *func,
const char *call,
const int line) {
30 printf(
"\"%s\" at %d in %s\n\treturned %d\n-> %s\n", func, line, call, (
int) e,
gpuGetErrorString(e));
42template<
unsigned dims>
64template<
unsigned dims>
94 datptr = (
bElem *) malloc(size);
100 ret.
dat = std::shared_ptr<bElem>(datptr, [](
bElem *p) { free(p); });
#define gpuMalloc(p, s)
Definition: brick-cuda.h:12
#define gpuMemcpy(d, p, s, k)
Definition: brick-cuda.h:13
#define gpuMemcpyHostToDevice
Definition: brick-cuda.h:15
#define gpuMemcpyDeviceToHost
Definition: brick-cuda.h:16
#define gpuSuccess
Definition: brick-cuda.h:19
#define gpuGetErrorString(e)
Definition: brick-cuda.h:18
#define gpuMemcpyKind
Definition: brick-cuda.h:14
#define gpuFree(p)
Definition: brick-cuda.h:17
#define gpuCheck(x)
Definition: brick-gpu.h:18
void _gpuCheck(T e, const char *func, const char *call, const int line)
Definition: brick-gpu.h:28
BrickStorage movBrickStorage(BrickStorage &bStorage, gpuMemcpyKind kind)
Moving BrickStorage to or from GPU (allocate new)
Definition: brick-gpu.h:84
BrickInfo< dims > * movBrickInfoDeep(BrickInfo< dims > &bInfo, gpuMemcpyKind kind)
Moving the full BrickInfo to or from GPU, including the adjacency list and other elements.
Definition: brick-gpu.h:65
BrickInfo< dims > movBrickInfo(BrickInfo< dims > &bInfo, gpuMemcpyKind kind)
Moving BrickInfo to or from GPU.
Definition: brick-gpu.h:43
Implementation for various shuffle implementations.
Metadata related to bricks.
Definition: brick.h:97
unsigned nbricks
Number of bricks in this list.
Definition: brick.h:103
adjlist adj
Adjacency list.
Definition: brick.h:101
Initializing and holding the storage of bricks.
Definition: brick.h:53
std::shared_ptr< bElem > dat
Pointer holding brick data.
Definition: brick.h:55
long chunks
Number of chunks.
Definition: brick.h:61
size_t step
Size of a chunk in number of elements.
Definition: brick.h:63
Compute Statically compute exponentials.
Definition: brick.h:35
#define bElem
Basic datatype for all brick elements.
Definition: vecscatter.h:13