我正在尝试在使用 Surface Objects 的 CUDA 5 中编译内核。但是,这似乎并不完全按照手册中的描述工作。
__global__ void kernel_reset(cudaSurfaceObject_t surf)
{
int x = blockIdx.x * blockDim.x + threadIdx.x;
int y = blockIdx.y * blockDim.y + threadIdx.y;
int z = blockIdx.z * blockDim.z + threadIdx.z;
surf3Dwrite(0u, surf, x * sizeof(unsigned int), y, z, cudaBoundaryModeTrap);
}
这无法编译:
error : no instance of overloaded function "surf3Dwrite" matches the argument list
我想要的重载在 surface_indirect_functions.h 中列为:
static __forceinline__ __device__ void surf3Dwrite(unsigned int data, cudaSurfaceObject_t surfObject, int x, int y, int z, cudaSurfaceBoundaryMode boundaryMode = cudaBoundaryModeTrap)
谁能告诉我我在这里做错了什么?
谢谢。