I am using cmake 2.8.1 on Mac OSX 10.6 with CUDA 3.0.
So, I added a CUDA target for which BLOCK_SIZE is set to some number to compile.
cuda_add_executable(SimpleTestsCUDA
SimpleTests.cu
BlockMatrix.cpp
Matrix.cpp
)
set_target_properties(SimpleTestsCUDA PROPERTIES COMPILE_FLAGS -DBLOCK_SIZE=3)
At startup, make VERBOSE=1I noticed that nvccw / o is being called -DBLOCK_SIZE=3, which leads to an error, because it is BLOCK_SIZEused in the code, but not defined anywhere. Now I used the same definition for the target processor (using add_executable(...)), and there it worked.
So now the questions are: How do I find out what cmakedoes a line do set_target_propertiesif it points to a CUDA target? Riding around has not helped so far, and a workaround would be cool.
source
share