Skip to content

Commit faf5d06

Browse files
committed
pf_cudamalloc.ch: CUDAERRCHK -> CUDA_ERR
1 parent 8afd611 commit faf5d06

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

pfsimulator/parflow_lib/pf_cudamalloc.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@
5454
#define MemPrefetchDeviceToHost_cuda(ptr, size, stream) \
5555
{ \
5656
int deviceIndex; \
57-
CUDA_ERRCHK(cudaGetDevice(&deviceIndex)); \
57+
CUDA_ERR(cudaGetDevice(&deviceIndex)); \
5858
struct cudaMemLocation location = {}; \
5959
location.type = cudaMemLocationTypeHost; \
6060
location.id = deviceIndex; \
61-
CUDA_ERRCHK(cudaMemPrefetchAsync(ptr, size, location, 0 , 0)); \
61+
CUDA_ERR(cudaMemPrefetchAsync(ptr, size, location, 0 , 0)); \
62+
CUDA_ERR(cudaStreamSynchronize(stream)); \
6263
}
6364
#define MemPrefetchHostToDevice_cuda(ptr, size, stream) \
6465
{ \
6566
int deviceIndex; \
66-
CUDA_ERRCHK(cudaGetDevice(&deviceIndex)); \
67+
CUDA_ERR(cudaGetDevice(&deviceIndex)); \
6768
struct cudaMemLocation location = {}; \
6869
location.type = cudaMemLocationTypeDevice; \
6970
location.id = deviceIndex; \
70-
CUDA_ERRCHK(cudaMemPrefetchAsync(ptr, size, location, 0 , 0)); \
71+
CUDA_ERR(cudaMemPrefetchAsync(ptr, size, location, 0 , 0)); \
7172
}
7273
#else
73-
7474
#define MemPrefetchDeviceToHost_cuda(ptr, size, stream) \
7575
{ \
7676
CUDA_ERR(cudaMemPrefetchAsync(ptr, size, cudaCpuDeviceId, stream)); \
@@ -83,5 +83,4 @@
8383
CUDA_ERR(cudaMemPrefetchAsync(ptr, size, device, stream)); \
8484
}
8585
#endif
86-
8786
#endif // PF_CUDAMALLOC_H

0 commit comments

Comments
 (0)