Skip to content

Commit fe56b36

Browse files
authored
Merge pull request #897 from eth-cscs/fix_array
Fix openacc_cuda_mpi_cppstd.F90
2 parents 0ff8fea + d423929 commit fe56b36

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cscs-checks/mch/src/compute_cuda.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ void cuda_kernel_no_copy(float* a, float* b, int n)
2828
const int THREADS_PER_BLOCK = 1;
2929
const int NUMBER_OF_BLOCKS = 10;
3030

31-
cudaThreadSynchronize();
31+
cudaDeviceSynchronize();
3232
simple_add<<<NUMBER_OF_BLOCKS, THREADS_PER_BLOCK>>>(a, b, n);
33-
cudaThreadSynchronize();
33+
cudaDeviceSynchronize();
3434

3535
cudaCheckErrors("cuda error");
3636
}
@@ -47,9 +47,9 @@ void cuda_kernel_with_copy(float* a, float* b, int n)
4747
cudaMemcpy(d_a, a, n*sizeof(float), cudaMemcpyHostToDevice);
4848
cudaMemcpy(d_b, b, n*sizeof(float), cudaMemcpyHostToDevice);
4949

50-
cudaThreadSynchronize();
50+
cudaDeviceSynchronize();
5151
simple_add<<<NUMBER_OF_BLOCKS, THREADS_PER_BLOCK>>>(d_a, d_b, n);
52-
cudaThreadSynchronize();
52+
cudaDeviceSynchronize();
5353

5454
cudaMemcpy(a, d_a, n*sizeof(float), cudaMemcpyDeviceToHost);
5555

cscs-checks/mch/src/openacc_cuda_mpi_cppstd.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ program openacc_cuda_mpi_cppstd
7474
if (sum(f1) /= EXPECTED_CUDA_SUM) then
7575
write (*,*) "Result : FAIL"
7676
write (*,*) "Expected value sum(f1): ", EXPECTED_CUDA_SUM, "actual value:", sum(f1)
77-
else if (sum(f3) /= EXPECTED_CPP_STD_SUM) then
77+
else if (sum(f3) /= EXPECTED_CUDA_SUM) then
7878
write (*,*) "Result : FAIL"
79-
write (*,*) "Expected value sum(f3): ", EXPECTED_CPP_STD_SUM, "actual value:", sum(f3)
79+
write (*,*) "Expected value sum(f3): ", EXPECTED_CUDA_SUM, "actual value:", sum(f3)
8080
else if (data_sum(1) /= ref_val) then
8181
write (*,*) "Result : FAIL"
8282
write (*,*) "Expected value data_sum: ", ref_val, "actual value:", data_sum(1)

0 commit comments

Comments
 (0)