Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal WG barrier usage in prm/core/parallel/fbarrier/wait_race/1_1024x1x1_256x1x1 #14

Open
pjaaskel opened this issue Jan 15, 2016 · 1 comment
Assignees

Comments

@pjaaskel
Copy link

This test case has a WG barrier that is entered only by a single WI in the whole grid. Others exit the kernel early. The behavior of the last WG that contains that WI (1023) is undefined due to the WG barrier's all-or-none semantics.

module &sample:1:0:$base:$large:$near;

prog kernel &test_kernel(kernarg_u64 %output)
{
    fbarrier %fb;
    workitemflatabsid_u64   $d0;
    cmp_ge_b1_u64   $c0, $d0, 1023;
  ; Only the last WI of the last WG in the 1024x1x1 grid proceeds...
    cbr_b1  $c0, @then;
  ; ...the rest WIs jump to the end which exits the kernel.
    br  @endif;

@then:
    sub_u64 $d1, $d0, 1023;
    workitemflatid_u32  $s0;
    cmp_ne_b1_u32   $c1, $s0, 0;
    cbr_b1  $c1, @L;
  ; Is any WI going here in case only 1023 executes
  ; the kernel? It's 255 in the last WG?
    initfbar    %fb;

@L:
  ; ...only WI 1023 reaches this barrier, thus
  ; it's undefined what happens because the others
  ; have exited.
    barrier;
....
@SamWot
Copy link
Contributor

SamWot commented Jan 19, 2016

Yes, you are right - this is error in test.
I'm working on fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants