@@ -10,17 +10,17 @@ Edit [build.conf](build.conf) to modify the build flags. The structure is a simp
1010Currently Rust does not allow key: value pairs to be passed from the CLI.
1111To use an existing arrayfire installation modify the first three JSON values.
1212
13- To build:
13+ To build arrayfire :
1414
1515``` bash
1616git submodule update --init --recursive
1717cargo build
1818```
1919
20- To test :
20+ To run hello world example :
2121
2222``` bash
23- ~ /p/arrayfire_rust> cargo test
23+ ~ /p/arrayfire_rust> cargo run --example helloworld
2424...
2525 running 1 test
2626ArrayFire v3.0.0 (CUDA, 64-bit Mac OSX, build d8d4b38)
@@ -35,12 +35,75 @@ Create a 5-by-3 matrix of random floats on the GPU
3535 0.9251 0.5132 0.6814
3636
3737Element-wise arithmetic
38+ sin(a) + 1.5 =>
3839[5 3 1 1]
39- 0.6744 0.4317 0.7006
40- 0.7962 0.6189 0.2905
41- 0.0390 0.1097 0.6549
42- 0.8243 0.4531 0.3509
43- 0.7987 0.4910 0.6299
40+ 2.1744 1.9317 2.2006
41+ 2.2962 2.1189 1.7905
42+ 1.5390 1.6097 2.1549
43+ 2.3243 1.9531 1.8509
44+ 2.2987 1.9910 2.1299
45+
46+ sin(a) + cos(a) =>
47+ [5 3 1 1]
48+ 1.4128 1.3337 1.4142
49+ 1.4012 1.4044 1.2474
50+ 1.0382 1.1037 1.4106
51+ 1.3905 1.3446 1.2873
52+ 1.4004 1.3621 1.4066
53+
54+ ! a =>
55+ [5 3 1 1]
56+ 1 1 1
57+ 1 1 1
58+ 1 1 1
59+ 1 1 1
60+ 1 1 1
61+
62+ a + b
63+ [5 3 1 1]
64+ 2.9147 2.3780 2.9767
65+ 3.2172 2.7862 2.0853
66+ 1.5780 1.7196 2.8689
67+ 3.2933 2.4233 2.2094
68+ 3.2238 2.5042 2.8113
69+
70+ Fourier transform the result
71+ [5 3 1 1]
72+ (10.6327,0.0000) (9.6043,0.0000) (10.1267,0.0000)
73+ (0.4689,0.4640) (0.3193,0.0802) (0.1713,0.1441)
74+ (-0.3491,-0.7454) (-0.2923,-0.4018) (0.2667,0.4886)
75+ (-0.3491,0.7454) (-0.2923,0.4018) (0.2667,-0.4886)
76+ (0.4689,-0.4640) (0.3193,-0.0802) (0.1713,-0.1441)
77+
78+ Create 2-by-3 matrix from host data
79+ [2 3 1 1]
80+ 1 3 5
81+ 2 4 6
82+
83+ Sort A and print sorted array and corresponding indices
84+ [5 3 1 1]
85+ 0.0390 0.1099 0.2948
86+ 0.7402 0.4464 0.3585
87+ 0.9210 0.4702 0.6814
88+ 0.9251 0.5132 0.7140
89+ 0.9690 0.6673 0.7762
90+
91+ [5 3 1 1]
92+ 2 2 1
93+ 0 0 3
94+ 1 3 4
95+ 4 4 2
96+ 3 1 0
97+
98+ u8 constant array
99+ [5 3 1 1]
100+ 1 1 1
101+ 1 1 1
102+ 1 1 1
103+ 1 1 1
104+ 1 1 1
105+
106+ Is u8_cnst array float precision type ? false
44107```
45108
46109## Issues
0 commit comments