@@ -79,7 +79,7 @@ pi_result after_piContextCreate(const pi_context_properties *,
79
79
80
80
} // namespace
81
81
82
- TEST (CompositeDeviceTest, DescendentDeviceSupport ) {
82
+ TEST (CompositeDeviceTest, DescendentDeviceSupportInContext ) {
83
83
sycl::unittest::PiMock Mock (sycl::backend::ext_oneapi_level_zero);
84
84
Mock.redefine <sycl::detail::PiApiKind::piDevicesGet>(redefine_piDevicesGet);
85
85
Mock.redefineAfter <sycl::detail::PiApiKind::piDeviceGetInfo>(
@@ -119,3 +119,25 @@ TEST(CompositeDeviceTest, DescendentDeviceSupport) {
119
119
ASSERT_EQ (CompositeDevContext.get_devices ().size (), 1u );
120
120
ASSERT_EQ (CompositeDevContext.get_devices ().front (), CompositeDevice);
121
121
}
122
+
123
+ TEST (CompositeDeviceTest, DescendentDeviceSupportInQueue) {
124
+ sycl::unittest::PiMock Mock (sycl::backend::ext_oneapi_level_zero);
125
+ Mock.redefine <sycl::detail::PiApiKind::piDevicesGet>(redefine_piDevicesGet);
126
+ Mock.redefineAfter <sycl::detail::PiApiKind::piDeviceGetInfo>(
127
+ after_piDeviceGetInfo);
128
+ Mock.redefineAfter <sycl::detail::PiApiKind::piContextCreate>(
129
+ after_piContextCreate);
130
+
131
+ sycl::platform Plt = Mock.getPlatform ();
132
+ ASSERT_EQ (Plt.get_backend (), sycl::backend::ext_oneapi_level_zero);
133
+
134
+ sycl::device ComponentDevice = Plt.get_devices ()[0 ];
135
+ ASSERT_TRUE (ComponentDevice.has (sycl::aspect::ext_oneapi_is_component));
136
+
137
+ auto CompositeDevice = ComponentDevice.get_info <
138
+ sycl::ext::oneapi::experimental::info::device::composite_device>();
139
+ sycl::context CompositeDevContext (CompositeDevice);
140
+ // Component device should be implicitly usable as part of composite context,
141
+ // so there should be no errors during queue creation below.
142
+ sycl::queue Queue (CompositeDevContext, ComponentDevice);
143
+ }
0 commit comments