List cuda中的指针列表? \uuuuu全局\uuuuuu无效finalImageGathering(float3*列表[]){ 无符号整数x=blockIdx.x*blockDim.x+threadIdx.x; 无符号整数y=blockIdx.y*blockDim.y+threadIdx.y; 浮动3试验; 对于(inti=0;i

List cuda中的指针列表? \uuuuu全局\uuuuuu无效finalImageGathering(float3*列表[]){ 无符号整数x=blockIdx.x*blockDim.x+threadIdx.x; 无符号整数y=blockIdx.y*blockDim.y+threadIdx.y; 浮动3试验; 对于(inti=0;i,list,pointers,cuda,List,Pointers,Cuda,您可以做到这一点,CUDA对指针间接寻址没有特别的限制,除了函数指针之外(这种限制在最近的硬件上也大多没有)。更复杂的是为这样一个设备指针数组分配内存,并在需要时将其复制到主机内存或从主机内存复制。您可能需要先正确格式化此文件,并澄清您的问题所在。 __global__ void finalImageGathering(float3 *lists[]) { unsigned int x = blockIdx.x*blockDim.x + threadIdx.x; unsigned

您可以做到这一点,CUDA对指针间接寻址没有特别的限制,除了函数指针之外(这种限制在最近的硬件上也大多没有)。更复杂的是为这样一个设备指针数组分配内存,并在需要时将其复制到主机内存或从主机内存复制。

您可能需要先正确格式化此文件,并澄清您的问题所在。
__global__ void finalImageGathering(float3 *lists[]) {
    unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;
    unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;
    float3 test;
    for(int i = 0; i<Blah; i++)
        test += lists[i][y * width + x];
}