Changes

Jump to: navigation, search

GPU621/GPU Targeters

456 bytes added, 14:28, 4 December 2020
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
51
edits

Navigation menu