This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgomp/82428] New: Builtins for openacc gang/worker/vector id/size
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Oct 2017 13:32:12 +0000
- Subject: [Bug libgomp/82428] New: Builtins for openacc gang/worker/vector id/size
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82428
Bug ID: 82428
Summary: Builtins for openacc gang/worker/vector id/size
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: libgomp
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
CC: jakub at gcc dot gnu.org
Target Milestone: ---
We have openacc test-cases using the following nvptx idiom:
...
__asm__ volatile ("mov.u32 %0,%%ctaid.x;" : "=r" (g));
__asm__ volatile ("mov.u32 %0,%%tid.y;" : "=r" (w));
__asm__ volatile ("mov.u32 %0,%%tid.x;" : "=r" (v));
...
Typically this is done guarded with acc_on_device (acc_device_nvidia), and
skipping -O0:
...
/* This code uses nvptx inline assembly guarded with acc_on_device, which is
not optimized away at -O0, and then confuses the target assembler.
{ dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
...
It would be better to have generic openacc builtins
__builtin__goacc_{gang,worker,vector}_{id,size}, and use those in the testcase
instead. These could be used at -O0, and without the need to guarded them with
acc_on_device.