zisk-asm-runner 1.1.0-alpha

Runtime for managing the ZisK assembly emulator process and its shared-memory I/O
//! Non-Linux-x86_64 stub: placeholder types whose methods error/panic. Off the
//! supported platform these are never exercised, so they carry no docs.
#![allow(missing_docs)]

use zisk_common::{ExecutorStatsHandle, Plan};

use std::fmt::Debug;

use anyhow::Result;

pub struct MOShmemReader {}

// This struct is used to run the assembly code in a separate process and generate minimal traces.
#[derive(Debug)]
pub struct AsmRunnerMO {
    pub plans: Vec<Plan>,
    /// Bytes of the proofman-owned GPU buffer consumed by the GPU mem-ops
    /// planner; always `None` on this stub (no GPU planner on unsupported targets).
    pub gpu_mops_used_bytes: Option<u64>,
}

impl AsmRunnerMO {
    pub fn new(plans: Vec<Plan>) -> Self {
        AsmRunnerMO { plans, gpu_mops_used_bytes: None }
    }

    pub fn run(
        _: &mut MOShmemReader,
        _: u64,
        _: u64,
        _: i32,
        _: i32,
        _: Option<u16>,
        _: ExecutorStatsHandle,
    ) -> Result<Self> {
        Err(anyhow::anyhow!(
            "AsmRunnerMO::run() is not supported on this platform. Only Linux x86_64 is supported."
        ))
    }
}