Proto  3.2
Macros | Functions
Proto_GPU.H File Reference
#include "iostream"
#include <typeinfo>
Include dependency graph for Proto_GPU.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define protoGetCurrentStream   DisjointBoxLayout::getCurrentStream()
 
#define GPU_CHECK(in)
 Data Types / classes. More...
 
#define PRINT_KERNEL_NAME_ARGS(IN, BLOCKS, THREADS)
 Functions. More...
 
#define PRINT_KER(X)   X
 

Functions

template<typename T >
bool isDeviceMemory (T *ptr)
 
void v100tuning (int nbElems, int &nbBlocks, int &blockSize)
 

Macro Definition Documentation

◆ protoGetCurrentStream

#define protoGetCurrentStream   DisjointBoxLayout::getCurrentStream()

In general, all calls to cuda have been redefined as macros in order to easily make a switch with hip at compile time. These macros are defined into {Proto_gpu.H}. To use the HIP, you need to include the following flags: {-DPROTO_CUDA} and {-DPROTO_HIP}. Most of cudaNAME functions are renamed protoNAME such as:

{lstlisting}[language=C++,caption={Macro Define}] #if defined PROTO_HIP #define protoMalloc(...) hipMalloc(...) // HIP #else protoMalloc(...) cudaMalloc(...) // CUDA #endif {lstlisting}

In the following sections, you will find the renamed cuda functions and data types. Functions that aren't real cuda Function such as cudaApply or structures such as cudaUglyStruct keep their names. More than 95$%$ of the changes have been made in the Proto.

◆ GPU_CHECK

#define GPU_CHECK (   in)
Value:
do \
{ \
protoError_t error = in; \
if(error != protoSuccess) \
{ \
std::cout << protoGetErrorString(error); \
exit(0); \
}\
} while(0)

Data Types / classes.

Referenced by protoLaunchKernelMemAsyncT().

◆ PRINT_KERNEL_NAME_ARGS

#define PRINT_KERNEL_NAME_ARGS (   IN,
  BLOCKS,
  THREADS 
)

Functions.

Referenced by protoLaunchKernelMemAsyncT().

◆ PRINT_KER

#define PRINT_KER (   X)    X

Function Documentation

◆ isDeviceMemory()

template<typename T >
bool isDeviceMemory ( T *  ptr)
inline

◆ v100tuning()

void v100tuning ( int  nbElems,
int &  nbBlocks,
int &  blockSize 
)
inline