Skip to content
Snippets Groups Projects
Commit 48c346ad authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added FIXME notes to Cuda::configSetup and Cuda::setup

parent f1d4780a
No related branches found
No related tags found
No related merge requests found
...@@ -41,6 +41,7 @@ int Cuda::getNumberOfGrids( const int blocks, ...@@ -41,6 +41,7 @@ int Cuda::getNumberOfGrids( const int blocks,
void Cuda::configSetup( Config::ConfigDescription& config, void Cuda::configSetup( Config::ConfigDescription& config,
const String& prefix ) const String& prefix )
{ {
// FIXME: HAVE_CUDA is never defined in .cpp files
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device to run the computation.", 0 ); config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device to run the computation.", 0 );
#else #else
...@@ -51,8 +52,9 @@ void Cuda::configSetup( Config::ConfigDescription& config, ...@@ -51,8 +52,9 @@ void Cuda::configSetup( Config::ConfigDescription& config,
bool Cuda::setup( const Config::ParameterContainer& parameters, bool Cuda::setup( const Config::ParameterContainer& parameters,
const String& prefix ) const String& prefix )
{ {
// FIXME: HAVE_CUDA is never defined in .cpp files
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
int cudaDevice = parameters.getParameter< int >( "cuda-device" ); int cudaDevice = parameters.getParameter< int >( prefix + "cuda-device" );
if( cudaSetDevice( cudaDevice ) != cudaSuccess ) if( cudaSetDevice( cudaDevice ) != cudaSuccess )
{ {
std::cerr << "I cannot activate CUDA device number " << cudaDevice << "." << std::endl; std::cerr << "I cannot activate CUDA device number " << cudaDevice << "." << std::endl;
......
...@@ -15,27 +15,6 @@ ...@@ -15,27 +15,6 @@
namespace TNL { namespace TNL {
namespace Devices { 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 ) bool Cuda::checkDevice( const char* file_name, int line, cudaError error )
{ {
if( error == cudaSuccess ) if( error == cudaSuccess )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment