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

requirements

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

install

(python)

  • brew install pyenv
  • pyenv install 3.7.1

(venv)

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

examples(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)

examples(python)

TBD

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

runmetal-0.1-py3.7-macosx-10.13-x86_64.egg (10.1 kB view hashes)

Uploaded Source

runmetal-0.1-cp37-cp37m-macosx_10_13_x86_64.whl (10.0 kB view hashes)

Uploaded CPython 3.7m macOS 10.13+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page