Skip to content

Commit 05c792e

Browse files
committed
initialize rocblas
1 parent ade68d0 commit 05c792e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ggml-cuda.cu

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <hip/hip_runtime.h>
1010
#include <hipblas/hipblas.h>
1111
#include <hip/hip_fp16.h>
12+
#include "rocblas/rocblas.h"
1213
#define CUBLAS_COMPUTE_32F HIPBLAS_R_32F
1314
#define CUBLAS_COMPUTE_32F_FAST_16F HIPBLAS_R_32F
1415
#define CUBLAS_GEMM_DEFAULT HIPBLAS_GEMM_DEFAULT
@@ -2554,6 +2555,11 @@ void ggml_init_cublas() {
25542555
static bool initialized = false;
25552556

25562557
if (!initialized) {
2558+
#ifdef GGML_USE_HIPBLAS
2559+
rocblas_initialize();
2560+
hipDeviceSynchronize();
2561+
fprintf(stderr, "hipBLAS INITIALIZED\n");
2562+
#endif
25572563
CUDA_CHECK(cudaGetDeviceCount(&g_device_count));
25582564
GGML_ASSERT(g_device_count <= GGML_CUDA_MAX_DEVICES);
25592565
int64_t total_vram = 0;

0 commit comments

Comments
 (0)