Skip to content

Commit

Permalink
cublas: remove usage of new APIs if we compile for CUDA 10
Browse files Browse the repository at this point in the history
Signed-off-by: Niklas Eiling <[email protected]>
  • Loading branch information
n-eiling committed Jul 13, 2023
1 parent 481dec9 commit fbf7dad
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpu/cpu-server-cublas.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ bool_t rpc_cublassetworkspace_1_svc(ptr handle, ptr workspace, size_t workspaceS
RECORD_NARG(workspaceSizeInBytes);
LOGE(LOG_DEBUG, "%s", __FUNCTION__);
GSCHED_RETAIN;
#if CUBLAS_VERSION >= 11000
*result = cublasSetWorkspace(
resource_mg_get(&rm_cublas, (void*)handle),
resource_mg_get(&rm_memory, (void*)workspace),
workspaceSizeInBytes);
#else
LOGE(LOG_ERROR, "cublassetworkspace not supported in this version");
*result = -1;
#endif
GSCHED_RELEASE;
RECORD_RESULT(integer, *result);
return 1;
Expand Down Expand Up @@ -171,6 +176,7 @@ bool_t rpc_cublassgemm_1_svc(ptr handle, int transa, int transb, int m, int n, i
RECORD_ARG(14, ldc);
LOGE(LOG_DEBUG, "cublasSgemm");
GSCHED_RETAIN;
#if CUBLAS_VERSION >= 11000
*result = cublasSgemm(resource_mg_get(&rm_cublas, (void*)handle),
(cublasOperation_t) transa,
(cublasOperation_t) transb,
Expand All @@ -179,6 +185,10 @@ bool_t rpc_cublassgemm_1_svc(ptr handle, int transa, int transb, int m, int n, i
resource_mg_get(&rm_memory, (void*)B), ldb, &beta,
resource_mg_get(&rm_memory, (void*)C), ldc
);
#else
LOGE(LOG_ERROR, "cublassetworkspace not supported in this version");
*result = -1;
#endif
GSCHED_RELEASE;
RECORD_RESULT(integer, *result);
return 1;
Expand Down

0 comments on commit fbf7dad

Please sign in to comment.