Skip to content

Commit cfb2c40

Browse files
author
Ewan Crawford
authored
[SYCL] Change graph_support_level namespace (#256)
Matching implementation change to specification PR #255
1 parent 7d88887 commit cfb2c40

File tree

6 files changed

+55
-56
lines changed

6 files changed

+55
-56
lines changed

sycl/include/sycl/info/ext_oneapi_device_traits.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ __SYCL_PARAM_TRAITS_TEMPLATE_SPEC(ext::oneapi::experimental,device, max_work_gro
99

1010
__SYCL_PARAM_TRAITS_SPEC(
1111
ext::oneapi::experimental, device, graph_support,
12-
ext::oneapi::experimental::info::device::graph_support_level,
12+
ext::oneapi::experimental::info::graph_support_level,
1313
0 /* No PI device code needed */)
1414

1515
__SYCL_PARAM_TRAITS_SPEC(ext::oneapi::experimental, device, architecture,

sycl/include/sycl/info/info_desc.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,14 @@ template <typename T, T param> struct compatibility_param_traits {};
185185
} /*namespace info */ \
186186
} /*namespace Namespace */
187187

188-
namespace ext::oneapi::experimental::info::device {
189-
template <int Dimensions> struct max_work_groups;
188+
namespace ext::oneapi::experimental::info {
190189

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

193-
} // namespace ext::oneapi::experimental::info::device
192+
namespace device {
193+
template <int Dimensions> struct max_work_groups;
194+
} // namespace device
195+
} // namespace ext::oneapi::experimental::info
194196
#include <sycl/info/ext_codeplay_device_traits.def>
195197
#include <sycl/info/ext_intel_device_traits.def>
196198
#include <sycl/info/ext_oneapi_device_traits.def>

sycl/source/detail/device_info.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -888,17 +888,16 @@ struct get_device_info_impl<
888888
// Specialization for graph extension support
889889
template <>
890890
struct get_device_info_impl<
891-
ext::oneapi::experimental::info::device::graph_support_level,
891+
ext::oneapi::experimental::info::graph_support_level,
892892
ext::oneapi::experimental::info::device::graph_support> {
893-
static ext::oneapi::experimental::info::device::graph_support_level
893+
static ext::oneapi::experimental::info::graph_support_level
894894
get(const DeviceImplPtr &Dev) {
895895
size_t ResultSize = 0;
896896
Dev->getPlugin()->call<PiApiKind::piDeviceGetInfo>(
897897
Dev->getHandleRef(), PI_DEVICE_INFO_EXTENSIONS, 0, nullptr,
898898
&ResultSize);
899899
if (ResultSize == 0)
900-
return ext::oneapi::experimental::info::device::graph_support_level::
901-
unsupported;
900+
return ext::oneapi::experimental::info::graph_support_level::unsupported;
902901

903902
std::unique_ptr<char[]> Result(new char[ResultSize]);
904903
Dev->getPlugin()->call<PiApiKind::piDeviceGetInfo>(
@@ -908,10 +907,10 @@ struct get_device_info_impl<
908907
std::string_view ExtensionsString(Result.get());
909908
bool CmdBufferSupport =
910909
ExtensionsString.find("ur_exp_command_buffer") != std::string::npos;
911-
return CmdBufferSupport ? ext::oneapi::experimental::info::device::
912-
graph_support_level::native
913-
: ext::oneapi::experimental::info::device::
914-
graph_support_level::unsupported;
910+
return CmdBufferSupport
911+
? ext::oneapi::experimental::info::graph_support_level::native
912+
: ext::oneapi::experimental::info::graph_support_level::
913+
unsupported;
915914
}
916915
};
917916

@@ -1810,11 +1809,10 @@ inline uint32_t get_device_info_host<
18101809
}
18111810

18121811
template <>
1813-
inline ext::oneapi::experimental::info::device::graph_support_level
1812+
inline ext::oneapi::experimental::info::graph_support_level
18141813
get_device_info_host<ext::oneapi::experimental::info::device::graph_support>() {
18151814
// No support for graphs on the host device.
1816-
return ext::oneapi::experimental::info::device::graph_support_level::
1817-
unsupported;
1815+
return ext::oneapi::experimental::info::graph_support_level::unsupported;
18181816
}
18191817

18201818
} // namespace detail

sycl/source/detail/graph_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ void executable_command_graph::finalizeImpl() {
589589
bool CmdBufSupport =
590590
Device.get_info<
591591
ext::oneapi::experimental::info::device::graph_support>() ==
592-
info::device::graph_support_level::native;
592+
info::graph_support_level::native;
593593

594594
#if FORCE_EMULATION_MODE
595595
// Above query should still succeed in emulation mode, but ignore the

sycl/test-e2e/Graph/device_query.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ int main() {
1111

1212
auto Device = Queue.get_device();
1313

14-
exp_ext::info::device::graph_support_level SupportsGraphs =
14+
exp_ext::info::graph_support_level SupportsGraphs =
1515
Device.get_info<exp_ext::info::device::graph_support>();
1616
auto Backend = Device.get_backend();
1717

1818
if (Backend == backend::ext_oneapi_level_zero) {
19-
assert(SupportsGraphs ==
20-
exp_ext::info::device::graph_support_level::native);
19+
assert(SupportsGraphs == exp_ext::info::graph_support_level::native);
2120
} else {
22-
assert(SupportsGraphs ==
23-
exp_ext::info::device::graph_support_level::unsupported);
21+
assert(SupportsGraphs == exp_ext::info::graph_support_level::unsupported);
2422
}
2523
}

0 commit comments

Comments
 (0)