On 03/02/2018 05:55 PM, Cesar Philippidis wrote:

        (nvptx_declare_function_name): Emit a .maxntid directive hint and
        call nvptx_init_oacc_workers.

+
+  /* Emit a .maxntid hint to help the PTX JIT emit SYNC branches.  */
+  if (lookup_attribute ("omp target entrypoint", DECL_ATTRIBUTES (decl))
+      && lookup_attribute ("oacc function", DECL_ATTRIBUTES (decl)))
+      s << ".maxntid " << cfun->machine->axis_dim[0] << ", "
+       << cfun->machine->axis_dim[1] << ", 1\n";
+

This change:
...
 // BEGIN FUNCTION DEF: main$_omp_fn$0
 .entry main$_omp_fn$0 (.param .u64 %in_ar0)
+  .maxntid 32, 32, 1
...
needs to be an individual patch.


> +  /* Emit a .maxntid hint to help the PTX JIT emit SYNC branches.  */

'Help' is too strongly formulated, given that there's no clear link between the semantics of the directive, and the observed effect.

Use "seems to have the effect" or some such formulation.

Also, list in the comment a JIT driver version, and sm_ version and a testcase for which this is required.

Also, guard it with WORKAROUND_PTXJIT_BUG_3 (_2 is already taken in trunk.)

Thanks,
- Tom

Reply via email to