This directory contains five examples illustrating a simple "Hello World" program executed in different modes using OpenMP.
- hello1: Runs on the CPU.
- hello2: Runs in parallel on the CPU, distributed across threads.
- hello3: Runs on the GPU.
- hello4: Runs in parallel on the GPU, distributed across threads.
- hello5: Runs in parallel on the GPU, distributed across teams and threads.
- LLVM compiler with OpenMP support.
- A compatible GPU and the appropriate runtime environment.
To build all examples, run:
make
This will generate the following binaries:
hello1
hello2
hello3
hello4
hello5
To execute all examples, use:
make run
This will run each binary and display the output for the respective example.
- hello1: Prints a message from the CPU and checks if it is running on the initial device.
- hello2: Prints messages from multiple threads running in parallel on the CPU.
- hello3: Prints a message from the GPU and checks if it is running on the initial device.
- hello4: Prints messages from multiple threads running in parallel on the GPU.
- hello5: Prints messages from multiple threads and teams running in parallel on the GPU.
To clean up the generated files, run:
make clean
This will remove all binaries and intermediate files created during the build process.