如何检查 openCL 中事物的引用计数器?

发布于 2024-10-16 07:29:46 字数 262 浏览 11 评论 0原文

http://www.khronos.org/registry/cl/ sdk/1.1/docs/man/xhtml/

我不明白如何检查 openCL 上下文的引用计数。它是如何完成的?是否有函数调用或字段?我尝试谷歌搜索,但无法弄清楚。我尝试调试和检查(使用 JOCL 和 Java),但没有看到任何东西。让我知道。

http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/

I don't understand how to check the reference count for say, an openCL context. How is it done? Is there a function call or field? I tried googling and I couldn't figure it out. I tried debugging and inspecting (using JOCL and Java) and I didn't see anything. Let me know.

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

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

发布评论

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

评论(2

执笔绘流年 2024-10-23 07:29:46

您实际上不应该阅读引用计数,因为这些信息毫无意义。当(假设的 clReadReferenceCount_NOT_REAL)函数返回并且您获得引用计数值时,其他线程可能已经增加和/或减少了引用计数。访问引用计数的唯一方法是通过 glRetain*/clRelease* 函数,这些函数仅用于递增和递减(不读取值),就像并发编程中的信号量一样。

You're not really supposed to read the reference counts, because the information would be meaningless. By the time the (hypothetical clReadReferenceCount_NOT_REAL) function returns and you'd get the reference count value, other threads may have incremented and/or decremented the reference count. The only way you're supposed to access the reference count is through glRetain*/clRelease* -functions, which are used for incrementing and decrementing only (not reading the value), like a semaphore in concurrent programming.

只是我以为 2024-10-23 07:29:46

看一下 clRetain*/clRelease* 函数。我猜你被否决了,因为它们很容易找到。但那不是我。

Take a look clRetain*/clRelease* functions. I guess you were downvoted because they can be found very easily. It wasn't me though.

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