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
- calculate π by monte carlo
- rand
- random number generator (LCG)
examples(python)
TBD
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for runmetal-0.1-py3.7-macosx-10.13-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 651348d2e4526a239c4e498300b3d29afff149d70be99cb9904a26e5816c798e |
|
MD5 | 00550a42a42ba8218ae44cdde0597a90 |
|
BLAKE2b-256 | 24bc9ba10d5568a0f874d6cf77258491e7bf6a251d2bd7fdacb6c90dbf6d8bd9 |
Close
Hashes for runmetal-0.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96cb653a1273c3b6ad086b86ef0c42fd4a56e35e291826ace578b5fa6d31aff6 |
|
MD5 | 6a3207e918ce80f8547460f6d3f6cbd2 |
|
BLAKE2b-256 | 9a9072c5bd29639a79aa9d86375e5ee365e2de3bccdd4acaee60f37054fb7833 |