Qt 的 CUDA 包装器
Qt 为 Opencl 发布了一个很好的包装器( QtOpencl ),它在隐藏大量样板并使 OpenCL 能够与 Qt 的显示小部件和 Opengl 很好地配合。
但有一些事情我可以在 Cuda 中比 OpenCL 做得更好,而且 Cuda 工具更加成熟。
制作一个简单的 Cuda C++ 包装器并将其集成到 Qt 构建过程中相对容易,但我想知道是否有人做了更多的事情?理想情况下是一个等效的 QtCuda 库。
Qt 人们对 Cuda 支持不感兴趣,因为它没有足够的跨平台
编辑:仅用于搜索,有一个 openGL PBO 的 Qt CUDA 包装器。它基于 Dr Dobbs 简单的 PBO 示例。需要修复一些错误才能使其与 Cuda4 很好地配合,但这是一个好的开始。
PS:无法联系博客作者,评论也不起作用 - 如果他发现此问题请告诉我,我将发送修复程序。
Qt have released a nice wrapper for Opencl ( QtOpencl ) which does a very good job of hiding a lot of boiler plate and making OpenCL play nicely with Qt's display widget and Opengl.
But there are a few things that I can do better in Cuda than OpenCL and the Cuda tools are much more mature.
It's relatively easy to make a simple Cuda C++ wrapper and integrate into the Qt build process but I wondered if anybody had done anything more? Ideally an equivalent QtCuda library.
The Qt people aren't interested in Cuda support because it's not cross platform enough
edit: Just for search, there is a Qt CUDA wrapper for openGL PBO. It's based on the Dr Dobbs simplePBO example. There are a couple of bugs fixes needed to make it play nicely with Cuda4 but it's a good start.
ps there is no way to contact the author of the blog and comments don't work - if he finds this let me know and i will send the fixes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
。如果你想忽略这一点,那你就没有理解Qt的哲学。为什么要创建更多旧代码,同时可以使用 MultiscaleLab Swan 轻松将现有内核转换为 OpenCL?
但该库的源代码可以免费下载并用作基础。
Exactly. If you want to ignore this, you don't understand Qt's philosophy. And why create even more legacy-code, while it's easy to translate your existing kernels to OpenCL with MultiscaleLab Swan?
But the source of the library is free to download and used as a base.
我的方法是在 Visual Studio 中构建一个 DLL,在正常的 C 导出函数中扭曲 CUDA 函数调用。他们使用 QT IDE 中的
LoadLibrary
和GetProcAddress
。总而言之,效果非常好。The way I did it was to build a DLL in Visual Studio, warped CUDA Function call among normal C exported functions. They used
LoadLibrary
andGetProcAddress
from QT IDE. All in all, it worked quite well.