From 48c346adfec9718edd68af5dc842b56979bdf283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Sun, 20 Nov 2016 09:33:33 +0100 Subject: [PATCH] Added FIXME notes to Cuda::configSetup and Cuda::setup --- src/TNL/Devices/Cuda.cpp | 4 +++- src/TNL/Devices/Cuda.cu | 21 --------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/TNL/Devices/Cuda.cpp b/src/TNL/Devices/Cuda.cpp index 64a7ee1e9f..2c8f85aeca 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 21fbfdc1fc..d2ac6e6b6d 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 ) -- GitLab