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.

Built Distributions

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

Uploaded 3 7

Supported by

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