Skip to content

Commit

Permalink
Adding better af.print and updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanky committed Feb 23, 2017
1 parent 93fcf31 commit dbdaab1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ The wrapper is currently compliant with ArrayFire 3.4 API (and higher). If you f

## Example

TODO
Sample code:

```
local af = require('arrayfire')
af.info()
a = af.Array{1, 2, 3, 4}
af.print(a)
```

Sample output:

```
ArrayFire v3.5.0 (CUDA, 64-bit Linux, build 06e605b0)
Platform: CUDA Toolkit 8, Driver: 378.13
[0] GeForce GTX 950, 1996 MB, CUDA Compute 5.2
ArrayFire Array
[4 1 1 1]
1.0000
2.0000
3.0000
4.0000
```

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion arrayfire/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ funcs[34] = [[
af.lib.cdef(funcs)

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

0 comments on commit dbdaab1

Please sign in to comment.