PGI 不支持 OpenMP 4.5 运行时函数

OpenMP 4.5 runtime functions not supported in PGI

当我尝试编译以下代码时

#include <omp.h>
#include <stdio.h>
#include <accel.h>

int main (void) {
  int sum = 0;

  #pragma omp target teams distribute parallel for reduction(+:sum) defaultmap(tofrom:scalar)
  for(int i = 0 ; i < 2000000000; i++) {
    sum += i%11;
  }

  printf("sum = %d\n",sum);

  printf("devices %d\n", omp_get_num_devices());
  printf("default device %d\n", omp_get_default_device());
  printf("device id %d\n", omp_get_initial_device());
  return 0;
}

pgc++ -mp foo.cpp

我收到错误

error: identifier "omp_get_num_devices" is undefined

其余的 OpenMP 运行时函数也未定义。使用 gcc7 可以很好地编译代码。 PGI 17.10 社区版编译器是否支持这些函数?根据他们的网站,PGI 17.10 社区版编译器支持 OpenMP 4.5。我做错了什么?

我用 Ubuntu 16.04 和 17.04 试过了。

PGI added support for the tasking, binding, SIMD, synchronization, reduction, atomic and other CPU features for Linux/OpenPOWER CPUs in 17.7. These features are supported in the 18.1 release of the PGI LLVM compilers for Linux x86-64. PGI is planning to start working on the OpenMP 4.x target features in 2018.

更多详情:https://www.pgroup.com/resources/accel.htm#openmp