Skip to content

Commit

Permalink
Merge branch '49-cublas-device-code' into 'master'
Browse files Browse the repository at this point in the history
Fix cublas link

See merge request mutsuki/CULiP!51
  • Loading branch information
enp1s0 committed Sep 25, 2023
2 parents 8654293 + 635d768 commit 8527da1
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cublas.cu
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <cublas.h>
#include <cublas_v2.h>
#include <iostream>
#include <stdlib.h>
Expand Down Expand Up @@ -256,6 +255,9 @@ cublasStatus_t cublasGemmEx(cublasHandle_t handle, cublasOperation_t transa,
void *C, cudaDataType_t Ctype, int ldc,
cublasComputeType_t computeType,
cublasGemmAlgo_t algo) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int cutoff_flag = (CULiP_profiling_control_array[CULiP_cublasGemmEx] == 0) && CULiP_is_profiling_enabled(CULIP_CUTOFF_THRESHOLD_ENV_NAME, false);
if (cutoff_flag) {
double threshold;
Expand Down Expand Up @@ -326,6 +328,7 @@ cublasStatus_t cublasGemmEx(cublasHandle_t handle, cublasOperation_t transa,
}

return result;
#endif
}

// -------------------------------------------------
Expand Down Expand Up @@ -397,6 +400,9 @@ cublasStatus_t cublasGemmBatchedEx(cublasHandle_t handle,
int batchCount,
cublasComputeType_t computeType,
cublasGemmAlgo_t algo) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULiP_cublasGemmBatchedEx] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -435,6 +441,7 @@ cublasStatus_t cublasGemmBatchedEx(cublasHandle_t handle,
}

return result;
#endif
}

// -------------------------------------------------
Expand Down Expand Up @@ -509,6 +516,9 @@ cublasStatus_t cublasGemmStridedBatchedEx(cublasHandle_t handle,
int batchCount,
cublasComputeType_t computeType,
cublasGemmAlgo_t algo) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int cutoff_flag = (CULiP_profiling_control_array[CULiP_cublasGemmStridedBatchedEx] == 0) && CULiP_is_profiling_enabled(CULIP_CUTOFF_THRESHOLD_ENV_NAME, false);
if (cutoff_flag) {
double threshold;
Expand Down Expand Up @@ -583,6 +593,7 @@ cublasStatus_t cublasGemmStridedBatchedEx(cublasHandle_t handle,
}

return result;
#endif
}

// -------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions src/cublas.gbmv.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *x, int incx, const CULIP_TYPE *beta, CULIP_TYPE *y,
int incy) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.gemm.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle, cublasOperation_t transa,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *B, int ldb, const CULIP_TYPE *beta, CULIP_TYPE *C,
int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int cutoff_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUTOFF_THRESHOLD_ENV_NAME, false);
if (cutoff_flag) {
double threshold;
Expand Down Expand Up @@ -68,4 +71,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle, cublasOperation_t transa,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.gemm_batched.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ cublasStatus_t CULIP_FUNC_NAME (cublasHandle_t handle,
CULIP_TYPE *const Carray[],
int ldc,
int batchCount) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -46,4 +49,5 @@ cublasStatus_t CULIP_FUNC_NAME (cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.gemm_strided_batched.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ cublasStatus_t CULIP_FUNC_NAME (cublasHandle_t handle,
int ldc,
long long int strideC,
int batchCount) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int cutoff_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUTOFF_THRESHOLD_ENV_NAME, false);
if (cutoff_flag) {
double threshold;
Expand Down Expand Up @@ -85,4 +88,5 @@ cublasStatus_t CULIP_FUNC_NAME (cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.gemv.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *x, int incx, const CULIP_TYPE *beta, CULIP_TYPE *y,
int incy) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.ger.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *y, int incy,
CULIP_TYPE* A, int lda
) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -38,4 +41,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.hemm.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *B, int ldb, const CULIP_TYPE *beta, CULIP_TYPE *C,
int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -37,4 +40,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.her2k.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *B, int ldb,
const CULIP_REAL_TYPE *beta,
CULIP_TYPE *C, int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -39,4 +42,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.herk.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
int n, int k,
const CULIP_REAL_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_REAL_TYPE *beta, CULIP_TYPE *C, int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.sbmv.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *x, int incx, const CULIP_TYPE *beta, CULIP_TYPE *y,
int incy) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.spmv.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *AP,
const CULIP_TYPE *x, int incx, const CULIP_TYPE *beta, CULIP_TYPE *y,
int incy) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.symm.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle, cublasSideMode_t side,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *B, int ldb, const CULIP_TYPE *beta, CULIP_TYPE *C,
int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -36,4 +39,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle, cublasSideMode_t side,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.syr2k.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *B, int ldb,
const CULIP_TYPE *beta, CULIP_TYPE *C, int ldc
) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -39,4 +42,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.syrk.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha, const CULIP_TYPE *A, int lda,
const CULIP_TYPE *beta, CULIP_TYPE *C, int ldc
) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -37,4 +40,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.trmm.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *A, int lda,
const CULIP_TYPE *B, int ldb,
CULIP_TYPE *C , int ldc) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -46,4 +49,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.trsm.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *alpha,
const CULIP_TYPE *A, int lda,
CULIP_TYPE *B , int ldb) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -45,4 +48,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}
4 changes: 4 additions & 0 deletions src/cublas.trsmBatched.template.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
const CULIP_TYPE *const A[], int lda,
CULIP_TYPE *const B[] , int ldb,
int batchCount) {
#ifdef __CUDA_ARCH__
return CUBLAS_STATUS_NOT_SUPPORTED;
#else
const int profiling_flag = (CULiP_profiling_control_array[CULIP_FUNC_ENUM_NAME] == 0) && CULiP_is_profiling_enabled(CULIP_CUBLAS_DISABLE_ENV_NAME);

// Get the function pointer
Expand Down Expand Up @@ -47,4 +50,5 @@ cublasStatus_t CULIP_FUNC_NAME(cublasHandle_t handle,
}

return result;
#endif
}

0 comments on commit 8527da1

Please sign in to comment.