File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,8 @@ cargo build
58
58
let num_rows : u64 = 5 ;
59
59
let num_cols : u64 = 3 ;
60
60
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 );
67
63
```
68
64
69
65
### Sample output
@@ -72,17 +68,17 @@ print(&a);
72
68
~ /p/arrayfire_rust> cargo run --example helloworld
73
69
...
74
70
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
+
78
75
Create a 5-by-3 matrix of random floats on the GPU
79
76
[5 3 1 1]
80
77
0.7402 0.4464 0.7762
81
78
0.9210 0.6673 0.2948
82
79
0.0390 0.1099 0.7140
83
80
0.9690 0.4702 0.3585
84
81
0.9251 0.5132 0.6814
85
-
86
82
...
87
83
```
88
84
You can’t perform that action at this time.
0 commit comments