|
5 | 5 | #include <atomic>
|
6 | 6 |
|
7 | 7 | #if defined(GGML_USE_HIPBLAS)
|
8 |
| -#include "hip/hip_runtime.h" |
9 |
| -#include "hipblas/hipblas.h" |
10 |
| -#include "hip/hip_fp16.h" |
| 8 | +#include <hip/hip_runtime.h> |
| 9 | +#include <hipblas/hipblas.h> |
| 10 | +#include <hip/hip_fp16.h> |
| 11 | +#define CUBLAS_COMPUTE_32F HIPBLAS_R_32F |
| 12 | +#define CUBLAS_COMPUTE_32F_FAST_16F HIPBLAS_R_32F |
| 13 | +#define CUBLAS_GEMM_DEFAULT HIPBLAS_GEMM_DEFAULT |
| 14 | +#define CUBLAS_OP_N HIPBLAS_OP_N |
| 15 | +#define CUBLAS_OP_T HIPBLAS_OP_T |
| 16 | +#define CUBLAS_STATUS_SUCCESS HIPBLAS_STATUS_SUCCESS |
| 17 | +#define CUBLAS_TF32_TENSOR_OP_MATH 0 |
| 18 | +#define CUDA_R_16F HIPBLAS_R_16F |
| 19 | +#define CUDA_R_32F HIPBLAS_R_32F |
| 20 | +#define cublasCreate hipblasCreate |
| 21 | +#define cublasGemmEx hipblasGemmEx |
| 22 | +#define cublasHandle_t hipblasHandle_t |
| 23 | +#define cublasSetMathMode(handle, mode) CUBLAS_STATUS_SUCCESS |
| 24 | +#define cublasSetStream hipblasSetStream |
| 25 | +#define cublasSgemm hipblasSgemm |
| 26 | +#define cublasStatus_t hipblasStatus_t |
| 27 | +#define cudaDeviceSynchronize hipDeviceSynchronize |
| 28 | +#define cudaError_t hipError_t |
| 29 | +#define cudaEventCreateWithFlags hipEventCreateWithFlags |
| 30 | +#define cudaEventDisableTiming hipEventDisableTiming |
| 31 | +#define cudaEventRecord hipEventRecord |
| 32 | +#define cudaEvent_t hipEvent_t |
| 33 | +#define cudaFree hipFree |
| 34 | +#define cudaFreeHost hipHostFree |
| 35 | +#define cudaGetErrorString hipGetErrorString |
| 36 | +#define cudaGetLastError hipGetLastError |
| 37 | +#define cudaMalloc hipMalloc |
| 38 | +#define cudaMallocHost(ptr, size) hipHostMalloc(ptr, size, hipHostMallocPortable) |
| 39 | +#define cudaMemcpy2DAsync hipMemcpy2DAsync |
| 40 | +#define cudaMemcpyAsync hipMemcpyAsync |
| 41 | +#define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost |
| 42 | +#define cudaMemcpyHostToDevice hipMemcpyHostToDevice |
| 43 | +#define cudaStreamCreateWithFlags hipStreamCreateWithFlags |
| 44 | +#define cudaStreamNonBlocking hipStreamNonBlocking |
| 45 | +#define cudaStreamSynchronize hipStreamSynchronize |
| 46 | +#define cudaStreamWaitEvent hipStreamWaitEvent |
| 47 | +#define cudaStream_t hipStream_t |
| 48 | +#define cudaSuccess hipSuccess |
11 | 49 | #else
|
12 | 50 | #include <cuda_runtime.h>
|
13 | 51 | #include <cublas_v2.h>
|
|
0 commit comments