MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / print

Function print

src/core/array.rs:745–755  ·  view source on GitHub ↗

Print data in the Array # Parameters - `input` is the Array to be printed # Examples ```rust use arrayfire::{Dim4, print, randu}; println!("Create a 5-by-3 matrix of random floats on the GPU"); let dims = Dim4::new(&[5, 3, 1, 1]); let a = randu:: (dims); print(&a); ``` The sample output will look like below: ```text [5 3 1 1] 0.7402 0.4464 0.7762 0.9210 0.6673 0.2948 0.03

(input: &Array<T>)

Source from the content-addressed store, hash-verified

743/// 0.9251 0.5132 0.6814
744/// ```
745pub fn print<T: HasAfEnum>(input: &Array<T>) {
746 let emptystring = CString::new("").unwrap();
747 unsafe {
748 let err_val = af_print_array_gen(
749 emptystring.to_bytes_with_nul().as_ptr() as *const c_char,
750 input.get(),
751 4,
752 );
753 HANDLE_ERROR(AfError::from(err_val));
754 }
755}
756
757/// Generalized Array print function
758///

Callers 5

thread_move_arrayFunction · 0.85
thread_borrow_arrayFunction · 0.85
mainFunction · 0.85
helperFunction · 0.85
mainFunction · 0.85

Calls 2

HANDLE_ERRORFunction · 0.85
getMethod · 0.45

Tested by 2

thread_move_arrayFunction · 0.68
thread_borrow_arrayFunction · 0.68