aboutsummaryrefslogtreecommitdiff
path: root/libgomp/plugin
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2023-06-06 18:06:14 +0200
committerTobias Burnus <tobias@codesourcery.com>2023-06-06 18:06:14 +0200
commitf1af7d65ff64fe7102d1490ef46ea491a533e641 (patch)
tree704004e1fbae724d097de8a44227a1049e94825c /libgomp/plugin
parent192665feef71294510b1632bfaaedd4d824c744f (diff)
downloadgcc-f1af7d65ff64fe7102d1490ef46ea491a533e641.zip
gcc-f1af7d65ff64fe7102d1490ef46ea491a533e641.tar.gz
gcc-f1af7d65ff64fe7102d1490ef46ea491a533e641.tar.bz2
libgomp: plugin-gcn - support 'unified_address'
Effectively, for GCN (as for nvptx) there is a common address space between host and device, whether being accessible or not. Thus, this commit permits to use 'omp requires unified_address' with GCN devices. (nvptx accepts this requirement since r13-3460-g131d18e928a3ea.) libgomp/ * plugin/plugin-gcn.c (GOMP_OFFLOAD_get_num_devices): Regard unified_address requirement as supported. * libgomp.texi (OpenMP 5.0, AMD Radeon, nvptx): Remove 'unified_address' from the not-supported requirements.
Diffstat (limited to 'libgomp/plugin')
-rw-r--r--libgomp/plugin/plugin-gcn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index 2181bf0..ef22d48 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -3231,7 +3231,9 @@ GOMP_OFFLOAD_get_num_devices (unsigned int omp_requires_mask)
/* Return -1 if no omp_requires_mask cannot be fulfilled but
devices were present. */
if (hsa_context.agent_count > 0
- && (omp_requires_mask & ~GOMP_REQUIRES_REVERSE_OFFLOAD) != 0)
+ && ((omp_requires_mask
+ & ~(GOMP_REQUIRES_UNIFIED_ADDRESS
+ | GOMP_REQUIRES_REVERSE_OFFLOAD)) != 0))
return -1;
return hsa_context.agent_count;
}