【问题标题】:OpenCL error "parameter may not be qualified with an address space"OpenCL 错误“参数可能不符合地址空间”
【发布时间】:2017-11-05 00:09:40
【问题描述】:

我有以下 OpenCL 内核代码:

kernel void mandelbrot(global write_only image2d_t output_image)
{
    int2 pos = { get_global_id(0), get_global_id(1) };
    write_imageui(output_image, (int2)(pos.x, pos.y), (uint4)(254, 0, 0, 254));
}

构建程序时,我收到以下错误消息:

:1:52: 错误:参数可能没有用地址空间限定

:1:31: 警告:访问限定符只能应用于图像类型

OpenCL 程序构建错误代码:-11

输出图像只能创建为一维数组吗?

【问题讨论】:

    标签: opencl


    【解决方案1】:

    图像类型不需要任何地址空间限定符。

    OpenCL C 规范 6.5.1:

    由于图像对象始终从全局地址空间分配,因此不应为图像类型指定 __global 或 global 限定符。

    https://www.khronos.org/registry/OpenCL/specs/opencl-2.0-openclc.pdf

    【讨论】:

      猜你喜欢
      • 2013-09-05
      • 1970-01-01
      • 2019-07-07
      • 2015-02-17
      • 1970-01-01
      • 2012-07-02
      • 1970-01-01
      • 2021-12-30
      • 1970-01-01
      相关资源
      最近更新 更多