19#if GPU_PLATFORM == NVIDIA
20 #include <cuda_runtime.h>
21#elif GPU_PLATFORM == AMD
22 #include <hip/hip_runtime.h>
23 #define cudaDeviceProp hipDeviceProp_t
24 #define cudaDeviceReset hipDeviceReset
25 #define cudaDeviceSynchronize hipDeviceSynchronize
26 #define cudaError_t hipError_t
27 #define cudaFree hipFree
28 #define cudaGetDeviceProperties hipGetDeviceProperties
29 #define cudaGetErrorString hipGetErrorString
30 #define cudaMalloc hipMalloc
31 #define cudaMemcpy hipMemcpy
32 #define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost
33 #define cudaMemcpyHostToDevice hipMemcpyHostToDevice
34 #define cudaSetDevice hipSetDevice
35 #define cudaSuccess hipSuccess
43#define TEMPLATE_ROUTINE_INSTANCE(ret, routine) template ret routine
45#define DATA_TRANSFER_INST(type) \
46 TEMPLATE_ROUTINE_INSTANCE( \
47 bool, data_transfer(type *dst, const type *src, const int size))
49#define CUDA_CHECK(call) \
51 const cudaError_t error = call; \
52 if (error != cudaSuccess) { \
53 printf("Error: %s:%d, ", __FILE__, __LINE__); \
54 printf("code: %d, reasone: %s\n", error, cudaGetErrorString(error)); \
62 unsigned int *cind_L,
const int nnz_L);
68 unsigned int *cind_L,
const int nnz_L);
Planning module main class.
bool fill_lower_left(int *iRow, int *jCol, unsigned int *rind_L, unsigned int *cind_L, const int nnz_L)
__global__ void data_transfer_gpu(T *dst, const T *src, const int size)
__global__ void fill_lower_left_gpu(int *iRow, int *jCol, unsigned int *rind_L, unsigned int *cind_L, const int nnz_L)
bool data_transfer(T *dst, const T *src, const int size)