【发布时间】:2016-06-23 11:09:14
【问题描述】:
我需要使用 async_work_group_copy 将一些数据从 __global 复制到 openCL 中的 __local。问题是,我没有使用内置数据类型。
我尝试过的代码片段如下:
typedef struct Y
{
...
} Y;
typedef struct X
{
Y y[MAXSIZE];
} X;
kernel void krnl(global X* restrict x){
global const Y* l = x[a].y;
local Y* l2;
size_t sol2 = sizeof(l);
async_work_group_copy(l2, l, sol2, 0);
}
其中 'a' 只是一个 int 向量。此代码不起作用,特别是因为 gen_type 不是内置的。规格(1.2)说:
我们使用泛型类型名 gentype 来表示内置数据 types ... 作为参数的类型,除非另有说明。
那么我该如何声明这种数据类型呢?
【问题讨论】:
标签: opencl