I am a new beginer on Mac
I have already installed the PGI on my macbook, and have a test with pgc++, but my code can’t be compiled
my code is
#include <iostream>
#ifdef _OPENACC
#include <openacc.h>
#endif
using namespace std;
int main() {
#ifdef _OPENACC
const int N = 1024;
//定义
int i, a[N], b[N], c[N];
for (i = 0; i < N; i++) {
c[i] = 0;
a[i] = b[i] = i;//�始化a数组
}
#pragma acc kernels
for (i = 0; i < N; i++) {
c[i] = b[i] + a[i];
}
#else
cout << "not support OpenACC" << endl;
#endif
std::cout << c[1] << std::endl;
return 0;
}
and the wrong info is:
MacBook13:TestOpenCV Chen$ pgc++ -acc -std=c++11 -Minfo main.cpp
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 93: error: pair is not a
template
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 97: error: pair is not a
template
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 98: error: pair is not a
template
get(pair<_T1, _T2>&) _NOEXCEPT;
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 102: error: pair is not a
template
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 103: error: pair is not a
template
get(const pair<_T1, _T2>&) _NOEXCEPT;
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 108: error: pair is not a
template
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
^
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/__tuple", line 109: error: pair is not a
template
get(pair<_T1, _T2>&&) _NOEXCEPT;
^
7 errors detected in the compilation of "main.cpp".
How can I resolve it? wish for your help~~I am a new on macbook