1use crate::device::GpuVendor;
10use crate::error::RuntimeError;
11
12pub fn translate_to_vendor(wbin: &[u8], vendor: GpuVendor) -> Result<String, RuntimeError> {
19 match vendor {
20 GpuVendor::Apple => {
21 wave_metal::compile(wbin).map_err(|e| RuntimeError::Backend(e.to_string()))
22 }
23 GpuVendor::Nvidia => {
24 wave_ptx::compile(wbin, 75).map_err(|e| RuntimeError::Backend(e.to_string()))
25 }
26 GpuVendor::Amd => wave_hip::compile(wbin).map_err(|e| RuntimeError::Backend(e.to_string())),
27 GpuVendor::Intel => {
28 wave_sycl::compile(wbin).map_err(|e| RuntimeError::Backend(e.to_string()))
29 }
30 GpuVendor::Emulator => Err(RuntimeError::Backend(
31 "emulator does not require backend translation".into(),
32 )),
33 }
34}