Skip to content

Commit

Permalink
nbody: use int iterator when dealing with g_numGPUs
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
  • Loading branch information
tycho committed Mar 10, 2014
1 parent 61b7a3c commit 92a0cc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nbody/nbody.cu
Original file line number Diff line number Diff line change
Expand Up @@ -611,19 +611,19 @@ main( int argc, char *argv[] )

if ( g_numGPUs ) {
g_GPUThreadPool = new workerThread[g_numGPUs];
for ( size_t i = 0; i < g_numGPUs; i++ ) {
for ( int i = 0; i < g_numGPUs; i++ ) {
if ( ! g_GPUThreadPool[i].initialize( ) ) {
fprintf( stderr, "Error initializing thread pool\n" );
return 1;
}
}
for ( size_t i = 0; i < g_numGPUs; i++ ) {
gpuInit_struct initGPU = {(int)i};
for ( int i = 0; i < g_numGPUs; i++ ) {
gpuInit_struct initGPU = {i};
g_GPUThreadPool[i].delegateSynchronous(
initializeGPU,
&initGPU );
if ( cudaSuccess != initGPU.status ) {
fprintf( stderr, "Initializing GPU %zu failed "
fprintf( stderr, "Initializing GPU %d failed "
" with %d (%s)\n",
i,
initGPU.status,
Expand Down

0 comments on commit 92a0cc1

Please sign in to comment.