Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaCUDA] Dont use both version of cublas (legacy or v2) #4274

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading