While 'vendor' and 'kind' is well defined, 'arch' and 'isa' isn't.
When looking at an 'metadirective' testcase (which oddly uses 'arch(amd)'), I noticed that LLVM uses 'arch(amdgcn)' while we use 'gcn', cf. e.g. 'clang/lib/Headers/openmp_wrappers/math.h'. (Side note: we use the target triplet amdgcn-amdhsa and LLVM uses amdgcn-amd-amdhsa.) Given the target triplet, the LLVM choice seems to make more sense; 'gcn' only shows up as directory name (under gcc/config + libgomp/). Thus, I think we have two options: * Either also change to (only) 'amdgcn' - given that the supported arch() values are neither documented not yet widely used. * Or add 'amdgcn' alongside 'gcn' - which is what the attached patch does. Which option do you prefer? Other thoughts? Tobias PS: I think during the GCC 13 development, we should start adding more offload-target documentation, including documenting the used/permitted vendor/arch/isa context selectors. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
gcn/t-omp-device: Add 'amdgcn' as 'arch' [PR105602] Improve cross-compiler handling. gcc/ChangeLog: PR target/105602 * config/gcn/t-omp-device (arch): Add 'amdgcn' besides existing 'gcn'. diff --git a/gcc/config/gcn/t-omp-device b/gcc/config/gcn/t-omp-device index cd56e2f8a68..e1d9e0d2a1e 100644 --- a/gcc/config/gcn/t-omp-device +++ b/gcc/config/gcn/t-omp-device @@ -1,4 +1,4 @@ omp-device-properties-gcn: $(srcdir)/config/gcn/gcn.cc echo kind: gpu > $@ - echo arch: gcn >> $@ + echo arch: amdgcn gcn >> $@ echo isa: fiji gfx900 gfx906 gfx908 >> $@