amd gpu scalffold
This commit is contained in:
29
rin/miner/gpu/RinHash-hip/hip_runtime_shim.h
Normal file
29
rin/miner/gpu/RinHash-hip/hip_runtime_shim.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user