You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have extended the example that is described in the readme to print out the thread id. The code then looks like this:
#include<stdio.h>extern"C"// ensure function name to be exactly "vadd"
{
__global__voidvadd(constfloat*a, constfloat*b, float*c)
{
inti=threadIdx.x+blockIdx.x*blockDim.x;
printf("Thread id %d\n", i);
c[i] =a[i] +b[i];
}
}
I then compile this code to ptx using:
nvcc -ptx -arch=sm_20 vadd.cu
The -arch=sm_20 is added to make the printf work. However, now I cannot load the module into Julia anymore. It keeps complaining about an invalid kernel image:
ERROR: 200
in error at error.jl:22
in include_from_node1 at loading.jl:120
while loading /var/cache/workdir/pfverstr/test2.jl, in expression starting on line 16
However, the code does work when I execute the same calls to libcuda (cuInit, cuDeviceGet, cuCtxCreate and cuModuleLoad) from a program written in C++.
I have extended the example that is described in the readme to print out the thread id. The code then looks like this:
I then compile this code to ptx using:
The -arch=sm_20 is added to make the printf work. However, now I cannot load the module into Julia anymore. It keeps complaining about an invalid kernel image:
However, the code does work when I execute the same calls to libcuda (cuInit, cuDeviceGet, cuCtxCreate and cuModuleLoad) from a program written in C++.