diff --git a/src/gallium/frontends/rusticl/api/device.rs b/src/gallium/frontends/rusticl/api/device.rs index 8fe6368d05e..72c92c1b887 100644 --- a/src/gallium/frontends/rusticl/api/device.rs +++ b/src/gallium/frontends/rusticl/api/device.rs @@ -138,6 +138,12 @@ impl CLInfo for cl_device_id { CL_DEVICE_LOCAL_MEM_SIZE => cl_prop::(dev.local_mem_size()), // TODO add query for CL_LOCAL vs CL_GLOBAL CL_DEVICE_LOCAL_MEM_TYPE => cl_prop::(CL_GLOBAL), + CL_DEVICE_LUID_KHR => cl_prop::<[cl_uchar; CL_LUID_SIZE_KHR as usize]>( + dev.screen().device_luid().unwrap_or_default(), + ), + CL_DEVICE_LUID_VALID_KHR => { + cl_prop::(dev.screen().device_luid().is_some().into()) + } CL_DEVICE_MAX_CLOCK_FREQUENCY => cl_prop::(dev.max_clock_freq()), CL_DEVICE_MAX_COMPUTE_UNITS => cl_prop::(dev.max_compute_units()), // TODO atm implemented as mem_const @@ -178,6 +184,9 @@ impl CLInfo for cl_device_id { CL_DEVICE_NATIVE_VECTOR_WIDTH_INT => cl_prop::(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG => cl_prop::(1), CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT => cl_prop::(1), + CL_DEVICE_NODE_MASK_KHR => { + cl_prop::(dev.screen().device_node_mask().unwrap_or_default()) + } CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT => cl_prop::(false), CL_DEVICE_NUMERIC_VERSION => cl_prop::(dev.cl_version as cl_version), // TODO subdevice support @@ -244,9 +253,15 @@ impl CLInfo for cl_device_id { ) } CL_DEVICE_TYPE => cl_prop::(dev.device_type(false)), + CL_DEVICE_UUID_KHR => cl_prop::<[cl_uchar; CL_UUID_SIZE_KHR as usize]>( + dev.screen().device_uuid().unwrap_or_default(), + ), CL_DEVICE_VENDOR => cl_prop(dev.screen().device_vendor()), CL_DEVICE_VENDOR_ID => cl_prop::(dev.vendor_id()), CL_DEVICE_VERSION => cl_prop::(format!("OpenCL {} ", dev.cl_version.api_str())), + CL_DRIVER_UUID_KHR => cl_prop::<[cl_char; CL_UUID_SIZE_KHR as usize]>( + dev.screen().driver_uuid().unwrap_or_default(), + ), CL_DRIVER_VERSION => cl_prop::<&CStr>(unsafe { CStr::from_ptr(mesa_version_string()) }), CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT => cl_prop::(false), // CL_INVALID_VALUE if param_name is not one of the supported values diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index 68abf7871e5..e2742d1a5b6 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -15,6 +15,7 @@ use mesa_rust::pipe::resource::*; use mesa_rust::pipe::screen::*; use mesa_rust::pipe::transfer::*; use mesa_rust_gen::*; +use mesa_rust_util::static_assert; use rusticl_opencl_gen::*; use std::cmp::max; @@ -540,6 +541,13 @@ impl Device { add_ext(1, 0, 0, "cl_khr_pci_bus_info"); } + if self.screen().device_uuid().is_some() && self.screen().driver_uuid().is_some() { + static_assert!(PIPE_UUID_SIZE == CL_UUID_SIZE_KHR); + static_assert!(PIPE_LUID_SIZE == CL_LUID_SIZE_KHR); + + add_ext(1, 0, 0, "cl_khr_device_uuid"); + } + if self.svm_supported() { add_ext(1, 0, 0, "cl_arm_shared_virtual_memory"); }