Skip to content

Commit dbdaab1

Browse files
committed
Adding better af.print and updating README
1 parent 93fcf31 commit dbdaab1

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,30 @@ The wrapper is currently compliant with ArrayFire 3.4 API (and higher). If you f
66

77
## Example
88

9-
TODO
9+
Sample code:
10+
11+
```
12+
local af = require('arrayfire')
13+
af.info()
14+
a = af.Array{1, 2, 3, 4}
15+
af.print(a)
16+
```
17+
18+
Sample output:
19+
20+
```
21+
ArrayFire v3.5.0 (CUDA, 64-bit Linux, build 06e605b0)
22+
Platform: CUDA Toolkit 8, Driver: 378.13
23+
[0] GeForce GTX 950, 1996 MB, CUDA Compute 5.2
24+
25+
ArrayFire Array
26+
[4 1 1 1]
27+
1.0000
28+
2.0000
29+
3.0000
30+
4.0000
31+
32+
```
1033

1134
## Documentation
1235

arrayfire/util.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ funcs[34] = [[
2929
af.lib.cdef(funcs)
3030

3131
af.print = function(arr)
32-
af.clib.af_print_array(arr:get())
32+
af.clib.af_print_array_gen(ffi.cast("char *", "ArrayFire Array"), arr:get(), 4)
3333
end

0 commit comments

Comments
 (0)