Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/titouanc/ipython-futhark
Embed Futhark code in iPython Notebook / Jupyter
https://github.com/titouanc/ipython-futhark
futhark gpgpu interactive ipython
Last synced: 8 days ago
JSON representation
Embed Futhark code in iPython Notebook / Jupyter
- Host: GitHub
- URL: https://github.com/titouanc/ipython-futhark
- Owner: titouanc
- License: mit
- Created: 2017-07-15T00:17:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T18:03:53.000Z (almost 4 years ago)
- Last Synced: 2024-09-19T00:28:37.086Z (about 2 months ago)
- Topics: futhark, gpgpu, interactive, ipython
- Language: Jupyter Notebook
- Size: 11.7 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ipython-futhark
Embed [Futhark](http://futhark-lang.org) code into your favourite IPython
shells and Notebooks.## Install
You should have a working version of Futhark in your `$PATH`. To do so, read
the installation instructions on
[readthedocs.io](https://futhark.readthedocs.io/en/latest/installation.html).Then install ipython-futhark using pip:
* ipython futhark only: `$ pip install ipython-futhark`
* Installing pyopencl along the way: `$ pip install ipython-futhark[opencl]`## Example
See [the Notebook demo](http://nbviewer.jupyter.org/github/titouanc/ipython-futhark/blob/master/Demo.ipynb)
```ipython
IPython 5.4.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.In [1]: %load_ext futhark
In [2]: %%futhark gpu
...: let main(): i32 = 42
...:
Warning: Device limits tile size to 22 (setting was 32)In [3]: main()
Out[3]: 42In [4]: %%futhark inspect gpu
...: let main(): f32 = 42
...:
In: main(): f32 = 42
Declaration of function main at tmpDWm0Zs.fut:1:5-1:5 declares return type f32, but body has type i32
If you find this error message confusing, uninformative, or wrong, please open an issue at https://github.com/HIPERFIT/futhark/issues.```