Skip to content

Commit

Permalink
initialize rocblas
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowRoseCx committed Jul 24, 2023
1 parent ade68d0 commit 05c792e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ggml-cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <hip/hip_runtime.h>
#include <hipblas/hipblas.h>
#include <hip/hip_fp16.h>
#include "rocblas/rocblas.h"
#define CUBLAS_COMPUTE_32F HIPBLAS_R_32F
#define CUBLAS_COMPUTE_32F_FAST_16F HIPBLAS_R_32F
#define CUBLAS_GEMM_DEFAULT HIPBLAS_GEMM_DEFAULT
Expand Down Expand Up @@ -2554,6 +2555,11 @@ void ggml_init_cublas() {
static bool initialized = false;

if (!initialized) {
#ifdef GGML_USE_HIPBLAS
rocblas_initialize();
hipDeviceSynchronize();
fprintf(stderr, "hipBLAS INITIALIZED\n");
#endif
CUDA_CHECK(cudaGetDeviceCount(&g_device_count));
GGML_ASSERT(g_device_count <= GGML_CUDA_MAX_DEVICES);
int64_t total_vram = 0;
Expand Down

0 comments on commit 05c792e

Please sign in to comment.