如何检查 openCL 中事物的引用计数器?
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您实际上不应该阅读引用计数,因为这些信息毫无意义。当(假设的 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.
看一下 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.