0
我想在两个内核之间的OpenCL 2.0中实现管道。但是内核的编译失败,因为自变量的转换:OpenCL:从'int *'转换为'__generic int * __ generic *'
error: no matching function for call to 'write_pipe'
write_pipe(outputPipe, &value);
^~~~~~~~~~
note: candidate function not viable: no known conversion from 'int *' to '__generic int *__generic *' for 2nd argument
note: candidate function not viable: requires 4 arguments, but 2 were provided
生产者内核很简单:
__kernel void pipe_kernel(__write_only pipe int *outputPipe) {
int value = 1;
write_pipe(outputPipe, &value);
}
的write_kernel功能接口:
int write_pipe (pipe gentype p, const gentype *ptr)
主机代码中的管道设置为使用整数:
cl_mem pipe = clCreatePipe(context, CL_MEM_READ_WRITE, sizeof(int), elements, NULL, &status);
clSetKernelArg(pipe_kernel, 0, sizeof(cl_mem), &pipe);
是否有一个通用地址空间必须考虑管道?
非常感谢现在的工作如预期! – Objective