编译为 SPIR-V 的 OpenCL .cl 文件是否可以交叉编译为 Metal?
就上下文而言,我正在研究对工作中的 OpenCL 代码进行升级,因为我们远远落后于当前的规范。我工作的团队在所有三个主要操作系统上进行开发,据我所知,Apple 在其任何机器上都不支持过去的 OpenCL 1.2,而是提示您学习和使用 Metal 性能着色器。 我想将 OpenCL 的代码库更新为 C++,它基于 OpenCL 2.0 或 3.0,具体取决于您使用的版本。 OpenCL 的 C++ 在 Windows 和 Linux 上运行良好,因为它们具有支持达到或超过 2.0 要求的 GPU 驱动程序,但如果没有驱动程序的官方支持,Mac 可能会出现问题。因此,我的想法是,如果我们能够将 CL 内核交叉编译为 Mac 用户的 Metal,他们将能够在本地运行 Metal 版本的代码。
有没有人对这个问题有任何解决方案。
For context, I am researching upgrades into our OpenCL code at work as we are quite far behind current spec. The team I work in develops on all three of the major OSes and as far as I can tell Apple doesn't support past OpenCL 1.2 on any of their machines instead prompting you to learn and use Metal performance shaders.
I would like to update our code base to C++ for OpenCL which is based on OpenCL 2.0 or 3.0 depending on which version you use. C++ for OpenCL is fine on Windows and Linux as they have GPU drivers which support up to and past the 2.0 requirement, but Mac might have a problem with it without official support in the drivers. So I had the idea that if we could cross compile the CL kernels to Metal for the Mac users they would be able to run a Metal version of the code locally.
Has anyone got any solutions to this problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论