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

[WIP] Feature/magma free #1

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from
Draft
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
35 changes: 25 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ set(SOURCEFILES
GPU_loop_MultMat_setup.c
GPU_SVD_computeControlMatrix.c
GPUloadCmat.c
magma_compute_SVDpseudoInverse_SVD.c
magma_compute_SVDpseudoInverse.c
MatMatMult_testPseudoInverse.c
cusolver_compute_SVDpseudoInverse.c
cusolver_symmetrize.cu
MVM_CPU.c
printGPUMATMULTCONF.c
)
Expand All @@ -33,22 +32,40 @@ set(INCLUDEFILES
GPU_loop_MultMat_setup.h
GPU_SVD_computeControlMatrix.h
GPUloadCmat.h
magma_compute_SVDpseudoInverse_SVD.h
magma_compute_SVDpseudoInverse.h
MatMatMult_testPseudoInverse.h
cusolver_compute_SVDpseudoInverse.h
cusolver_symmetrize.h
MVM_CPU.h
printGPUMATMULTCONF.h
)

if(USE_CUDA)
enable_language(CUDA)
endif(USE_CUDA)

if(USE_MAGMA)
find_package(PkgConfig REQUIRED)
pkg_check_modules(MAGMA REQUIRED magma)

set(SOURCEFILES
${SOURCEFILES}
magma_compute_SVDpseudoInverse_SVD.c
magma_compute_SVDpseudoInverse.c
MatMatMult_testPseudoInverse.c
)

set(INCLUDEFILES
${INCLUDEFILES}
magma_compute_SVDpseudoInverse_SVD.h
magma_compute_SVDpseudoInverse.h
MatMatMult_testPseudoInverse.h
)
endif(USE_MAGMA)

# DEFAULT SETTINGS
# Do not change unless needed
# =====================================================================

project(lib_${LIBNAME}_project)
project(lib_${LIBNAME}_project C)

include_directories ("${PROJECT_SOURCE_DIR}/src")
include_directories ("${PROJECT_SOURCE_DIR}/..")
Expand Down Expand Up @@ -85,13 +102,11 @@ message("---- MAGMA_CFLAGS_OTHER = ${MAGMA_CFLAGS_OTHER}" )
target_include_directories(${LIBNAME} PUBLIC ${MAGMA_INCLUDE_DIRS})
target_link_directories(${LIBNAME} PUBLIC ${MAGMA_LIBRARY_DIRS})
target_link_libraries(${LIBNAME} PRIVATE ${MAGMA_LIBRARIES})
target_compile_options(${LIBNAME} PRIVATE ${MAGMA_CFLAGS_OTHER})
target_compile_options(${LIBNAME} PRIVATE $<$<COMPILE_LANGUAGE:C>:${MAGMA_CFLAGS_OTHER}>)
target_compile_options(${LIBNAME} PUBLIC -DHAVE_CUDA -DHAVE_MAGMA -DUSE_MAGMA)
#target_compile_options(${LIBNAME} PUBLIC -DHAVE_CUDA -DHAVE_MAGMA -DUSE_MAGMA)
endif(USE_MAGMA)



if(USE_QDWHPARTIAL)
message("---- QDWHPARTIAL_INCLUDE_PATH = ${QDWHPARTIAL_INCLUDE_PATH}")
message("---- QDWHPARTIAL_LIBRARIES = ${QDWHPARTIAL_LIBRARIES}" )
Expand Down
19 changes: 7 additions & 12 deletions cudacomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
#include "cudacomp_MVMextractModesLoop.h"
#include "cudacompinit.h"
#include "cudacomptest.h"
#include "cusolver_compute_SVDpseudoInverse.h"
#include "magma_compute_SVDpseudoInverse.h"
#include "magma_compute_SVDpseudoInverse_SVD.h"
#include "MatMatMult_testPseudoInverse.h"



// globals
// globals

imageID IDtimerinit = 0;
imageID IDtiming = -1; // index to image where timing should be written
Expand All @@ -47,6 +48,7 @@ int cuda_deviceCount;
GPUMATMULTCONF gpumatmultconf[20]; // supports up to 20 configurations per process
float cublasSgemv_alpha = 1.0;
float cublasSgemv_beta = 0.0;

#endif

#ifdef HAVE_MAGMA
Expand Down Expand Up @@ -97,13 +99,16 @@ static errno_t init_module_CLI()

cudacompinit_addCLIcmd();
cudacomptest_addCLIcmd();
cusolver_compute_SVDpseudoInverse_addCLIcmd();
#ifdef HAVE_MAGMA
MatMatMult_testPseudoInverse_addCLIcmd();
magma_compute_SVDpseudoInverse_addCLIcmd();
magma_compute_SVDpseudoInverse_SVD_addCLIcmd();
#endif // HAVE_MAGMA
Coeff2Map_Loop_addCLIcmd();
cudacomp_MVMextractModesLoop_addCLIcmd();

#endif
#endif // HAVE_CUDA
// add atexit functions here

return RETURN_SUCCESS;
Expand Down Expand Up @@ -385,13 +390,3 @@ int CUDACOMP_createModesLoop(const char *DMmodeval_stream, const char *DMmodes,


#endif










Loading