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

Function device_info

src/core/device.rs:114–142  ·  view source on GitHub ↗

Gets the information about device and platform as strings. # Return Values A tuple of `String` indicating the name, platform, toolkit and compute.

()

Source from the content-addressed store, hash-verified

112/// # Return Values
113/// A tuple of `String` indicating the name, platform, toolkit and compute.
114pub fn device_info() -> (String, String, String, String) {
115 let mut name = [0 as c_char; 64];
116 let mut platform = [0 as c_char; 10];
117 let mut toolkit = [0 as c_char; 64];
118 let mut compute = [0 as c_char; 10];
119 unsafe {
120 let err_val = af_device_info(
121 &mut name[0],
122 &mut platform[0],
123 &mut toolkit[0],
124 &mut compute[0],
125 );
126 HANDLE_ERROR(AfError::from(err_val));
127 (
128 CStr::from_ptr(name.as_mut_ptr())
129 .to_string_lossy()
130 .into_owned(),
131 CStr::from_ptr(platform.as_mut_ptr())
132 .to_string_lossy()
133 .into_owned(),
134 CStr::from_ptr(toolkit.as_mut_ptr())
135 .to_string_lossy()
136 .into_owned(),
137 CStr::from_ptr(compute.as_mut_ptr())
138 .to_string_lossy()
139 .into_owned(),
140 )
141 }
142}
143
144/// Initialize ArrayFire library
145///

Callers 1

mainFunction · 0.85

Calls 1

HANDLE_ERRORFunction · 0.85

Tested by

no test coverage detected