samedi 28 février 2015

CUDA SDK 6.5 - Samples/Common/inc/Helper_Math.h - Missing abs functionality


When I include Helper_Math.h file from the Samples/Commons directory and try to use abs(..) functionality, then I am getting compile errors.



phoad@phoad-ubuntu:~/development/obbcolgpu/build/obbcolgpu$ cmake --build .
[ 6%] Building CXX object CMakeFiles/http://ift.tt/1AVRSml
In file included from /home/phoad/development/obbcolgpu/src/../include/obbcol/Polynom.h:15:0,
from /home/phoad/development/obbcolgpu/src/../include/obbcol/RationalPolynom.h:4,
from /home/phoad/development/obbcolgpu/src/../include/obbcol/MotionMatrix.h:4,
from /home/phoad/development/obbcolgpu/src/MotionMatrix.cpp:1:
/usr/local/cuda-6.5/samples/common/inc/helper_math.h: In function ‘int2 abs(int2)’:
/usr/local/cuda-6.5/samples/common/inc/helper_math.h:1394:29: error: could not convert ‘v.int2::x’ from ‘int’ to ‘int2’
return make_int2(abs(v.x), abs(v.y));
^
/usr/local/cuda-6.5/samples/common/inc/helper_math.h:1394:39: error: could not convert ‘v.int2::y’ from ‘int’ to ‘int2’
return make_int2(abs(v.x), abs(v.y));
^
/usr/local/cuda-6.5/samples/common/inc/helper_math.h: In function ‘int3 abs(int3)’:
/usr/local/cuda-6.5/samples/common/inc/helper_math.h:1398:29: error: no matching function for call to ‘abs(int&)’
return make_int3(abs(v.x), abs(v.y), abs(v.z));


As seen, the library is unable to find "abs(int)" function.


I have manually updated the header to find the abs(int) function, but I am looking for a better solution..




Aucun commentaire:

Enregistrer un commentaire