2
編譯以下代碼:缺少的OpenMP 4函數在GCC 4.8.2
#include <iostream>
#include <omp.h>
int main(int argc, char *argv[])
{
std::cout << omp_get_default_device() << '\n';
return 0;
}
與GNU G ++ 4.8.2,使用命令:
g++ -fopenmp test.cpp
導致以下錯誤消息:
test.cpp: In function ‘int main(int, char**)’:
test.cpp:6:39: error: ‘omp_get_default_device’ was not declared in this scope
std::cout << omp_get_default_device() << '\n';
我是否認爲omp_get_default_device
應該可以在並行區域之外調用?這是一個錯誤?
謝謝。我錯誤地將gcc.gnu.org上的GCC 4.8.2公告與隨後的OpenMP 4新聞關聯起來。 – user2023370