Skip to content

Commit 316c97e

Browse files
committed
Change README rust example code to reflect v3.4.0
1 parent edf9fdf commit 316c97e

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

README.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ cargo build
5858
let num_rows: u64 = 5;
5959
let num_cols: u64 = 3;
6060
let dims = Dim4::new(&[num_rows, num_cols, 1, 1]);
61-
println!("Create a 5-by-3 matrix of random floats on the GPU");
62-
let a = match randu(dims, Aftype::F32) {
63-
Ok(value) => value,
64-
Err(error) => panic!("{}", error),
65-
};
66-
print(&a);
61+
let a = randu::<f32>(dims);
62+
af_print!("Create a 5-by-3 matrix of random floats on the GPU", a);
6763
```
6864

6965
### Sample output
@@ -72,17 +68,17 @@ print(&a);
7268
~/p/arrayfire_rust> cargo run --example helloworld
7369
...
7470
running 1 test
75-
ArrayFire v3.2.0 (CUDA, 64-bit Mac OSX, build d8d4b38)
76-
Platform: CUDA Toolkit 7, Driver: CUDA Driver Version: 7000
77-
[0] GeForce GT 750M, 2048 MB, CUDA Compute 3.0
71+
ArrayFire v3.4.0 (CUDA, 64-bit Linux, build 10d9716)
72+
Platform: CUDA Toolkit 7.5, Driver: 361.42
73+
[0] GeForce GT 650M, 2048 MB, CUDA Compute 3.0
74+
7875
Create a 5-by-3 matrix of random floats on the GPU
7976
[5 3 1 1]
8077
0.7402 0.4464 0.7762
8178
0.9210 0.6673 0.2948
8279
0.0390 0.1099 0.7140
8380
0.9690 0.4702 0.3585
8481
0.9251 0.5132 0.6814
85-
8682
...
8783
```
8884

0 commit comments

Comments
 (0)