Skip to content

Commit ac9cbd3

Browse files
committed
Updating README.md to include a sample
1 parent b731622 commit ac9cbd3

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

README.md

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
# Arrayfire Lua Bindings
22

3-
[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Lua bindings for the ArrayFire library. The wrapper is currently compliant with ArrayFire 3.2 API (and higher). If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-lua/issues).
3+
[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Lua bindings for the ArrayFire library.
4+
5+
The wrapper is currently compliant with ArrayFire 3.2 API (and higher). If you find any bugs, please report them [here](https://github.com/arrayfire/arrayfire-lua/issues).
6+
7+
## Example
8+
9+
```lua
10+
local AF = require("af_lib")
11+
12+
AF.main(function()
13+
local x = AF.randu(5, "f32")
14+
AF.print("x", x)
15+
AF.print("min of x", AF.min(x))
16+
AF.print("max of x", AF.max(x))
17+
end)
18+
```
19+
20+
```
21+
$ lua examples/lua/helloworld/intro.lua
22+
ArrayFire v3.2.1 (CUDA, 64-bit Linux, build f263db0)
23+
Platform: CUDA Toolkit 7.5, Driver: 358.16
24+
[0] GeForce GTX 690, 2047 MB, CUDA Compute 3.0
25+
-1- GeForce GTX 690, 2048 MB, CUDA Compute 3.0
26+
27+
x
28+
[5 1 1 1]
29+
0.7402
30+
0.9210
31+
0.0390
32+
0.9690
33+
0.9251
34+
35+
min of x
36+
[1 1 1 1]
37+
0.0390
38+
max of x
39+
[1 1 1 1]
40+
0.9690
41+
42+
```
443

544
## Documentation
645

@@ -46,7 +85,7 @@ Use the `cmake` file in `src/Lua/arrayfire` to build the library.
4685

4786
- Ensure `ArrayFire_DIR` points to `/path/to/arrayfire/share/ArrayFire/cmake`
4887

49-
## Running the example
88+
## Setting up the environment
5089

5190
### Linux / OSX
5291

@@ -56,10 +95,6 @@ Use the `cmake` file in `src/Lua/arrayfire` to build the library.
5695

5796
## Issues
5897

59-
Currently segfaults on Linux. Untested on OSX.
60-
61-
## Note
62-
6398
This is a work in progress and is not intended for production use.
6499

65100
## Acknowledgements

0 commit comments

Comments
 (0)