use crate::cli::Target;
use crate::ir::TranslationUnit;
pub mod hip;
pub mod opencl;
pub mod rust;
pub mod sycl;
pub trait TargetBackend {
fn banner(&self, src: &str) -> String;
fn emit(&self, unit: &TranslationUnit) -> String;
}
pub fn for_target(target: Target) -> Box<dyn TargetBackend> {
match target {
Target::Hip => Box::new(hip::HipBackend),
Target::Sycl => Box::new(sycl::SyclBackend),
Target::Rust => Box::new(rust::RustBackend),
Target::Opencl => Box::new(opencl::OpenClBackend),
Target::All => Box::new(hip::HipBackend),
}
}