* Experiment6: learn how to use OpenARC's built-in interactive debugging tools
* Experiment6: learn how to use CUDA with OpenACC.
- Task1: learn how to use CUDA with OpenACC.
- To use CUDA with OpenACC, 1) use OpenACC acc_map_data()/acc_unmap_data() APIs for OpenACC program to be able to use CUDA-gerenated device data, or use OpenACC host_data directive (#pragma acc host_data ...) for CUDA program to use OpenACC-generated device data, and
2) compile the OpenARC-generated output program and original input CUDA program together using the NVCC compiler (nvcc).
- Task2: compile and run matmul_openacc_cuda example.
$ cd ${openarcexamples}/matmul_openacc_cuda
//Check the input CUDA file where CUDA code is mixed with OpenACC code.
$ vi ./matmul.cu
//Run the OpenARC compiler.
$ ./O2GBuild.script
//Check the generated output files.
$ vi ./cetus_output/acc_helper.cpp
//Compile the generated output files.
$ make
//Submit a job to run the output program.
$ cd bin; sbatch gpu.sh
* Experiment7: learn how to use OpenACC extensions supported by OpenARC.
- Task1: learn how to use OpenACC extensions supported by OpenARC.
- OpenACC extensions supported by OpenARC allows programmers to express CUDA-like, device-specific optimizations at the OpenACC level.
$ cd ${openarcexamples}/matmul_openacce
//Check the input CUDA file where CUDA code is mixed with OpenACC code.
$ vi ./matmul.cu
- Task2: compile and run matmul_openacce example.
$ cd ${openarcexamples}/matmul_openacce
//Run the OpenARC compiler.
$ ./O2GBuild.script
//Check the generated output files.
$ vi ./cetus_output/openarc_kernel.cu
$ vi ./cetus_output/matmul.cpp
//Compile the generated output files.
$ make
//Submit a job to run the output program.
$ cd bin; sbatch gpu.sh
* Experiment8: learn how to use OpenARC's built-in interactive debugging tools
- Task1: learn how to use OpenARC's built-in interactive debugging tools.
- Use commandline option programVerification:
- programVerification=1 //verify the correctness of CPU-GPU memory transfers