Skip to main content

read_f16_from_f32_buffer

Function read_f16_from_f32_buffer 

Source
pub fn read_f16_from_f32_buffer(buf: &GpuBuffer<f32>) -> GpuResult<Vec<f16>>
Expand description

Read back a GpuBuffer<f32> and narrow each element to half::f16.

This is the counterpart of from_f16_slice_widening — it performs the inverse narrowing conversion after the GPU computation has completed.

§Errors

Returns an error if the blocking read fails.