仅限AMD上的OpenCL:CL_INVALID_ARG_SIZE

时间:2017-11-02 13:00:43

标签: opencl amd

我有一个内核可以在我有权访问的所有平台上运行,但AMD app SDK SDK有intel。 该平台为:OpenCL.Device(Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz on AMD Accelerated Parallel Processing

MWE(对不起,这是朱莉娅,但是电话应该与C中的几乎相同):

using OpenCL
test_source = "
struct __attribute__((packed)) Test{
    float3 f1;
    int f2;
    float f3;
};
__kernel void structest(struct Test a){}
"
device = first(cl.devices())
ctx = cl.Context(device)
prg = cl.Program(ctx, source = test_source)
queue = cl.CmdQueue(ctx)
cl.build!(prg)
structkernel = cl.Kernel(prg, "structest")
astruct = ((1f0, 2f0, 3f0, 0f0), Int32(0), 22f0)

sizeof(astruct)
# == 24 exactly the same as what sizeof(struct Test a) in the kernel returns

astruct_boxed = Ref(astruct)
cl.@check cl.api.clSetKernelArg(structkernel.id, cl.cl_uint(0), sizeof(astruct), astruct_boxed)

所以我已经确认,sizeof(astruct)的大小和内核中的大小匹配,但我仍然遇到CL_INVALID_ARG_SIZE错误。这是一个错误还是我错过了什么?

0 个答案:

没有答案