Conflict between gcc parallel mode stc and nvcc

I am encountering a conflict between nvcc and gcc 4.8.4 and cuda8.0. When I compile the following code to a.cu:

#include <parallel/algorithm>

int main(){
}

      

with cmd:, nvcc -std=c++11 -arch=sm_20 a.cu -o a.o

I got the following error message:

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/include/c++/4.8/tr1/cmath(423): error: function "acosh(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(439): error: function "asinh(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(456): error: function "atanh(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(470): error: function "cbrt(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(486): error: function "copysign(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(505): error: function "erf(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(519): error: function "erfc(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(535): error: function "exp2(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(549): error: function "expm1(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(587): error: function "fdim(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(605): error: function "fma(float, float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(621): error: function "fmax(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(637): error: function "fmin(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(656): error: function "hypot(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(672): error: function "ilogb(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(688): error: function "lgamma(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(702): error: function "llrint(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(716): error: function "llround(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(733): error: function "log1p(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(748): error: function "log2(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(762): error: function "logb(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(778): error: function "lrint(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(792): error: function "lround(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(806): error: function "nearbyint(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(820): error: function "nextafter(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(854): error: function "remainder(float, float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(870): error: function "remquo(float, float, int *)" has already been defined

/usr/include/c++/4.8/tr1/cmath(886): error: function "rint(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(900): error: function "round(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(914): error: function "scalbln(float, long)" has already been defined

/usr/include/c++/4.8/tr1/cmath(928): error: function "scalbn(float, int)" has already been defined

/usr/include/c++/4.8/tr1/cmath(948): error: function "tgamma(float)" has already been defined

/usr/include/c++/4.8/tr1/cmath(962): error: function "trunc(float)" has already been defined

33 errors detected in the compilation of "/tmp/tmpxft_00001e82_00000000-9_a.cpp1.ii".

      

I think this is a conflict between the parallel mode gcc STC code and nvcc. Do you have a solution to fix this? Any info will help, thanks!

+3


source to share





All Articles