On 01/15/2018 11:05 AM, Jakub Jelinek wrote:
On Mon, Jan 15, 2018 at 10:49:52AM +0100, Tom de Vries wrote:
On 01/07/2018 02:17 PM, Tom de Vries wrote:
On 01/06/2018 12:36 PM, Jakub Jelinek wrote:
On Sat, Jan 06, 2018 at 09:21:59AM +0100, Tom de Vries wrote:
this patch adds the following builtins in C/C++:
- __builtin_goacc_gang_id
- __builtin_goacc_worker_id
- __builtin_goacc_vector_id
- __builtin_goacc_gang_size
- __builtin_goacc_worker_size
- __builtin_goacc_vector_size

I wonder if it wouldn't be better to have just 2 builtins instead of 6,
with one argument (required to be constant) - the kind of parallelism
you're interested in, to avoid the inflation of the builtins.


Like so:
- __built_goacc_id
- __built_goacc_size
?

Hi,

I understand this is more of a stage1 patch and has no priority atm, but if
the concept as such is acceptable can we at least settle on the name and
interface?

Does OpenACC have some term for the 3 dimensions/kinds of parallelism?

openacc spec: "OpenACC exposes these three levels of parallelism via gang, worker and vector parallelism."

So, maybe we abbreviate to: 'parlevel' or 'par_level'?

Is there some enum describing those 3 already?

There's no enum type in openacc.h or gomp-constants.h.

There's an enumeration of int constants from gomp-constants.h:
...
#define GOMP_DIM_GANG   0
#define GOMP_DIM_WORKER 1
#define GOMP_DIM_VECTOR 2
...
which I'm currently using as argument.

Given the amount of trouble that having an enum type as argument for acc_on_device has given us, I'm not sure that we want an enum type as argument for these builtins. [ See the comments and kludge related to c++ in the https://gcc.gnu.org/ml/gcc-patches/2017-12/msg01529.html patch for PR82391 Fold acc_on_device with const arg. ]

Thanks,
- Tom

Reply via email to