Skip to content

Commit

Permalink
[SYCL] Change graph_support_level namespace (#256)
Browse files Browse the repository at this point in the history
Matching implementation change to specification PR
#255
  • Loading branch information
EwanC committed Jul 12, 2023
1 parent b054c63 commit 74e7203
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion sycl/include/sycl/info/ext_oneapi_device_traits.def
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device, architecture,
PI_EXT_ONEAPI_DEVICE_INFO_IP_VERSION)
__SYCL_PARAM_TRAITS_SPEC(
ext::oneapi::experimental, device, graph_support,
ext::oneapi::experimental::info::device::graph_support_level,
ext::oneapi::experimental::info::graph_support_level,
0 /* No PI device code needed */)
#ifdef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC_NEEDS_UNDEF
#undef __SYCL_PARAM_TRAITS_TEMPLATE_SPEC
Expand Down
8 changes: 5 additions & 3 deletions sycl/include/sycl/info/info_desc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ template <typename T, T param> struct compatibility_param_traits {};
} /*namespace info */ \
} /*namespace Namespace */

namespace ext::oneapi::experimental::info::device {
template <int Dimensions> struct max_work_groups;
namespace ext::oneapi::experimental::info {

enum class graph_support_level { unsupported = 0, native, emulated };

} // namespace ext::oneapi::experimental::info::device
namespace device {
template <int Dimensions> struct max_work_groups;
} // namespace device
} // namespace ext::oneapi::experimental::info
#include <sycl/info/ext_codeplay_device_traits.def>
#include <sycl/info/ext_intel_device_traits.def>
#include <sycl/info/ext_oneapi_device_traits.def>
Expand Down
20 changes: 9 additions & 11 deletions sycl/source/detail/device_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -888,17 +888,16 @@ struct get_device_info_impl<
// Specialization for graph extension support
template <>
struct get_device_info_impl<
ext::oneapi::experimental::info::device::graph_support_level,
ext::oneapi::experimental::info::graph_support_level,
ext::oneapi::experimental::info::device::graph_support> {
static ext::oneapi::experimental::info::device::graph_support_level
static ext::oneapi::experimental::info::graph_support_level
get(const DeviceImplPtr &Dev) {
size_t ResultSize = 0;
Dev->getPlugin()->call<PiApiKind::piDeviceGetInfo>(
Dev->getHandleRef(), PI_DEVICE_INFO_EXTENSIONS, 0, nullptr,
&ResultSize);
if (ResultSize == 0)
return ext::oneapi::experimental::info::device::graph_support_level::
unsupported;
return ext::oneapi::experimental::info::graph_support_level::unsupported;

std::unique_ptr<char[]> Result(new char[ResultSize]);
Dev->getPlugin()->call<PiApiKind::piDeviceGetInfo>(
Expand All @@ -908,10 +907,10 @@ struct get_device_info_impl<
std::string_view ExtensionsString(Result.get());
bool CmdBufferSupport =
ExtensionsString.find("ur_exp_command_buffer") != std::string::npos;
return CmdBufferSupport ? ext::oneapi::experimental::info::device::
graph_support_level::native
: ext::oneapi::experimental::info::device::
graph_support_level::unsupported;
return CmdBufferSupport
? ext::oneapi::experimental::info::graph_support_level::native
: ext::oneapi::experimental::info::graph_support_level::
unsupported;
}
};

Expand Down Expand Up @@ -1810,11 +1809,10 @@ inline uint32_t get_device_info_host<
}

template <>
inline ext::oneapi::experimental::info::device::graph_support_level
inline ext::oneapi::experimental::info::graph_support_level
get_device_info_host<ext::oneapi::experimental::info::device::graph_support>() {
// No support for graphs on the host device.
return ext::oneapi::experimental::info::device::graph_support_level::
unsupported;
return ext::oneapi::experimental::info::graph_support_level::unsupported;
}

} // namespace detail
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void executable_command_graph::finalizeImpl() {
bool CmdBufSupport =
Device.get_info<
ext::oneapi::experimental::info::device::graph_support>() ==
info::device::graph_support_level::native;
info::graph_support_level::native;

#if FORCE_EMULATION_MODE
// Above query should still succeed in emulation mode, but ignore the
Expand Down
4 changes: 2 additions & 2 deletions sycl/test/abi/sycl_symbols_windows.dump
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
??$get_info@Ugpu_slices@device@info@intel@ext@_V1@sycl@@@device_impl@detail@_V1@sycl@@QEBAIXZ
??$get_info@Ugpu_subslices_per_slice@device@info@intel@ext@_V1@sycl@@@device@_V1@sycl@@QEBAIXZ
??$get_info@Ugpu_subslices_per_slice@device@info@intel@ext@_V1@sycl@@@device_impl@detail@_V1@sycl@@QEBAIXZ
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device@_V1@sycl@@QEBA?AW4graph_support_level@0info@experimental@oneapi@ext@12@XZ
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device_impl@detail@_V1@sycl@@QEBA?AW4graph_support_level@device@info@experimental@oneapi@ext@23@XZ
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device@_V1@sycl@@QEBA?AW4graph_support_level@info@experimental@oneapi@ext@12@XZ
??$get_info@Ugraph_support@device@info@experimental@oneapi@ext@_V1@sycl@@@device_impl@detail@_V1@sycl@@QEBA?AW4graph_support_level@info@experimental@oneapi@ext@23@XZ
??$get_info@Uhalf_fp_config@device@info@_V1@sycl@@@device@_V1@sycl@@QEBA?AV?$vector@W4fp_config@info@_V1@sycl@@V?$allocator@W4fp_config@info@_V1@sycl@@@std@@@std@@XZ
??$get_info@Uhost_unified_memory@device@info@_V1@sycl@@@device@_V1@sycl@@QEBA_NXZ
??$get_info@Uimage2d_max_height@device@info@_V1@sycl@@@device@_V1@sycl@@QEBA_KXZ
Expand Down

0 comments on commit 74e7203

Please sign in to comment.