Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-07-17 Thread Matt Arsenault


> On Jun 28, 2019, at 19:33, Jan Vesely  wrote:
> 
> On Fri, Jun 21, 2019 at 4:12 PM Matt Arsenault  wrote:
>> 
>> 
>> 
>> On Jun 20, 2019, at 2:38 PM, Jan Vesely  wrote:
>> 
>> sorry, I'm running against deadlines and traveling this week.
>> Does the timeout patch work as expected in failure path?
>> 
>> 
>> It seems to not work. I’m able to manually interrupt it still, but the 
>> timeout never triggers
> 
> Can you check running:
> python3 ./piglit run tests/cl.py -t clobbers results/foo
> ?
> 
> Other than that, LGTM.
> 
> Jan

It is actually working for me

-Matt
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-28 Thread Jan Vesely
On Fri, Jun 21, 2019 at 4:12 PM Matt Arsenault  wrote:
>
>
>
> On Jun 20, 2019, at 2:38 PM, Jan Vesely  wrote:
>
> sorry, I'm running against deadlines and traveling this week.
> Does the timeout patch work as expected in failure path?
>
>
> It seems to not work. I’m able to manually interrupt it still, but the 
> timeout never triggers

Can you check running:
python3 ./piglit run tests/cl.py -t clobbers results/foo
?

Other than that, LGTM.

Jan
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-21 Thread Jan Vesely
On Fri, Jun 21, 2019 at 4:12 PM Matt Arsenault  wrote:
>
>
>
> On Jun 20, 2019, at 2:38 PM, Jan Vesely  wrote:
>
> sorry, I'm running against deadlines and traveling this week.
> Does the timeout patch work as expected in failure path?
>
>
> It seems to not work. I’m able to manually interrupt it still, but the 
> timeout never triggers

are you using python2 or python3 to run piglit?
does the timeout work when you run with --timeout option?

Jan

> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-21 Thread Matt Arsenault


> On Jun 20, 2019, at 2:38 PM, Jan Vesely  wrote:
> 
> sorry, I'm running against deadlines and traveling this week.
> Does the timeout patch work as expected in failure path?

It seems to not work. I’m able to manually interrupt it still, but the timeout 
never triggers___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-20 Thread Jan Vesely
On Tue, Jun 18, 2019 at 12:36 PM Matt Arsenault  wrote:
>
>
>
> > On Jun 5, 2019, at 10:05 PM, Jan Vesely  wrote:
> >
> > On Wed, 2019-06-05 at 17:48 -0400, Matt Arsenault wrote:
> >>> On Jun 3, 2019, at 12:46 PM, Jan Vesely  wrote:
> >>>
> >>> Does rocm do anything special other than using compute rings?
> >>> What was the HW you tested?
> >> I don’t think so. This is on gfx900
> >>
> >>
> >>> I checked that raven can reboot after gpu hangs/crashes (not suspend,
> >>> but that's probably one of many raven problems). I'd like to check
> >>> carrizo/iceland too, as that's the machine that get accessed remotely.
> >>>
> >>> Other than that I think it's OK to just put default 30s timeout on all
> >>> CL tests, even debug build of LLVM shouldn't need more than that.
> >>
> >> Do you know where this goes?
> >
> > The test base class has a timeout attribute, and the invocation uses
> > self.timoute. I think just adding self.timeout = 30 to PiglitCLTest
> > constructor should suffice, adding a timeout attribute to the
> > PiglitCLTest class might work as well.
> >
> > Dylan, is there a preferred way to do this? will the commandline --
> > timeout take precedence?
> >
> > Jan
> >
> > --
> > Jan Vesely 
>
> ping

sorry, I'm running against deadlines and traveling this week.
Does the timeout patch work as expected in failure path?

Jan

> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-18 Thread Matt Arsenault


> On Jun 5, 2019, at 10:05 PM, Jan Vesely  wrote:
> 
> On Wed, 2019-06-05 at 17:48 -0400, Matt Arsenault wrote:
>>> On Jun 3, 2019, at 12:46 PM, Jan Vesely  wrote:
>>> 
>>> Does rocm do anything special other than using compute rings?
>>> What was the HW you tested?
>> I don’t think so. This is on gfx900
>> 
>> 
>>> I checked that raven can reboot after gpu hangs/crashes (not suspend,
>>> but that's probably one of many raven problems). I'd like to check
>>> carrizo/iceland too, as that's the machine that get accessed remotely.
>>> 
>>> Other than that I think it's OK to just put default 30s timeout on all
>>> CL tests, even debug build of LLVM shouldn't need more than that.
>> 
>> Do you know where this goes?
> 
> The test base class has a timeout attribute, and the invocation uses
> self.timoute. I think just adding self.timeout = 30 to PiglitCLTest
> constructor should suffice, adding a timeout attribute to the
> PiglitCLTest class might work as well.
> 
> Dylan, is there a preferred way to do this? will the commandline --
> timeout take precedence?
> 
> Jan
> 
> -- 
> Jan Vesely 

ping
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-05 Thread Jan Vesely
On Wed, 2019-06-05 at 17:48 -0400, Matt Arsenault wrote:
> > On Jun 3, 2019, at 12:46 PM, Jan Vesely  wrote:
> > 
> > Does rocm do anything special other than using compute rings?
> > What was the HW you tested?
> I don’t think so. This is on gfx900
> 
> 
> > I checked that raven can reboot after gpu hangs/crashes (not suspend,
> > but that's probably one of many raven problems). I'd like to check
> > carrizo/iceland too, as that's the machine that get accessed remotely.
> > 
> > Other than that I think it's OK to just put default 30s timeout on all
> > CL tests, even debug build of LLVM shouldn't need more than that.
> 
> Do you know where this goes?

The test base class has a timeout attribute, and the invocation uses
self.timoute. I think just adding self.timeout = 30 to PiglitCLTest
constructor should suffice, adding a timeout attribute to the
PiglitCLTest class might work as well.

Dylan, is there a preferred way to do this? will the commandline --
timeout take precedence?

Jan

-- 
Jan Vesely 


signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-05 Thread Matt Arsenault


> On Jun 3, 2019, at 12:46 PM, Jan Vesely  wrote:
> 
> Does rocm do anything special other than using compute rings?
> What was the HW you tested?
I don’t think so. This is on gfx900


> I checked that raven can reboot after gpu hangs/crashes (not suspend,
> but that's probably one of many raven problems). I'd like to check
> carrizo/iceland too, as that's the machine that get accessed remotely.
> 
> Other than that I think it's OK to just put default 30s timeout on all
> CL tests, even debug build of LLVM shouldn't need more than that.


Do you know where this goes?___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-03 Thread Jan Vesely
On Mon, 2019-06-03 at 10:31 -0400, Matt Arsenault wrote:
> > On Jun 2, 2019, at 2:36 PM, Jan Vesely  wrote:
> > 
> > he other problem is that even with killed process hung GPU usually
> > makes the machine unable to suspend or reboot on its own, which kills
> > remote testing.
> > I'd need to recheck if that's still the case with linux-5.1.
> 
> I was able to interrupt the process normally and everything worked
> OK with rocm (which due to the device name regex, its the only
> platform this runs) without my fix applied.

Does rocm do anything special other than using compute rings?
What was the HW you tested?
I checked that raven can reboot after gpu hangs/crashes (not suspend,
but that's probably one of many raven problems). I'd like to check
carrizo/iceland too, as that's the machine that get accessed remotely.

Other than that I think it's OK to just put default 30s timeout on all
CL tests, even debug build of LLVM shouldn't need more than that.

Jan

> 
> -Matt
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

-- 
Jan Vesely 


signature.asc
Description: This is a digitally signed message part
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-03 Thread Matt Arsenault


> On Jun 2, 2019, at 2:36 PM, Jan Vesely  wrote:
> 
> he other problem is that even with killed process hung GPU usually
> makes the machine unable to suspend or reboot on its own, which kills
> remote testing.
> I'd need to recheck if that's still the case with linux-5.1.

I was able to interrupt the process normally and everything worked OK with rocm 
(which due to the device name regex, its the only platform this runs) without 
my fix applied

-Matt___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-02 Thread Jan Vesely
On Sun, 2019-06-02 at 09:49 -0400, Matt Arsenault wrote:
> > On Jun 1, 2019, at 10:57 PM, Jan Vesely  wrote:
> > 
> > On Thu, 2019-05-30 at 08:40 -0400, Matt Arsenault wrote:
> > > Ping
> > > 
> > > > On May 23, 2019, at 7:59 PM, arse...@gmail.com wrote:
> > > > 
> > > > From: Matt Arsenault 
> > > > 
> > > > ---
> > > > .../program/execute/call-clobbers-amdgcn.cl   | 102 ++
> > > > 1 file changed, 102 insertions(+)
> > > > 
> > > > diff --git a/tests/cl/program/execute/call-clobbers-amdgcn.cl 
> > > > b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > > > index 18e657ce3..b0a1f8c70 100644
> > > > --- a/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > > > +++ b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > > > @@ -19,6 +19,49 @@ dimensions: 1
> > > > global_size: 1 0 0
> > > > arg_out: 0 buffer int[1] 0xabcd1234
> > > > 
> > > > +[test]
> > > > +name: Conditional call
> > > > +kernel_name: conditional_call
> > > > +dimensions: 1
> > > > +local_size: 64 0 0
> > > > +global_size: 64 0 0
> > > > +arg_out: 0 buffer int[64] \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234
> > > > +
> > > > +[test]
> > > > +name: Conditional call partial dispatch
> > > > +kernel_name: conditional_call
> > > > +dimensions: 1
> > > > +local_size: 16 0 0
> > > > +global_size: 16 0 0
> > > > +arg_out: 0 buffer int[16] \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234 \
> > > > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > > > 0xabcd1234 0xabcd1234
> > > > +
> > > > +
> > > > +[test]
> > > > +name: Skip call no lanes
> > > > +kernel_name: skip_call_no_lanes
> > > > +dimensions: 1
> > > > +local_size: 64 0 0
> > > > +global_size: 64 0 0
> > > > +arg_out: 0 buffer int[64] \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123 \
> > > > +  123 123 123 123 123 123 123 123
> > > > +
> > > > !*/
> > > > 
> > > > #ifndef __AMDGCN__
> > > > @@ -65,3 +108,62 @@ kernel void call_clobber_v40(__global int* ret)
> > > >  : "v40");
> > > >*ret = tmp;
> > > > }
> > > > +
> > > > +__attribute__((noinline))
> > > > +void spill_sgpr_to_csr_vgpr()
> > > > +{
> > > > +__asm volatile(
> > > > +"s_nop 1" :::
> > > > +"v0","v1","v2","v3","v4","v5","v6","v7",
> > > > +"v8","v9","v10","v11","v12","v13","v14","v15",
> > > > +"v16","v17","v18","v19","v20","v21","v22","v23",
> > > > +"v24","v25","v26","v27","v28","v29","v30","v31",
> > > > +
> > > > +"s0","s1","s2","s3","s4","s5","s6","s7",
> > > > +"s8","s9","s10","s11","s12","s13","s14","s15",
> > > > +"s16","s17","s18","s19","s20","s21","s22","s23",
> > > > +"s24","s25","s26","s27","s28","s29","s30","s31",
> > > > +"s32", "s33", "s34", "s35", "s36", "s37", "s38");
> > > > +}
> > > > +
> > > > +// A CSR VGPR needs to be spilled/restored in the prolog/epilog, but
> > > > +// all lanes need to be made active to avoid clobbering lanes that did
> > > > +// not enter the call.
> > > > +kernel void conditional_call(global int* ret)
> > > > +{
> > > > +__asm volatile("v_mov_b32 v32, 0xabcd1234" : : : "v32");
> > > > +
> > > > +int id = get_local_id(0);
> > > > +if (id == 0)
> > > > +{
> > > > +spill_sgpr_to_csr_vgpr();
> > > > +}
> > > > +
> > > > +int tmp;
> > > > +__asm volatile("v_mov_b32 %0, v32"
> > > > +   : "=v"(tmp)
> > > > +   :
> > > > +   : "v32");
> > > > +ret[id] = tmp;
> > > > +}
> > > > +
> > > > +__attribute__((noinline))
> > > > +void hang_if_all_inactive()
> > > > +{
> > > > +__builtin_amdgcn_s_sendmsghalt(0, 0);
> > > > +}
> > > > +
> > > > +// If all lanes could be dynamically false, the call must not be taken
> > > > +// in case a side effecting scalar op is called inside.
> > > > +kernel void 

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-02 Thread Matt Arsenault


> On Jun 1, 2019, at 10:57 PM, Jan Vesely  wrote:
> 
> On Thu, 2019-05-30 at 08:40 -0400, Matt Arsenault wrote:
>> Ping
>> 
>>> On May 23, 2019, at 7:59 PM, arse...@gmail.com wrote:
>>> 
>>> From: Matt Arsenault 
>>> 
>>> ---
>>> .../program/execute/call-clobbers-amdgcn.cl   | 102 ++
>>> 1 file changed, 102 insertions(+)
>>> 
>>> diff --git a/tests/cl/program/execute/call-clobbers-amdgcn.cl 
>>> b/tests/cl/program/execute/call-clobbers-amdgcn.cl
>>> index 18e657ce3..b0a1f8c70 100644
>>> --- a/tests/cl/program/execute/call-clobbers-amdgcn.cl
>>> +++ b/tests/cl/program/execute/call-clobbers-amdgcn.cl
>>> @@ -19,6 +19,49 @@ dimensions: 1
>>> global_size: 1 0 0
>>> arg_out: 0 buffer int[1] 0xabcd1234
>>> 
>>> +[test]
>>> +name: Conditional call
>>> +kernel_name: conditional_call
>>> +dimensions: 1
>>> +local_size: 64 0 0
>>> +global_size: 64 0 0
>>> +arg_out: 0 buffer int[64] \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234
>>> +
>>> +[test]
>>> +name: Conditional call partial dispatch
>>> +kernel_name: conditional_call
>>> +dimensions: 1
>>> +local_size: 16 0 0
>>> +global_size: 16 0 0
>>> +arg_out: 0 buffer int[16] \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234 \
>>> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
>>> 0xabcd1234 0xabcd1234
>>> +
>>> +
>>> +[test]
>>> +name: Skip call no lanes
>>> +kernel_name: skip_call_no_lanes
>>> +dimensions: 1
>>> +local_size: 64 0 0
>>> +global_size: 64 0 0
>>> +arg_out: 0 buffer int[64] \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123 \
>>> +  123 123 123 123 123 123 123 123
>>> +
>>> !*/
>>> 
>>> #ifndef __AMDGCN__
>>> @@ -65,3 +108,62 @@ kernel void call_clobber_v40(__global int* ret)
>>>  : "v40");
>>>*ret = tmp;
>>> }
>>> +
>>> +__attribute__((noinline))
>>> +void spill_sgpr_to_csr_vgpr()
>>> +{
>>> +__asm volatile(
>>> +"s_nop 1" :::
>>> +"v0","v1","v2","v3","v4","v5","v6","v7",
>>> +"v8","v9","v10","v11","v12","v13","v14","v15",
>>> +"v16","v17","v18","v19","v20","v21","v22","v23",
>>> +"v24","v25","v26","v27","v28","v29","v30","v31",
>>> +
>>> +"s0","s1","s2","s3","s4","s5","s6","s7",
>>> +"s8","s9","s10","s11","s12","s13","s14","s15",
>>> +"s16","s17","s18","s19","s20","s21","s22","s23",
>>> +"s24","s25","s26","s27","s28","s29","s30","s31",
>>> +"s32", "s33", "s34", "s35", "s36", "s37", "s38");
>>> +}
>>> +
>>> +// A CSR VGPR needs to be spilled/restored in the prolog/epilog, but
>>> +// all lanes need to be made active to avoid clobbering lanes that did
>>> +// not enter the call.
>>> +kernel void conditional_call(global int* ret)
>>> +{
>>> +__asm volatile("v_mov_b32 v32, 0xabcd1234" : : : "v32");
>>> +
>>> +int id = get_local_id(0);
>>> +if (id == 0)
>>> +{
>>> +spill_sgpr_to_csr_vgpr();
>>> +}
>>> +
>>> +int tmp;
>>> +__asm volatile("v_mov_b32 %0, v32"
>>> +   : "=v"(tmp)
>>> +   :
>>> +   : "v32");
>>> +ret[id] = tmp;
>>> +}
>>> +
>>> +__attribute__((noinline))
>>> +void hang_if_all_inactive()
>>> +{
>>> +__builtin_amdgcn_s_sendmsghalt(0, 0);
>>> +}
>>> +
>>> +// If all lanes could be dynamically false, the call must not be taken
>>> +// in case a side effecting scalar op is called inside.
>>> +kernel void skip_call_no_lanes(global int* ret)
>>> +{
>>> +int divergent_false;
>>> +__asm volatile("v_mov_b32 %0, 0" : "=v"(divergent_false));
>>> +
>>> +if (divergent_false)
>>> +{
>>> +hang_if_all_inactive();
> 
> this looks like it will hang the GPU on test failure, which is a no-
> go.
> 
> Jan


Is there a way to specify a timeout? The alternatives require more ABI support___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-06-01 Thread Jan Vesely
On Thu, 2019-05-30 at 08:40 -0400, Matt Arsenault wrote:
> Ping
> 
> > On May 23, 2019, at 7:59 PM, arse...@gmail.com wrote:
> > 
> > From: Matt Arsenault 
> > 
> > ---
> > .../program/execute/call-clobbers-amdgcn.cl   | 102 ++
> > 1 file changed, 102 insertions(+)
> > 
> > diff --git a/tests/cl/program/execute/call-clobbers-amdgcn.cl 
> > b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > index 18e657ce3..b0a1f8c70 100644
> > --- a/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > +++ b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> > @@ -19,6 +19,49 @@ dimensions: 1
> > global_size: 1 0 0
> > arg_out: 0 buffer int[1] 0xabcd1234
> > 
> > +[test]
> > +name: Conditional call
> > +kernel_name: conditional_call
> > +dimensions: 1
> > +local_size: 64 0 0
> > +global_size: 64 0 0
> > +arg_out: 0 buffer int[64] \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234
> > +
> > +[test]
> > +name: Conditional call partial dispatch
> > +kernel_name: conditional_call
> > +dimensions: 1
> > +local_size: 16 0 0
> > +global_size: 16 0 0
> > +arg_out: 0 buffer int[16] \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234 \
> > +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> > 0xabcd1234 0xabcd1234
> > +
> > +
> > +[test]
> > +name: Skip call no lanes
> > +kernel_name: skip_call_no_lanes
> > +dimensions: 1
> > +local_size: 64 0 0
> > +global_size: 64 0 0
> > +arg_out: 0 buffer int[64] \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123 \
> > +  123 123 123 123 123 123 123 123
> > +
> > !*/
> > 
> > #ifndef __AMDGCN__
> > @@ -65,3 +108,62 @@ kernel void call_clobber_v40(__global int* ret)
> >   : "v40");
> > *ret = tmp;
> > }
> > +
> > +__attribute__((noinline))
> > +void spill_sgpr_to_csr_vgpr()
> > +{
> > +__asm volatile(
> > +"s_nop 1" :::
> > +"v0","v1","v2","v3","v4","v5","v6","v7",
> > +"v8","v9","v10","v11","v12","v13","v14","v15",
> > +"v16","v17","v18","v19","v20","v21","v22","v23",
> > +"v24","v25","v26","v27","v28","v29","v30","v31",
> > +
> > +"s0","s1","s2","s3","s4","s5","s6","s7",
> > +"s8","s9","s10","s11","s12","s13","s14","s15",
> > +"s16","s17","s18","s19","s20","s21","s22","s23",
> > +"s24","s25","s26","s27","s28","s29","s30","s31",
> > +"s32", "s33", "s34", "s35", "s36", "s37", "s38");
> > +}
> > +
> > +// A CSR VGPR needs to be spilled/restored in the prolog/epilog, but
> > +// all lanes need to be made active to avoid clobbering lanes that did
> > +// not enter the call.
> > +kernel void conditional_call(global int* ret)
> > +{
> > +__asm volatile("v_mov_b32 v32, 0xabcd1234" : : : "v32");
> > +
> > +int id = get_local_id(0);
> > +if (id == 0)
> > +{
> > +spill_sgpr_to_csr_vgpr();
> > +}
> > +
> > +int tmp;
> > +__asm volatile("v_mov_b32 %0, v32"
> > +   : "=v"(tmp)
> > +   :
> > +   : "v32");
> > +ret[id] = tmp;
> > +}
> > +
> > +__attribute__((noinline))
> > +void hang_if_all_inactive()
> > +{
> > +__builtin_amdgcn_s_sendmsghalt(0, 0);
> > +}
> > +
> > +// If all lanes could be dynamically false, the call must not be taken
> > +// in case a side effecting scalar op is called inside.
> > +kernel void skip_call_no_lanes(global int* ret)
> > +{
> > +int divergent_false;
> > +__asm volatile("v_mov_b32 %0, 0" : "=v"(divergent_false));
> > +
> > +if (divergent_false)
> > +{
> > +hang_if_all_inactive();

this looks like it will hang the GPU on test failure, which is a no-
go.

Jan

> > +}
> > +
> > +ret[get_global_id(0)] = 123;
> > +}
> > -- 
> > 2.17.1
> > 
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

-- 
Jan Vesely 


signature.asc
Description: This is a digitally signed message part

Re: [Piglit] [PATCH] cl: Add tests for some cases that were broken with function calls

2019-05-30 Thread Matt Arsenault
Ping

> On May 23, 2019, at 7:59 PM, arse...@gmail.com wrote:
> 
> From: Matt Arsenault 
> 
> ---
> .../program/execute/call-clobbers-amdgcn.cl   | 102 ++
> 1 file changed, 102 insertions(+)
> 
> diff --git a/tests/cl/program/execute/call-clobbers-amdgcn.cl 
> b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> index 18e657ce3..b0a1f8c70 100644
> --- a/tests/cl/program/execute/call-clobbers-amdgcn.cl
> +++ b/tests/cl/program/execute/call-clobbers-amdgcn.cl
> @@ -19,6 +19,49 @@ dimensions: 1
> global_size: 1 0 0
> arg_out: 0 buffer int[1] 0xabcd1234
> 
> +[test]
> +name: Conditional call
> +kernel_name: conditional_call
> +dimensions: 1
> +local_size: 64 0 0
> +global_size: 64 0 0
> +arg_out: 0 buffer int[64] \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234
> +
> +[test]
> +name: Conditional call partial dispatch
> +kernel_name: conditional_call
> +dimensions: 1
> +local_size: 16 0 0
> +global_size: 16 0 0
> +arg_out: 0 buffer int[16] \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234 \
> +  0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 0xabcd1234 
> 0xabcd1234 0xabcd1234
> +
> +
> +[test]
> +name: Skip call no lanes
> +kernel_name: skip_call_no_lanes
> +dimensions: 1
> +local_size: 64 0 0
> +global_size: 64 0 0
> +arg_out: 0 buffer int[64] \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123 \
> +  123 123 123 123 123 123 123 123
> +
> !*/
> 
> #ifndef __AMDGCN__
> @@ -65,3 +108,62 @@ kernel void call_clobber_v40(__global int* ret)
>   : "v40");
> *ret = tmp;
> }
> +
> +__attribute__((noinline))
> +void spill_sgpr_to_csr_vgpr()
> +{
> +__asm volatile(
> +"s_nop 1" :::
> +"v0","v1","v2","v3","v4","v5","v6","v7",
> +"v8","v9","v10","v11","v12","v13","v14","v15",
> +"v16","v17","v18","v19","v20","v21","v22","v23",
> +"v24","v25","v26","v27","v28","v29","v30","v31",
> +
> +"s0","s1","s2","s3","s4","s5","s6","s7",
> +"s8","s9","s10","s11","s12","s13","s14","s15",
> +"s16","s17","s18","s19","s20","s21","s22","s23",
> +"s24","s25","s26","s27","s28","s29","s30","s31",
> +"s32", "s33", "s34", "s35", "s36", "s37", "s38");
> +}
> +
> +// A CSR VGPR needs to be spilled/restored in the prolog/epilog, but
> +// all lanes need to be made active to avoid clobbering lanes that did
> +// not enter the call.
> +kernel void conditional_call(global int* ret)
> +{
> +__asm volatile("v_mov_b32 v32, 0xabcd1234" : : : "v32");
> +
> +int id = get_local_id(0);
> +if (id == 0)
> +{
> +spill_sgpr_to_csr_vgpr();
> +}
> +
> +int tmp;
> +__asm volatile("v_mov_b32 %0, v32"
> +   : "=v"(tmp)
> +   :
> +   : "v32");
> +ret[id] = tmp;
> +}
> +
> +__attribute__((noinline))
> +void hang_if_all_inactive()
> +{
> +__builtin_amdgcn_s_sendmsghalt(0, 0);
> +}
> +
> +// If all lanes could be dynamically false, the call must not be taken
> +// in case a side effecting scalar op is called inside.
> +kernel void skip_call_no_lanes(global int* ret)
> +{
> +int divergent_false;
> +__asm volatile("v_mov_b32 %0, 0" : "=v"(divergent_false));
> +
> +if (divergent_false)
> +{
> +hang_if_all_inactive();
> +}
> +
> +ret[get_global_id(0)] = 123;
> +}
> -- 
> 2.17.1
> 

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit