【问题标题】:error -9999 when trying to write into int * on GTX 980 and OpenCL尝试在 GTX 980 和 OpenCL 上写入 int * 时出现错误 -9999
【发布时间】:2015-05-29 14:37:38
【问题描述】:

我收到错误-9999

Breakpoint 7, cl::detail::errHandler (err=-9999, errStr=0x43cc1f "clWaitForEvents") at /opt/AMDAPPSDK-3.0-0-Be
ta/include/CL/cl.hpp:321

event.wait() 因为下面一行

valid[id] = 1;

其中有效的是__global int* valid

.cl 代码是

__kernel void validateRecords(__global const char* buffer, __global const struct RecordInfo* allRecords, __global int* valid, const unsigned int n)
{
    const int id=get_global_id(0);

    if (id < n)
    {
            char* record = buffer[allRecords[id].position];
            int size = allRecords[id].length;

            int updateTimeLen = findFixed(record, size, ',');
            if(updateTimeLen == -1 || updateTimeLen != UPDATE_TIME_LEN)
            {
               valid[id] = 1;
               return;
            }
    }

}

我得到错误

code -9999 atvalid[id] = 1.

我刚刚注意到,如果我评论 //valid[id] = 1;或 //int updateTimeLen = findFixed(record, size, ',');一切都很好,但是当两者都使用时,我得到了上述错误。

设备是带有 OpenCL 1.1 的 GTX 980。你能帮忙吗?

【问题讨论】:

  • 您的主机代码是什么样的?是否遗漏了任何初始化参数(输入/输出使用)?
  • 不,一切都初始化好了。

标签: opencl


【解决方案1】:

我想我找到了问题所在。首先,我在 Nvidia 卡上使用 AMD SDK。过去这对我来说效果很好(使用 GTX 780 Ti)。然而这一次我注意到了一些问题。第一个是这一行:

char* record = buffer[allRecords[id].position];

我最初(正确地)写成

char* record = buffer + allRecords[id].position;

但它没有编译,我机械地把它改成了上面的,它确实编译了。这是第一个问题,但它与错误无关。

第二个是无论我做什么,传递一个 __private char* 都会继续抛出错误 -9999(可能是因为不同的 SDK,但也可能是其他原因),所以我将 __global char* 缓冲区传递给函数一切正常。

【讨论】:

    猜你喜欢
    • 2018-01-06
    • 1970-01-01
    • 2012-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多