Will the Metal framework be wrapped?

Issue #264 new
Aaron Elkins created an issue

Hey, do you have any plan to wrap the Metal framework into PyObjc?

Comments (4)

  1. Ronald Oussoren repo owner

    Maybe, but that will be a lot of work and requires some serious design work to get a usable API. It doesn't help that I have no use case for using these APIs myself.

    To be honest I'm still hoping that someone else builds something like PyOpenGL but for Metal instead of OpenGL.

  2. Aaron Elkins reporter

    Yep, I was thinking using PyOpenGL for my project, but since OpenGL is deprecated in the new macOS Mojave, so I think I should use Metal instead, but no Metal binding for Python.

    Hope there will be a good solution for Python in the near future.

  3. Yuan Chuan Kee

    I have been looking at this too.

    My use case is to use the MPS for machine learning as currently most popular ML framework such as Tensorflow and PyTorch only supports CUDA.

  4. Ronald Oussoren repo owner

    I agree that having bindings to the Metal framework would be useful, but creating these would likely require more time than I have available.

    That said, I just took a quick look at the headers and the main API appears to be a regular Objective-C class-based API and that should be fairly easy to wrap (although still quite some work due to the size of the API). A complicating factor is passing memory to/from Metal in a sane way, and possibly dealing with SIMD types (such as vector_float3).

    I'll definitely add looking into this to my list for the summer, but might get around to this earlier.

    Do you know if there are interesting, but simple, Objective-C examples for using Metal that could be used to functionally test a Python binding?

  5. Log in to comment