[][src]Function emu_core::pool::select

pub fn select<F: FnMut(usize, Option<DeviceInfo>) -> bool>(
    selector: F
) -> Result<(), NoDeviceError>

Selects a device from the pool using the given selector function

Emu uses thread-local storage to keep track of the selected device for each thread. select lets you select a device for the thread it is called from.

select(|idx, info| if let Some(info) = info {
} else {
let mut d = take()?.lock()?;
let pi: DeviceBox<f32> = d.create_with_size(std::mem::size_of::<f32>());