Skip to content

Commit 44b82a8

Browse files
authored
[SYCL] Fix 5_GPU_optimized sample (#2686)
1 parent ffc4fce commit 44b82a8

File tree

1 file changed

+4
-0
lines changed
  • DirectProgramming/C++SYCL/StructuredGrids/guided_iso3dfd_GPUOptimization/src

1 file changed

+4
-0
lines changed

DirectProgramming/C++SYCL/StructuredGrids/guided_iso3dfd_GPUOptimization/src/5_GPU_optimized.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ void iso3dfd(queue& q, float* next, float* prev, float* vel, float* coeff,
131131
next_acc[idx] = 2.0f * front[0] - next_acc[idx] +
132132
value * vel_acc[idx];
133133

134+
// Don't prepare data for the next iteration if this is the last one.
135+
if (i == end_i - 1)
136+
break;
137+
134138
// Increase linear index, jump to the next cell in first dimension
135139
idx += n2n3;
136140

0 commit comments

Comments
 (0)