30 lines
1.2 KiB
C
30 lines
1.2 KiB
C
#pragma once
|
|
|
|
#ifdef __HIP_PLATFORM_AMD__
|
|
#include <hip/hip_runtime.h>
|
|
#include <hip/hip_runtime_api.h>
|
|
#define cudaError_t hipError_t
|
|
#define cudaSuccess hipSuccess
|
|
#define cudaMalloc hipMalloc
|
|
#define cudaFree hipFree
|
|
#define cudaMemcpy hipMemcpy
|
|
#define cudaMemcpyHostToDevice hipMemcpyHostToDevice
|
|
#define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost
|
|
#define cudaDeviceSynchronize hipDeviceSynchronize
|
|
#define cudaGetErrorString hipGetErrorString
|
|
#define cudaGetLastError hipGetLastError
|
|
#define cudaMemGetInfo hipMemGetInfo
|
|
#define cudaDeviceReset hipDeviceReset
|
|
#define __global__ __global__
|
|
#define __device__ __device__
|
|
#define __host__ __host__
|
|
#define __shared__ __shared__
|
|
#define __syncthreads __syncthreads
|
|
#define blockIdx hipBlockIdx_x
|
|
#define threadIdx hipThreadIdx_x
|
|
#define blockDim hipBlockDim_x
|
|
#define gridDim hipGridDim_x
|
|
#define hipLaunchKernelGGL(F,GRID,BLOCK,SHMEM,STREAM,...) \
|
|
hipLaunchKernelGGL(F, dim3(GRID), dim3(BLOCK), SHMEM, STREAM, __VA_ARGS__)
|
|
#endif
|