from pycuda.compiler import SourceModule
mod = SourceModule("""
__global__ void multiply_them(float *dest, float *a, float *b)
{
const int i = threadIdx.x;
dest[i] = a[i] * b[i];
}
""")
这是结果:
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
File "C:\Program Files\Anaconda3\lib\site-packages\pycuda\compiler.py", line 265, in __init__
arch, code, cache_dir, include_dirs)
File "C:\Program Files\Anaconda3\lib\site-packages\pycuda\compiler.py", line 255, in compile
return compile_plain(source, options, keep, nvcc, cache_dir, target)
File "C:\Program Files\Anaconda3\lib\site-packages\pycuda\compiler.py", line 137, in compile_plain
stderr=stderr.decode("utf-8", "replace"))
pycuda.driver.CompileError: nvcc compilation of C:\Users\whyno\AppData\Local\Temp\tmpkv6oyxif\kernel.cu failed
[command: nvcc --cubin -arch sm_50 -m64 -Ic:\program files\anaconda3\lib\site-packages\pycuda\cuda kernel.cu]
我已经在Anaconda shell中使用pip安装了pyCuda,并且我正在使用Microsoft Visual Studio 14.0。按照这些步骤,我已经在nvcc.profile中添加了以下行:
COMPILER-BINDIR = C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64
但它总是返回相同的错误。谢谢。