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

Moved getFreeMemory from Cuda to CudaDeviceInfo

parent 14af6ad7
No related branches found
No related tags found
No related merge requests found
......@@ -38,11 +38,6 @@ int Cuda::getNumberOfGrids( const int blocks,
return roundUpDivision( blocks, gridSize );
}
/*size_t Cuda::getFreeMemory()
{
}*/
void Cuda::configSetup( Config::ConfigDescription& config,
const String& prefix )
{
......
......@@ -60,8 +60,6 @@ class Cuda
static int getNumberOfGrids( const int blocks,
const int gridSize = getMaxGridSize() );
static size_t getFreeMemory();
template< typename ObjectType >
static ObjectType* passToDevice( const ObjectType& object );
......
......@@ -64,6 +64,13 @@ getGlobalMemory( int deviceNum )
return 0;
}
size_t
CudaDeviceInfo::
getFreeGlobalMemory()
{
return 0;
}
int
CudaDeviceInfo::
getMemoryClockRate( int deviceNum )
......
......@@ -81,6 +81,16 @@ getGlobalMemory( int deviceNum )
return properties.totalGlobalMem;
}
size_t
CudaDeviceInfo::
getFreeGlobalMemory()
{
size_t free = 0;
size_t total = 0;
cudaMemGetInfo( &free, &total );
return free;
}
int
CudaDeviceInfo::
getMemoryClockRate( int deviceNum )
......
......@@ -34,6 +34,8 @@ class CudaDeviceInfo
static size_t getGlobalMemory( int deviceNum );
static size_t getFreeGlobalMemory();
static int getMemoryClockRate( int deviceNum );
static bool getECCEnabled( int deviceNum );
......
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