Skip to content

Commit

Permalink
[SofaCUDA] Dont use both version of cublas (legacy or v2) (#4274)
Browse files Browse the repository at this point in the history
use either cublasv2 or legacy, not both

Co-authored-by: erik pernod <[email protected]>
  • Loading branch information
fredroy and epernod authored Nov 8, 2023
1 parent 22d783b commit c00d082
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion applications/plugins/SofaCUDA/sofa/gpu/cuda/mycuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int mycudaInit(int device)
}


#ifdef SOFA_GPU_CUBLAS
#if defined(SOFA_GPU_CUBLAS) && !defined(SOFA_GPU_CUBLAS_V2)
cublasInit();
#endif
return 1;
Expand Down
7 changes: 5 additions & 2 deletions applications/plugins/SofaCUDA/sofa/gpu/cuda/mycuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
#include <string.h>

#ifdef SOFA_GPU_CUBLAS
#include <cublas.h>
#if __has_include(<cublas_v2.h>)
#define SOFA_GPU_CUBLAS_V2
#include <cublas_v2.h>
#else
#include <cublas.h>
#endif
#include <cusparse_v2.h>
#endif

Expand Down Expand Up @@ -88,7 +92,6 @@ extern "C" {
extern cusparseMatDescr_t SOFA_GPU_CUDA_API getCusparseMatGeneralDescr();
extern cusparseMatDescr_t SOFA_GPU_CUDA_API getCusparseMatTriangularUpperDescr();
extern cusparseMatDescr_t SOFA_GPU_CUDA_API getCusparseMatTriangularLowerDescr();

#endif

#if defined(NDEBUG) && !defined(CUDA_DEBUG)
Expand Down

0 comments on commit c00d082

Please sign in to comment.