Skip to main content

run Apple Metal framework

Project description

runmetal: call Apple Metal Framework from Python (or YAML-recipe)

  • numpy array -> GPU buffer -> compute -> copy result into numpy array


  • macOS
  • Xcode (or CommandLineTools)
    • Metal Framework
  • Python 3.x



  • brew install pyenv
  • pyenv install 3.7.1


  • python -m venv .
  • ./bin/pip install -r requirements.txt
  • ./bin/python install
  • ./bin/runmetal run example/xxx.yaml


  • pi
    • calculate π by monte carlo
      • numpy.random.random()
      • -> copy numpy to GPU buffer
      • -> compute sqrt(xx+yy) < 1.0
      • -> copy GPU buffer to numpy bool8 array
      • numpy.sum(result == True)/len(result)*4
    • runmetal run example/pi.yaml
  • rand
    • random number generator (LCG)



Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for runmetal, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size runmetal-0.1-cp37-cp37m-macosx_10_13_x86_64.whl (10.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size runmetal-0.1-py3.7-macosx-10.13-x86_64.egg (10.1 kB) File type Egg Python version 3.7 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page