mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
cl20: Khronos Bug 16235: Allow the barrier test to pass in isolation (#262)
The input buffer to tests in execute_block suite is set to some value (0xdeadbeef) but supposed to be reset in each test such so that observing 0 after executing the test guarantees that the status is that of the test and not a pre-existing value. This commit adds missing initialisation to block_barrier kernel code and removes an extra redundant barrier at the end. This test is the last in the suite. After executing other tests the input/output buffer is not being reset on a host side and therefore running the test after successful execution of the previous test (resulting in writing expected 0 into the buffer) was hiding the problem. Change-Id: Ia9310d095993703c32ee1f664aed9ff72b26367a Signed-off-by: Anastasia Stulova <anastasia.stulova@arm.com> Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
@@ -928,15 +928,16 @@ static const char* block_barrier[] =
|
|||||||
NL, " size_t gid = get_group_id(0);"
|
NL, " size_t gid = get_group_id(0);"
|
||||||
NL, " size_t idx = gid*lsz;"
|
NL, " size_t idx = gid*lsz;"
|
||||||
NL, ""
|
NL, ""
|
||||||
|
NL, " res[tid]=lsz;"
|
||||||
|
NL, " barrier(CLK_GLOBAL_MEM_FENCE);"
|
||||||
NL, " int (^kernelBlock)(int) = ^(int a)"
|
NL, " int (^kernelBlock)(int) = ^(int a)"
|
||||||
NL, " {"
|
NL, " {"
|
||||||
NL, " atomic_inc(res+idx);"
|
NL, " atomic_dec(res+idx);"
|
||||||
NL, " barrier(CLK_GLOBAL_MEM_FENCE);"
|
NL, " barrier(CLK_GLOBAL_MEM_FENCE);"
|
||||||
NL, " return (int)abs(a - b) - (res[idx] != lsz ? 0 : 1);"
|
NL, " return (int)abs(a - b) - (res[idx] != 0 ? 0 : 1);"
|
||||||
NL, " };"
|
NL, " };"
|
||||||
NL, ""
|
NL, ""
|
||||||
NL, " int d = kernelBlock(2);"
|
NL, " int d = kernelBlock(2);"
|
||||||
NL, " barrier(CLK_GLOBAL_MEM_FENCE);"
|
|
||||||
NL, " res[tid] = d;"
|
NL, " res[tid] = d;"
|
||||||
NL, "}"
|
NL, "}"
|
||||||
NL
|
NL
|
||||||
|
|||||||
Reference in New Issue
Block a user