diff --git a/src/TNL/Devices/Cuda.cpp b/src/TNL/Devices/Cuda.cpp index 64a7ee1e9fe9bf0d45b2fe57110accaa212848d8..2c8f85aeca4c1fc27a76c14115c7e29cda8c4251 100644 --- a/src/TNL/Devices/Cuda.cpp +++ b/src/TNL/Devices/Cuda.cpp @@ -41,6 +41,7 @@ int Cuda::getNumberOfGrids( const int blocks, void Cuda::configSetup( Config::ConfigDescription& config, const String& prefix ) { +// FIXME: HAVE_CUDA is never defined in .cpp files #ifdef HAVE_CUDA config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device to run the computation.", 0 ); #else @@ -51,8 +52,9 @@ void Cuda::configSetup( Config::ConfigDescription& config, bool Cuda::setup( const Config::ParameterContainer& parameters, const String& prefix ) { +// FIXME: HAVE_CUDA is never defined in .cpp files #ifdef HAVE_CUDA - int cudaDevice = parameters.getParameter< int >( "cuda-device" ); + int cudaDevice = parameters.getParameter< int >( prefix + "cuda-device" ); if( cudaSetDevice( cudaDevice ) != cudaSuccess ) { std::cerr << "I cannot activate CUDA device number " << cudaDevice << "." << std::endl; diff --git a/src/TNL/Devices/Cuda.cu b/src/TNL/Devices/Cuda.cu index 21fbfdc1fc4e7de63f237b1e35ce8670f51fe137..d2ac6e6b6dc9fc3854a7c48c5b9b2eec7da79897 100644 --- a/src/TNL/Devices/Cuda.cu +++ b/src/TNL/Devices/Cuda.cu @@ -15,27 +15,6 @@ namespace TNL { namespace Devices { -/*void Cuda::configSetup( tnlConfigDescription& config, const String& prefix ) -{ -#ifdef HAVE_CUDA - config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device.", 0 ); -#else - config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device (CUDA is not supported on this system).", 0 ); -#endif -} - -bool Cuda::setup( const tnlParameterContainer& parameters, - const String& prefix ) -{ - int cudaDevice = parameters.getParameter< int >( prefix + "cuda-device" ); -#ifdef HAVE_CUDA - cudaSetDevice( cudaDevice ); - checkCudaDevice; -#endif - return true; -} -*/ - bool Cuda::checkDevice( const char* file_name, int line, cudaError error ) { if( error == cudaSuccess )