Skip to content

Commit de1a9b9

Browse files
committed
mtgpu: enable unified memory
Signed-off-by: Xiaodong Ye <[email protected]>
1 parent 2bd4cec commit de1a9b9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ggml/src/ggml-cuda.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static cudaError_t ggml_cuda_device_malloc(void ** ptr, size_t size, int device)
133133
return res;
134134
#else
135135

136-
#if !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA)
136+
#if !defined(GGML_USE_HIPBLAS)
137137
cudaError_t err;
138138
if (getenv("GGML_CUDA_ENABLE_UNIFIED_MEMORY") != nullptr)
139139
{
@@ -146,7 +146,7 @@ static cudaError_t ggml_cuda_device_malloc(void ** ptr, size_t size, int device)
146146
return err;
147147
#else
148148
return cudaMalloc(ptr, size);
149-
#endif // !defined(GGML_USE_HIPBLAS) && !defined(GGML_USE_MUSA)
149+
#endif // !defined(GGML_USE_HIPBLAS)
150150

151151
#endif
152152
}

ggml/src/ggml-cuda/vendors/musa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define cudaLaunchHostFunc musaLaunchHostFunc
5757
#define cudaMalloc musaMalloc
5858
#define cudaMallocHost musaMallocHost
59+
#define cudaMallocManaged musaMallocManaged
5960
#define cudaMemcpy musaMemcpy
6061
#define cudaMemcpyAsync musaMemcpyAsync
6162
#define cudaMemcpyPeerAsync musaMemcpyPeerAsync

0 commit comments

Comments
 (0)