This example demonstrates various compiler options and their outputs when using OpenMP target offloading. It showcases how to generate intermediate representations (IR), assembler files, and application binaries for both host and device.
- LLVM compiler with OpenMP support.
- A compatible GPU and the appropriate runtime environment.
To build the example and generate various outputs, run the following command:
make
This will generate:
- Host LLVM IR (
driver_tests_host.ll
). - Host LLVM bitcode (
driver_tests_host.bc
). - Host assembler (
driver_tests_host.s
). - Device LLVM bitcode (
driver_tests_device.bc
). - Disassembled device LLVM IR (
driver_tests_device.ll
). - Application binary (
driver_tests
).
To execute the application binary, use the following command:
make run
This will run the binary and display information about the host and target devices, including:
- Initial and default devices.
- Number of devices.
- Threads and teams on the target device.
To clean up the generated files, run:
make clean
This will remove all binaries and intermediate files created during the build process.