@@ -3,10 +3,16 @@ halide-haskell
3
3
</h1>
4
4
5
5
<div align="center">
6
+
7
+ <img src="assets/construction_1f6a7.png" width="32"> This project is still under heavy development and might not be production-ready<img src="assets/construction_1f6a7.png" width="32"> <br>
8
+ We encourage experimenting with it and reporting any issues you run into via
9
+ [Github issues](https://github.com/twesterhout/halide-haskell/issues).
10
+
6
11
<br />
7
12
8
- [](LICENSE )
13
+ [**Tutorials** ](https://github.com/ twesterhout/halide-haskell/tree/master/tutorials) | [ ** Documentation ** ](https :// hackage . haskell . org / package / halide - haskell - 0.0 . 1.0 ) | [**Showcases**](https://github.com/twesterhout/halide-haskell-examples )
9
14
15
+ [](LICENSE)
10
16
[](https://github.com/twesterhout/halide-haskell/actions/workflows/ci.yml)
11
17
[](https://hackage.haskell.org/package/halide-haskell)
12
18
@@ -33,10 +39,13 @@ This package provides Haskell bindings that allow to write Halide embedded in
33
39
Haskell without C++ 😋.
34
40
</h4>
35
41
36
- - [Tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials)
37
- - [Reference documentation](https://hackage.haskell.org/package/halide-haskell-0.0.1.0)
42
+ - [Example usage](#-example-usage)
43
+ - [Installing](#-installing)
44
+ - [Motivation](#-motivation)
45
+ - [Contributing](#-contributing)
46
+
38
47
39
- ## 🚀 Getting started
48
+ ## 🚀 Example usage
40
49
41
50
As a simple example, here's how you could implement array addition with halide-haskell:
42
51
@@ -75,7 +84,37 @@ main = do
75
84
print =<< peekToList out'
76
85
```
77
86
78
- For more examples, have a look a the [tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials).
87
+ For more examples, have a look at the [tutorials](https://github.com/twesterhout/halide-haskell/tree/master/tutorials).
88
+
89
+ ## 💻 Installing
90
+
91
+ Currently, the easiest way to install the library is using
92
+ [Nix](https://nixos.org/). It is not a fundamental limitation, because the
93
+ library itself is just a normal Cabal-based Haskell project, but installing &
94
+ patching (not all our bug fixes have been upstreamed yet) the system
95
+ dependencies is just too much work without Nix.
96
+
97
+ So, once you have Nix installed, you can add halide-haskell to your flake
98
+ inputs like [this project
99
+ demonstrates](https://github.com/twesterhout/halide-haskell-examples/blob/main/flake.nix#L27 )
100
+ and then include it in your `build-depends` section in the Cabal file.
101
+
102
+ If you just want to try building the library, type
103
+
104
+ ```sh
105
+ nix build
106
+ ```
107
+
108
+ and to run an example, try
109
+
110
+ ```sh
111
+ nix run
112
+ nix run .#ghc927 -intel-ocl.halide-haskell # for Intel OpenCL support
113
+ nix run .#ghc927 -cuda.halide-haskell # for CUDA support
114
+ nix run .#ghc944 .halide-haskell # to build with GHC 9.4.4 instead
115
+ ```
116
+
117
+ (for OpenCL and CUDA, you may need to set `NIXPKGS_ALLOW_UNFREE=1 `)
79
118
80
119
## 🤩 Motivation
81
120
@@ -143,7 +182,8 @@ Currently, the best way to get started is to use Nix:
143
182
nix develop
144
183
```
145
184
146
- This will drop you into a shell with all the necessary tools to build the code such that you can do
185
+ This will drop you into a shell with all the necessary tools to build the code
186
+ such that you can do
147
187
148
188
```sh
149
189
cabal build
0 commit comments