pub struct GpuDevice { /* private fields */ }Expand description
Implementations§
Source§impl GpuDevice
impl GpuDevice
Sourcepub fn open() -> Option<GpuDevice>
pub fn open() -> Option<GpuDevice>
Open the default adapter, or None where this machine exposes none.
None means not found here, never “impossible” — the same contract as
Gpu::new, and worth preserving because a headless CI runner is the
common case and every test around this skips rather than fails on it.
Sourcepub fn with(gpu: Gpu) -> GpuDevice
pub fn with(gpu: Gpu) -> GpuDevice
Wrap an adapter already opened, so a caller that enumerated once does not enumerate again.
Sourcepub fn adapter(&self) -> &AdapterInfo
pub fn adapter(&self) -> &AdapterInfo
What the driver reports, for a caller that needs to know whether this is real silicon.
Sourcepub fn is_hardware(&self) -> bool
pub fn is_hardware(&self) -> bool
True when the adapter is hardware rather than a software rasteriser.
Trait Implementations§
Source§impl Device for GpuDevice
impl Device for GpuDevice
Source§fn run(&mut self, schedule: &Schedule, seed: u64) -> Result<Vec<i8>, String>
fn run(&mut self, schedule: &Schedule, seed: u64) -> Result<Vec<i8>, String>
Run the schedule and return the BEST state seen, not the last one.
The trait’s wording says “the final state” and every implementation here returns the best:
Cpu delegates to tempering::anneal_scheduled, which tracks the minimum over every sweep,
and sbm calls the same thing a best-so-far readout. That is not pedantry about wording. An
anneal’s last state is wherever the coldest stage happened to stop, and this returned it –
which conform caught the moment it could reach this path at all, scoring -57 against
variable elimination’s exact -59 while the CPU on the same ladder found -59. Nothing was
wrong with the sampler; it was being asked the wrong question at the end.
Tracked per STAGE rather than per sweep, and that difference is real: scoring a state means reading it back off the device, so per-sweep tracking would put a round trip between every sweep and spend the throughput the GPU exists for. The conformance ladder is 80 stages, so the minimum is taken over 80 checkpoints against the CPU’s 3,200.