如何阻止没有阻止参数的命令“clEnqueueFillImage”?

发布于 2025-01-15 05:40:17 字数 291 浏览 3 评论 0原文

在函数“clEnqueueFillImage”的源代码中,它想要阻止该命令,但我不知道如何在没有阻止参数的情况下阻止它?

{
     iResult = OCL_Flush(psCommandQueue);
     if (iResult != CL_SUCCESS)
     {
          PVR_DPF((PVR_DBG_ERROR, "Failed implicit flush before blocking write."));
          goto exit;
    }
}```

In the source code of funciton "clEnqueueFillImage",it want to blocking the command but I don't figure out how to blocking it without the blocking argument?

{
     iResult = OCL_Flush(psCommandQueue);
     if (iResult != CL_SUCCESS)
     {
          PVR_DPF((PVR_DBG_ERROR, "Failed implicit flush before blocking write."));
          goto exit;
    }
}```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烛影斜 2025-01-22 05:40:17

与 OpenCL 中的许多其他函数一样,clEnqueueFillImage 具有事件输出参数。从文档中:

返回标识此特定写入的事件对象
命令,可用于查询或排队等待此特定的
命令来完成。事件可以为 NULL,在这种情况下它不会
应用程序可以查询该命令的状态或
排队等待此命令完成。

所以你可以简单地使用返回的事件:

cl_event sync_event{};
CL_CHECK_ERROR(clEnqueueFillImage(... , &sync_event);
CL_CHECK_ERROR(clWaitForEvents(1, &sync_event));

clEnqueueFillImage, like many other functions in OpenCL, has and event out parameter. From the documentation:

Returns an event object that identifies this particular write
command and can be used to query or queue a wait for this particular
command to complete. event can be NULL in which case it will not be
possible for the application to query the status of this command or
queue a wait for this command to complete.

So you could simply use the returned event:

cl_event sync_event{};
CL_CHECK_ERROR(clEnqueueFillImage(... , &sync_event);
CL_CHECK_ERROR(clWaitForEvents(1, &sync_event));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文