amd gpu scalffold

This commit is contained in:
Dobromir Popov
2025-09-05 03:36:28 +03:00
parent db60983796
commit f5b05ce531
9 changed files with 2181 additions and 0 deletions

View 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