The LLVM compiler supports several accelerated programming models for GPUs. OpenMP is one of these programming models used to accelerate c, C++ and FORTRAN. Examples in these subdirectories demonstrate how to compile and execute c and C++ sources to use OpenMP target offload.
These are the c and C++ examples in the openmp examples category:
- hello A printf demo showing various levels of parallelism
- veccopy A simple vector copy in c
- vmulsum A simple vector multiply and sum in c
- reduction A simple parallel reduction in c
- print_device Prints the number of GPUs and the value of ROCR_VISIBLE_DEVICES to demonstrate gpurun.
- driver_tests Demo of various command line options
- declare_variant_if
- demo_offload_types Demo showing use of OMP_TARGET_OFFLOAD in various build types.
- vmul_template A C++ example
- atomic_vs_reduction Demo showing it's better to use a reduction than atomic update in a parallel loop.