51
edits
Changes
→Instructions for AMD
clang -fopenmp helloWorld.c -o helloWorld
./helloWorld
</pre>
Hello world on GPU example
<pre>
// File helloWorld.c
#include <omp.h>
#include <stdio.h>
int main()
{
#pragma omp target
#pragma omp parallel
{
printf("Hello world from GPU!");
}
}
</pre>
<pre>
export AOMP="/usr/lib/aomp"
export PATH=$AOMP/bin:$PATH
export LIBOMPTARGGET_KERNEL_TRACE=1
clang -O2-fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=gfx803 helloWorld.c -0 helloWorld
./helloWorld