Skip to content

Commit

Permalink
add dev_barrier to help with testing
Browse files Browse the repository at this point in the history
  • Loading branch information
cjknight committed Jun 1, 2024
1 parent 456d484 commit 6e9e527
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gpu/src/pm_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ void PM::dev_check_pointer(int rnk, const char * name, void * ptr)
#endif
}

void PM::dev_barrier()
{
#ifdef _DEBUG_PM
printf("Inside PM::dev_barrier()\n");
#endif

cudaDeviceSynchronize();
_CUDA_CHECK_ERRORS();

#ifdef _DEBUG_PM
printf(" -- Leaving PM::dev_barrier()\n");
#endif
}

void PM::dev_stream_create(cudaStream_t & s)
{
#ifdef _DEBUG_PM
Expand Down
2 changes: 2 additions & 0 deletions gpu/src/pm_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ namespace PM_NS {
void dev_pull(void*, void*, size_t);
void dev_copy(void*, void*, size_t);

void dev_barrier();

// specific to cuda

int dev_push_async(void * d_ptr, void * h_ptr, size_t N, cudaStream_t &s);
Expand Down

0 comments on commit 6e9e527

Please sign in to comment.