use objc2_core_foundation::{CFData, CFString, kCFAllocatorDefault};
use objc2_io_kit::{IORegistryEntryCreateCFProperty, io_object_t};
pub(super) unsafe fn is_gpu(device: io_object_t, class_code_key: &CFString) -> bool {
unsafe {
if let Some(prop) =
IORegistryEntryCreateCFProperty(device, Some(class_code_key), kCFAllocatorDefault, 0)
&& let Ok(prop_ref) = prop.downcast::<CFData>()
&& let [_, _, 0x03, ..] = prop_ref.as_bytes_unchecked()
{
true
} else {
false
}
}
}