Rename macro ENABLE_CUBLAS to ENABLE_CUDA.

This commit is contained in:
Ye Luo 2019-03-12 18:43:48 -05:00
parent bc34319f76
commit 13aaeb4715
8 changed files with 17 additions and 17 deletions

View File

@ -140,7 +140,7 @@ SET(QMC_OMP 1 CACHE BOOL "Enable/disable OpenMP")
SET(QMC_COMPLEX 0 CACHE INTEGER "Build for complex binary") SET(QMC_COMPLEX 0 CACHE INTEGER "Build for complex binary")
SET(PRINT_DEBUG 0 CACHE BOOL "Enable/disable debug printing") SET(PRINT_DEBUG 0 CACHE BOOL "Enable/disable debug printing")
SET(QMC_CUDA 0 CACHE BOOL "Build with GPU support through CUDA") SET(QMC_CUDA 0 CACHE BOOL "Build with GPU support through CUDA")
SET(ENABLE_CUBLAS 0 CACHE BOOL "Build with the second generation of GPU support through CUDA") SET(ENABLE_CUDA 0 CACHE BOOL "Build with the second generation of GPU support through CUDA")
SET(ENABLE_SOA 0 CACHE BOOL "Enable/disable SoA optimization") SET(ENABLE_SOA 0 CACHE BOOL "Enable/disable SoA optimization")
###################################################################### ######################################################################
@ -652,7 +652,7 @@ ELSE()
ENDIF() ENDIF()
SET(HAVE_CUDA 0) SET(HAVE_CUDA 0)
IF(QMC_CUDA OR ENABLE_CUBLAS) IF(QMC_CUDA OR ENABLE_CUDA)
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CUDA_PROPAGATE_HOST_FLAGS ON) set(CUDA_PROPAGATE_HOST_FLAGS ON)
ELSE(CMAKE_CXX_COMPILER_ID MATCHES "Clang") ELSE(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@ -683,9 +683,9 @@ IF(QMC_CUDA OR ENABLE_CUBLAS)
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS})
set(HAVE_CUDA 1) set(HAVE_CUDA 1)
MESSAGE(" CUDA_NVCC_FLAGS=${CUDA_NVCC_FLAGS}") MESSAGE(" CUDA_NVCC_FLAGS=${CUDA_NVCC_FLAGS}")
ELSE(QMC_CUDA OR ENABLE_CUBLAS) ELSE(QMC_CUDA OR ENABLE_CUDA)
MESSAGE(STATUS "Disabling CUDA") MESSAGE(STATUS "Disabling CUDA")
ENDIF(QMC_CUDA OR ENABLE_CUBLAS) ENDIF(QMC_CUDA OR ENABLE_CUDA)
SET(USE_NVTX_API 0 CACHE BOOL "Enable/disable NVTX regions in CUDA code.") SET(USE_NVTX_API 0 CACHE BOOL "Enable/disable NVTX regions in CUDA code.")
IF(USE_NVTX_API) IF(USE_NVTX_API)

View File

@ -38,7 +38,7 @@
#include "QMCDrivers/QMCDriver.h" #include "QMCDrivers/QMCDriver.h"
#include "Message/Communicate.h" #include "Message/Communicate.h"
#include "Message/OpenMP.h" #include "Message/OpenMP.h"
#ifdef ENABLE_CUBLAS #ifdef ENABLE_CUDA
#include <cuda_runtime_api.h> #include <cuda_runtime_api.h>
#endif #endif
#include <queue> #include <queue>
@ -121,7 +121,7 @@ QMCMain::QMCMain(Communicate* c)
app_summary() << std::endl; app_summary() << std::endl;
app_summary().flush(); app_summary().flush();
#ifdef ENABLE_CUBLAS #ifdef ENABLE_CUDA
// force the initialization of CUDA // force the initialization of CUDA
// This is only a temporal solution and more rigorous intialization of accelerators will replace the current hack // This is only a temporal solution and more rigorous intialization of accelerators will replace the current hack
cudaFree(0); cudaFree(0);

View File

@ -200,9 +200,9 @@ SET(FERMION_SRCS ${FERMION_SRCS}
WaveFunctionFactory.cpp WaveFunctionFactory.cpp
) )
IF(ENABLE_CUBLAS) IF(ENABLE_CUDA)
SET(FERMION_SRCS ${FERMION_SRCS} Fermion/delayed_update_helper.cu) SET(FERMION_SRCS ${FERMION_SRCS} Fermion/delayed_update_helper.cu)
ENDIF(ENABLE_CUBLAS) ENDIF(ENABLE_CUDA)
IF(NOT QMC_COMPLEX AND NOT ENABLE_SOA) IF(NOT QMC_COMPLEX AND NOT ENABLE_SOA)
SET(FERMION_SRCS ${FERMION_SRCS} SET(FERMION_SRCS ${FERMION_SRCS}
@ -213,11 +213,11 @@ ENDIF(NOT QMC_COMPLEX AND NOT ENABLE_SOA)
#################################### ####################################
# create libqmcwfs # create libqmcwfs
#################################### ####################################
IF(QMC_CUDA OR ENABLE_CUBLAS) IF(QMC_CUDA OR ENABLE_CUDA)
CUDA_ADD_LIBRARY(qmcwfs ${WFBASE_SRCS} ${JASTROW_SRCS} ${FERMION_SRCS}) CUDA_ADD_LIBRARY(qmcwfs ${WFBASE_SRCS} ${JASTROW_SRCS} ${FERMION_SRCS})
ELSE(QMC_CUDA OR ENABLE_CUBLAS) ELSE(QMC_CUDA OR ENABLE_CUDA)
ADD_LIBRARY(qmcwfs ${WFBASE_SRCS} ${JASTROW_SRCS} ${FERMION_SRCS}) ADD_LIBRARY(qmcwfs ${WFBASE_SRCS} ${JASTROW_SRCS} ${FERMION_SRCS})
ENDIF(QMC_CUDA OR ENABLE_CUBLAS) ENDIF(QMC_CUDA OR ENABLE_CUDA)
IF(HAVE_CUDA) IF(HAVE_CUDA)
CUDA_ADD_CUBLAS_TO_TARGET(qmcwfs) CUDA_ADD_CUBLAS_TO_TARGET(qmcwfs)

View File

@ -640,7 +640,7 @@ DiracDeterminant<DU_TYPE>::makeCopy(SPOSetPtr spo) const
typedef QMCTraits::ValueType ValueType; typedef QMCTraits::ValueType ValueType;
template class DiracDeterminant<DelayedUpdate<ValueType>>; template class DiracDeterminant<DelayedUpdate<ValueType>>;
#if defined(ENABLE_CUBLAS) #if defined(ENABLE_CUDA)
template class DiracDeterminant<DelayedUpdateCUDA<ValueType>>; template class DiracDeterminant<DelayedUpdateCUDA<ValueType>>;
#endif #endif

View File

@ -25,7 +25,7 @@
#include "QMCWaveFunctions/Fermion/DiracDeterminantBase.h" #include "QMCWaveFunctions/Fermion/DiracDeterminantBase.h"
#include "QMCWaveFunctions/Fermion/DiracMatrix.h" #include "QMCWaveFunctions/Fermion/DiracMatrix.h"
#include "QMCWaveFunctions/Fermion/DelayedUpdate.h" #include "QMCWaveFunctions/Fermion/DelayedUpdate.h"
#if defined(ENABLE_CUBLAS) #if defined(ENABLE_CUDA)
#include "QMCWaveFunctions/Fermion/DelayedUpdateCUDA.h" #include "QMCWaveFunctions/Fermion/DelayedUpdateCUDA.h"
#endif #endif

View File

@ -424,7 +424,7 @@ bool SlaterDetBuilder::putDeterminant(xmlNodePtr cur, int spin_group)
// whether to use an optimizable slater determinant // whether to use an optimizable slater determinant
std::string optimize("no"); std::string optimize("no");
#if defined(ENABLE_CUBLAS) #if defined(ENABLE_CUDA)
std::string useGPU("yes"); std::string useGPU("yes");
#else #else
std::string useGPU("no"); std::string useGPU("no");
@ -541,7 +541,7 @@ bool SlaterDetBuilder::putDeterminant(xmlNodePtr cur, int spin_group)
#endif #endif
} }
#endif #endif
#if defined(ENABLE_CUBLAS) #if defined(ENABLE_CUDA)
else if (useGPU == "yes") else if (useGPU == "yes")
{ {
app_log() << "Using DiracDeterminant with DelayedUpdateCUDA engine" << std::endl; app_log() << "Using DiracDeterminant with DelayedUpdateCUDA engine" << std::endl;

View File

@ -30,7 +30,7 @@ namespace qmcplusplus
{ {
typedef QMCTraits::ValueType ValueType; typedef QMCTraits::ValueType ValueType;
#ifdef ENABLE_CUBLAS #ifdef ENABLE_CUDA
typedef DiracDeterminant<DelayedUpdateCUDA<ValueType>> DetType; typedef DiracDeterminant<DelayedUpdateCUDA<ValueType>> DetType;
#else #else
typedef DiracDeterminant<DelayedUpdate<ValueType>> DetType; typedef DiracDeterminant<DelayedUpdate<ValueType>> DetType;

View File

@ -166,7 +166,7 @@
#cmakedefine QMC_CUDA @QMC_CUDA@ #cmakedefine QMC_CUDA @QMC_CUDA@
/* Using CUDA for GPU execution, next generation */ /* Using CUDA for GPU execution, next generation */
#cmakedefine ENABLE_CUBLAS @ENABLE_CUBLAS@ #cmakedefine ENABLE_CUDA @ENABLE_CUDA@
/* Setting base precision for CUDA kernels */ /* Setting base precision for CUDA kernels */
#cmakedefine CUDA_PRECISION @CUDA_PRECISION@ #cmakedefine CUDA_PRECISION @CUDA_PRECISION@