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

Fixed Cuda::getGlobalThreadIdx method

Fortunately it's not used anywhere at the moment...
parent eb23a501
No related branches found
No related tags found
No related merge requests found
......@@ -49,8 +49,9 @@ class Cuda
static inline constexpr int getGPUTransferBufferSize();
#ifdef HAVE_CUDA
template< typename Index >
__device__ static Index getGlobalThreadIdx( const Index gridIdx = 0 );
__device__ static inline int
getGlobalThreadIdx( const int gridIdx = 0,
const int gridSize = getMaxGridSize() );
#endif
static int getNumberOfBlocks( const int threads,
......@@ -111,7 +112,7 @@ class Cuda
*/
static bool checkDevice( const char* file_name, int line, cudaError error );
#else
static bool checkDevice() { return false;};
static bool checkDevice() { return false; };
#endif
static void configSetup( Config::ConfigDescription& config, const String& prefix = "" );
......@@ -132,8 +133,6 @@ class Cuda
protected:
static SmartPointersRegister smartPointersRegister;
};
#ifdef HAVE_CUDA
......
......@@ -49,10 +49,9 @@ inline constexpr int Cuda::getGPUTransferBufferSize()
}
#ifdef HAVE_CUDA
template< typename Index >
__device__ Index Cuda::getGlobalThreadIdx( const Index gridIdx )
__device__ inline int Cuda::getGlobalThreadIdx( const int gridIdx, const int gridSize )
{
return ( gridIdx * Cuda::getMaxGridSize() + blockIdx.x ) * blockDim.x + threadIdx.x;
return ( gridIdx * gridSize + blockIdx.x ) * blockDim.x + threadIdx.x;
}
#endif
......
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