Windows Mobile 上的 GPU 访问
我正在为 Windows Mobile 6.5 构建一个应用程序,我想知道是否有任何方法可以硬件加速各种计算。我想让 GPU 为应用程序完成一些工作,而不是依赖 CPU 来完成所有工作。
我想使用 C#,但如果不可能,那么 C++ 就可以了。
感谢您的指导!
编辑-
我想要卸载到 GPU 的计算类型的一个示例是计算 25-100 个不同矩形的位置,以便将它们放置在屏幕上。这只是一个简单的示例,但我目前一直在单独的线程上进行此类计算,因此我认为(因为它是几何计算)它将是 GPU 的主要候选者。
I am building an app for Windows Mobile 6.5 and I was wondering if there is any way to hardware accelerate various calculations. I would like to have the GPU do some of the work for the app, instead of relying on the CPU to do everything.
I would like to use C#, but if that is not possible, then C++ is just fine.
Thanks for any guidance!
EDIT-
An example of the types of calculations I want to offload to the GPU would be things like calculating the locations of 25-100 different rectangles so they can be placed on the screen. This is just a simple example, but I've currently been doing these kinds of calculations on a seperate thread, so I figured (since it's geometry calculations) it would be a prime candidate for GPU.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了完全回答你的问题,我需要更多关于你试图执行哪些计算的详细信息,但简短的答案是否定的,Windows Mobile 设备中的 GPU 和 Microsoft 公开的 SDK 不适合 GPGPU(图形硬件上的通用计算) )。
当 GPU 开始通过 DirectX9(以及 8 中的有限支持)提供可编程顶点和像素着色器时,GPGPU 才真正变得实用。 Windows Mobile 6.5 设备使用的 GPU 与 DirectX8 周围的 GPU 更加相似,并且没有可编程顶点和像素着色器:
http://msdn.microsoft.com/en-us/library/aa920048.aspx
即使在具有 GPGPU 库(例如 CUDA)的现代桌面显卡上,将计算卸载到 GPU 时获得性能提升也不是一件容易的事。计算必须本质上适合 GPU(即能够大规模并行运行,并且在任何内存上执行足够的计算以抵消将其传输到 GPU 并返回的成本)。
但这并不意味着无法在 Windows Mobile 6.5 上使用 GPU 加速计算速度。有一小部分问题可以映射到无需着色器的固定功能管道。如果您可以弄清楚如何通过渲染多边形并读回生成的图像来解决您的问题,那么您可以使用 GPU 来完成此操作,但您需要执行的计算不太可能合适,或者不太可能值得付出努力去尝试。
To fully answer your question I would need more details about what calculations you are trying to perform, but the short answer is no, the GPUs in Windows Mobile devices and the SDK Microsoft exposes are not suitable for GPGPU(General-Purpose Computation on Graphics Hardware).
GPGPU really only became practical when GPUs started providing programmable vertex and pixel shaders with DirectX9(and limited support in 8). The GPUs used with Windows Mobile 6.5 devices are much more similar to those around DirectX8, and do not have programmable vertex and pixel shaders:
http://msdn.microsoft.com/en-us/library/aa920048.aspx
Even on modern desktop graphics cards with GPGPU libraries such as CUDA, getting performance increases when offloading calculations to the GPU is not a trivial task. The calculations must be inherently suited to GPUS( ie able to run massively in parallel, and enough calculations performed on any memory to offset the cost of transferring it to the GPU and back ).
That does not mean it is impossible to speed up calculations with the GPU on Windows Mobile 6.5, however. There is a small set problems that can be mapped to a fixed functions pipeline without shaders. If you can figure out how to solve your problem by rending polygons and reading back the resulting image, then you can use the GPU to do it, but it is unlikely that the calculations you need to do would be suitable, or that it would be worth the effort of attempting.