cu_profiler_core/backend/
program_test.rs1use std::path::PathBuf;
11
12use crate::Result;
13use crate::backend::{ExecutionBackend, SimulationOutput};
14use crate::error::Error;
15use crate::metadata::BackendKind;
16use crate::scenario::Scenario;
17
18#[derive(Debug, Clone)]
20pub struct ProgramTestBackend {
21 pub program_so: PathBuf,
23 pub program_id: String,
25}
26
27impl ProgramTestBackend {
28 #[must_use]
30 pub fn new(program_so: impl Into<PathBuf>, program_id: impl Into<String>) -> Self {
31 Self {
32 program_so: program_so.into(),
33 program_id: program_id.into(),
34 }
35 }
36}
37
38impl ExecutionBackend for ProgramTestBackend {
39 fn kind(&self) -> BackendKind {
40 BackendKind::ProgramTest
41 }
42
43 fn run(&self, _scenario: &Scenario) -> Result<SimulationOutput> {
44 Err(Error::BackendUnimplemented(
45 "program-test: this core type is an interface stub — use the \
46 `cu-profiler-program-test` integration crate for a working backend, \
47 or `cu-profiler-mollusk` for real compute-unit metering"
48 .to_string(),
49 ))
50 }
51}