Hi Cédric, On Fri, Aug 17, 2012 at 6:04 PM, Cédric LACZNY <[email protected]> wrote: > Executing the python script now, gives me the following error: > > pycuda.driver.CompileError: nvcc compilation of /tmp/tmpe1ZS7Z/kernel.cu > failed > [command: nvcc --cubin -arch sm_20 > -I/home/clusterusers/claczny/local/lib/python2.6/dist-packages/pycuda-2012. > 1-py2.6-linux-x86_64.egg/pycuda/../include/pycuda kernel.cu] > [stderr: > kernel.cu(9) Error: use of external function _Z11func_helperv is not > supported > ]
PyCuda processes SourceModule() call by creating a tempoprary .cu file with the passed string somewhere in the /tmp and feeding it to nvcc. Therefore, if "func_helper.cuh" is somewhere where nvcc can find it, it gets included, because it is mentioned explicitly. But nvcc does not know about the existence of "func_helper.cu", therefore it is not getting compiled, and your func_helper() does not have an implementation. Based on that logic you can solve your problem in different ways, for example by putting all the stuff that you need into explicitly included header files. Alternatively, you can manually call nvcc (from Python) and use pycuda.driver.module_from_file(). I'm not sure if there is a best practice to handle cases of large custom .cu-based libraries. _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
