Hello,
I hope you are all fine and look forward to your help.
I am trying to compile and run, on a GPU NVIDIA GeForce GTX 1060, a C program using Linux Ubuntu 22.04.1 LTS.
First I followed these steps to install LLVM: Install LLVM on Ubuntu 22.04 (linuxhint.com)
I tried to compile this program:
#include
int main(){
int N = 1e8;
float *x = new float[N];
float *y = new float[N];
#pragma omp target teams distribute parallel for map(to: x[0:N]) map(from: y[0:N])
for(int i = 0; i < N; i++){
for(int j = 0; j < 1000; j++){
y[i] += 3*x[i];
}
}
printf(“%g\n”, y[5]);
delete x;
delete y;
}
Script to compile: clang++ -fopenmp -fopenmp-targets=nvptx64 -O3 run.cpp && time ./a.out
And I received the error on the subject.
Then I followed these steps: Build Clang with OpenMP Target Offloading for NVIDIA GPUs · GitHub
And I received the same error.
So now, my questions are:
- How can I compile and run, on the indicated GPU, the program above, using LLVM?
- How can I determine which versions of LLVM (clang) I have installed in my Linux?
- How can I remove from my Linux the versions of LLVM that I am not interested in having?
Thank you very much in advance.
Best regards,
David.