[Openmp-commits] [PATCH] D106960: [OffloadArch] Library to query properties of current offload archicture
Saiyedul Islam via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jul 28 07:31:48 PDT 2021
saiislam created this revision.
saiislam added reviewers: jdoerfert, yaxunl, JonChesterfield, RaviNarayanaswamy, ABataev, grokos.
Herald added subscribers: kerbowa, hiraditya, tpr, mgorny, nhaehnle, jvesely, rampitec.
saiislam requested review of this revision.
Herald added subscribers: llvm-commits, openmp-commits, cfe-commits, sstefan1.
Herald added projects: clang, OpenMP, LLVM.
offload-arch: Print offload architecture(s) for current system, or
print offload runtime capabilities of current system,
or lookup information about offload architectures,
or print offload requirements for an application binary
Usage:
offload-arch [ Options ] [ Optional lookup-value ]
With no options, offload-arch prints the value for the first visible
offload-arch in the system. This can be used by various clang
frontends. For example, to compile for openmp offloading on your current
system, invoke clang with the following command:
clang -fopenmp -fopenmp-targets=`offload-arch` foo.c
If an optional lookup-value is specified, offload-arch will
check if the value is either a valid offload-arch or a codename
and display associated values with that offload-arch or codename.
For example, this provides all information for offload-arch gfx906:
offload-arch gfx906 -v
Options:
-m Print device code name (often found in pci.ids file)
-n Print numeric pci-id
-t Print clang offload triple to use for the offload arch.
-c Print offload capabilities of the current system.
This option is used by the language runtime to select an image
when multiple offload images are availble in the binary.
A capability must exist for each requirement of the selected image.
each compiled offload image built into an application binary file.
-a Print values for all devices. Don't stop at first visible device.
-v Verbose = -a -m -n -t
For all devices, print codename, numeric value and triple
The options -a and -v will show the offload-arch for all pci-ids that could
offload, even if they are not visible. Otherwise, the options -m, -n, -t,
or no option will only show information for the first visible device.
Other Options:
-h Print this help message
-f <filename> Print offload requirements including offload-arch for
each offload image compiled into an application binary file.
There are aliases (symbolic links) 'amdgpu-arch', 'nvidia-arch',
and 'intelhd-arch'to the offload-arch tool. These aliases return 1
if respectively, no AMD, no Nvidia, or no IntelHD GPUs are found.
These aliases are useful to determine if architecture-specific
offloading tests should be run, or to conditionally load
archecture-specific software.
Originally authored by Greg Rodgers (@gregrodgers).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106960
Files:
clang/tools/CMakeLists.txt
llvm/lib/CMakeLists.txt
llvm/lib/OffloadArch/CMakeLists.txt
llvm/lib/OffloadArch/OffloadArch.cpp
llvm/lib/OffloadArch/amdgpu/codename2offloadarch.txt
llvm/lib/OffloadArch/amdgpu/hsa-subset.h
llvm/lib/OffloadArch/amdgpu/pciid2codename.txt
llvm/lib/OffloadArch/amdgpu/vendor_specific_capabilities.cpp
llvm/lib/OffloadArch/intelhd/codename2offloadarch.txt
llvm/lib/OffloadArch/intelhd/pciid2codename.txt
llvm/lib/OffloadArch/intelhd/vendor_specific_capabilities.cpp
llvm/lib/OffloadArch/make_generated_offload_arch_h.sh
llvm/lib/OffloadArch/nvidia/codename2offloadarch.txt
llvm/lib/OffloadArch/nvidia/pciid2codename.txt
llvm/lib/OffloadArch/nvidia/vendor_specific_capabilities.cpp
llvm/lib/OffloadArch/offload-arch/CMakeLists.txt
llvm/lib/OffloadArch/offload-arch/offload-arch.cpp
openmp/libomptarget/src/CMakeLists.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106960.362374.patch
Type: text/x-patch
Size: 140218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210728/b9dc372c/attachment-0001.bin>
More information about the Openmp-commits
mailing list