OpenCL将不同大小的多个数组传递给内核

时间:2014-12-10 17:41:16

标签: opencl

我想将两个不同大小的数组传递给内核,如何设置cl_ndrange

只有一个大小为NUM_VALUES的数组,范围可以轻松设置为

cl_ndrange range = { // 6
            1, // The number of dimensions to use.
            {0, 0, 0}, // The offset in each dimension. To specify
            // that all the data is processed, this is 0
            // in the test case. // 7
            {NUM_VALUES, 0, 0}, // The global range—this is how many items
            // IN TOTAL in each dimension you want to
            // process.
            {NULL, 0, 0} // The local size of each workgroup. This
            // determines the number of work items per
            // workgroup. It indirectly affects the
            // number of workgroups, since the global
            // size / local size yields the number of
            // workgroups. In this test case, there are
            // NUM_VALUE / wgs workgroups.
        };

但我不知道如何处理两个不同大小的数组。在我的例子中,一个数组实际上用作计算的输入,而另一个数组用于查找。

提前致谢。

0 个答案:

没有答案