小编mar*_*993的帖子

为什么OpenCL的Intel Kernel Builder告诉我我的内核没有矢量化?

我是在一个有限的区域内编写一个内核来添加两个三维矩阵.我有我的代码

#define PREC float

typedef struct _clParameter clParameter;
struct _clParameter {
    size_t width;
    size_t minWidth;
    size_t maxWidth;
    size_t height;
    size_t minHeight;
    size_t maxHeight;
    size_t depth;
    size_t minDepth;
    size_t maxDepth;
};

__kernel void clMatrixBasicOperate1Add(
    __global const PREC * restrict in1,
    __global const PREC * restrict in2,
    __global PREC * restrict out,
    __private const clParameter par) {

    size_t sizeOfXY = par.width * par.height;

    // 3-Dimension matrix

    size_t X = get_global_size(0);
    size_t x = get_global_id(0);

    size_t Y = get_global_size(1);
    size_t y = get_global_id(1); …
Run Code Online (Sandbox Code Playgroud)

c linux intel opencl

3
推荐指数
1
解决办法
1323
查看次数

标签 统计

c ×1

intel ×1

linux ×1

opencl ×1