accelerInt  v0.1
Namespaces | Macros | Functions
gpu_macros.cuh File Reference

Defines some simple macros to simplify GPU indexing. More...

#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <helper_cuda.h>
Include dependency graph for gpu_macros.cuh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 van_der_pol_cu
 

Macros

#define GPU_MACROS_CUH
 
#define GRID_DIM   (blockDim.x * gridDim.x)
 The total number of threads in the Grid, provides an offset between vector entries. More...
 
#define T_ID   (threadIdx.x + blockIdx.x * blockDim.x)
 The global CUDA thread index. More...
 
#define INDEX(i)   (T_ID + (i) * GRID_DIM)
 Convenience macro to get the value of a vector at index i, calculated as i * GRID_DIM + T_ID. More...
 
#define cudaErrorCheck(ans)   { gpuAssert((ans), __FILE__, __LINE__); }
 

Functions

void van_der_pol_cu::gpuAssert (cudaError_t code, const char *file, int line, bool abort=true)
 

Detailed Description

Defines some simple macros to simplify GPU indexing.

Definition in file gpu_macros.cuh.

Macro Definition Documentation

◆ cudaErrorCheck

#define cudaErrorCheck (   ans)    { gpuAssert((ans), __FILE__, __LINE__); }

Definition at line 26 of file gpu_macros.cuh.

◆ GPU_MACROS_CUH

#define GPU_MACROS_CUH

Definition at line 8 of file gpu_macros.cuh.

◆ GRID_DIM

#define GRID_DIM   (blockDim.x * gridDim.x)

The total number of threads in the Grid, provides an offset between vector entries.

Definition at line 20 of file gpu_macros.cuh.

◆ INDEX

#define INDEX (   i)    (T_ID + (i) * GRID_DIM)

Convenience macro to get the value of a vector at index i, calculated as i * GRID_DIM + T_ID.

Definition at line 24 of file gpu_macros.cuh.

◆ T_ID

#define T_ID   (threadIdx.x + blockIdx.x * blockDim.x)

The global CUDA thread index.

Definition at line 22 of file gpu_macros.cuh.