https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100160
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vries at gcc dot gnu.org
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Test-case updated: removed commented out lines, formatted, printing
omp_get_thread_num to get some printout that is not all zeroes:
...
#include <iostream>
#include <omp.h>
using namespace std;
int threads = omp_get_max_threads ();
int devices = omp_get_num_devices ();
int i, j[100];
int
main (void)
{
printf ("Threads: %d Devices: %d\n", threads, devices);
#pragma omp target teams distribute parallel for shared(j)
for(i = 0; i < 100; i++)
j[i] = omp_get_thread_num ();
for (i = 0; i < 100; i++)
printf ("%d ", j[i]);
return 0;
}
...
On ubuntu, we have:
...
$ ./install/bin/g++ test-1.cpp -fopenmp -foffload=nvptx-none -fno-lto
$ LD_LIBRARY_PATH=./install/lib64 ./a.out
Threads: 8 Devices: 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 3
3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6
6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7
$
...
And:
...
$ ./install/bin/g++ test-1.cpp -fopenmp -foffload=nvptx-none
lto-wrapper: fatal error: could not find accel/nvptx-none/mkoffload in
/home/vries/oacc/trunk/install/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/:/home/vries/oacc/trunk/install/bin/../libexec/gcc/
(consider using ‘-B’)
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
...
So, there might be something windows-specific that is going wrong.
But things seems to already go wrong on linux.