@@ -804,6 +804,31 @@ struct get_device_info_impl<
804804 }
805805};
806806
807+ // Specialization for graph extension support
808+ template <>
809+ struct get_device_info_impl <
810+ ext::oneapi::experimental::info::device::graph_support_level,
811+ ext::oneapi::experimental::info::device::graph_support> {
812+ static ext::oneapi::experimental::info::device::graph_support_level
813+ get (const DeviceImplPtr &Dev) {
814+ // Level zero is currently only supported backend
815+ if (Dev->getBackend () != backend::ext_oneapi_level_zero) {
816+ return ext::oneapi::experimental::info::device::graph_support_level::
817+ unsupported;
818+ }
819+
820+ pi_bool CmdBufSupport = false ;
821+ Dev->getPlugin ()->call <PiApiKind::piDeviceGetInfo>(
822+ Dev->getHandleRef (), PI_EXT_ONEAPI_DEVICE_INFO_COMMAND_BUFFER_SUPPORT,
823+ sizeof (pi_bool), &CmdBufSupport, nullptr );
824+
825+ return CmdBufSupport ? ext::oneapi::experimental::info::device::
826+ graph_support_level::native
827+ : ext::oneapi::experimental::info::device::
828+ graph_support_level::emulated;
829+ }
830+ };
831+
807832template <typename Param>
808833typename Param::return_type get_device_info (const DeviceImplPtr &Dev) {
809834 static_assert (is_device_info_desc<Param>::value,
@@ -1692,6 +1717,14 @@ inline uint32_t get_device_info_host<
16921717 PI_ERROR_INVALID_DEVICE);
16931718}
16941719
1720+ template <>
1721+ inline ext::oneapi::experimental::info::device::graph_support_level
1722+ get_device_info_host<ext::oneapi::experimental::info::device::graph_support>() {
1723+ // No support for graphs on the host device.
1724+ return ext::oneapi::experimental::info::device::graph_support_level::
1725+ unsupported;
1726+ }
1727+
16951728} // namespace detail
16961729} // __SYCL_INLINE_VER_NAMESPACE(_V1)
16971730} // namespace sycl
0 commit comments