[GCN] Fix run-time variable 'num_workers'

... which currently has *not* been forced to 'num_workers (1)'.

In addition to the testcases modified here, this also fixes:

    FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/mode-transitions.c -DACC_DEVICE_TYPE_radeon=1 -DACC_MEM_SHARED=0 -foffload=amdgcn-amdhsa  -O0  execution test
    [Etc.]

    mode-transitions.exe: [...]/libgomp.oacc-c-c++-common/mode-transitions.c:702: t17: Assertion `arr_b[i] == (i ^ 31) * 8' failed.

	libgomp/
	* plugin/plugin-gcn.c (gcn_exec): Force 'num_workers (1)'
	unconditionally.
	* testsuite/libgomp.oacc-c-c++-common/acc_prof-kernels-1.c:
	Update.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
This commit is contained in:
Thomas Schwinge 2021-06-05 22:39:21 +02:00
parent c68ddd5e2a
commit 30656822b3
4 changed files with 8 additions and 9 deletions

View file

@ -3041,10 +3041,9 @@ gcn_exec (struct kernel_info *kernel, size_t mapnum, void **hostaddrs,
problem size, so let's do a reasonable number of single-worker gangs.
64 gangs matches a typical Fiji device. */
/* NOTE: Until support for middle-end worker partitioning is merged, use 1
for the default number of workers. */
if (dims[0] == 0) dims[0] = get_cu_count (kernel->agent); /* Gangs. */
if (dims[1] == 0) dims[1] = 1; /* Workers. */
/* NOTE: Until support for middle-end worker partitioning is merged, force 'num_workers (1)'. */
if (/*TODO dims[1] == 0*/ true) dims[1] = 1; /* Workers. */
/* The incoming dimensions are expressed in terms of gangs, workers, and
vectors. The HSA dimensions are expressed in terms of "work-items",

View file

@ -94,9 +94,7 @@ static void cb_enqueue_launch_start (acc_prof_info *prof_info, acc_event_info *e
if (num_workers < 1)
assert (event_info->launch_event.num_workers >= 1);
/* GCN currently enforces 'num_workers (1)'. */
else if (acc_device_type == acc_device_radeon
/*TODO ... just not in the "Parallelism dimensions: variable" case. */
&& /*TODO*/ num_gangs != 22)
else if (acc_device_type == acc_device_radeon)
assert (event_info->launch_event.num_workers == 1);
else
{

View file

@ -313,8 +313,9 @@ int main ()
}
else if (acc_on_device (acc_device_radeon))
{
/* The GCC GCN back end is limited to num_workers (16). */
workers_actual = 16;
/* The GCC GCN back end is limited to num_workers (16).
Temporarily set this to 1 until multiple workers are permitted. */
workers_actual = 1; // 16;
}
else
__builtin_abort ();

View file

@ -6,7 +6,8 @@
#include <gomp-constants.h>
#ifdef ACC_DEVICE_TYPE_radeon
#define NUM_WORKERS 16
/* Temporarily set this to 1 until multiple workers are permitted. */
#define NUM_WORKERS 1
#define NUM_VECTORS 1
#else
#define NUM_WORKERS 16