Skip to content

Commit 893b4d5

Browse files
committed
use an explicit local work size
1 parent 5653136 commit 893b4d5

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

samples/21_multithreading/main.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,18 @@ static void ThreadFunc(
6363
kernel,
6464
cl::NullRange,
6565
cl::NDRange{1},
66-
cl::NullRange,
66+
cl::NDRange{1},
6767
nullptr,
6868
&event );
6969
} else {
7070
commandQueue.enqueueNDRangeKernel(
7171
kernel,
7272
cl::NullRange,
7373
cl::NDRange{1},
74-
cl::NullRange );
74+
cl::NDRange{1} );
7575
}
7676
++expected;
7777
} else if (r < 80) {
78-
// 10% probability: flush the queue.
79-
commandQueue.flush();
80-
} else if (r < 90) {
81-
// 10% probability: finish the queue.
82-
commandQueue.finish();
83-
} else {
8478
// 10% probability: read and check the result.
8579
cl_uint result = 0;
8680
commandQueue.enqueueReadBuffer(
@@ -95,6 +89,12 @@ static void ThreadFunc(
9589
threadId, checks, expected, result);
9690
quiet = true;
9791
}
92+
} else if (r < 90) {
93+
// 10% probability: finish the queue.
94+
commandQueue.finish();
95+
} else {
96+
// 10% probability: flush the queue.
97+
commandQueue.flush();
9898
}
9999
}
100100

0 commit comments

Comments
 (0)