@@ -142,26 +142,41 @@ TEST_F(TestDPCTLSyclUSMInterface, AlignedAllocShared)
142
142
143
143
TEST_F (TestDPCTLSyclUSMInterface, AlignedAllocDevice)
144
144
{
145
- sycl::queue q;
146
- DPCTLSyclQueueRef Q = dpctl::syclinterface::wrap<sycl::queue>(&q);
147
- ASSERT_TRUE (Q);
145
+ DPCTLSyclDeviceSelectorRef DSRef = DPCTLDefaultSelector_Create ();
146
+ ASSERT_TRUE (DSRef);
147
+ DPCTLSyclDeviceRef DRef = DPCTLDevice_CreateFromSelector (DSRef);
148
+ DPCTLDeviceSelector_Delete (DSRef);
149
+ ASSERT_TRUE (DRef);
150
+ DPCTLSyclQueueRef QRef = DPCTLQueue_CreateForDevice (DRef);
151
+ DPCTLDevice_Delete (DRef);
152
+ ASSERT_TRUE (QRef);
153
+
148
154
const size_t nbytes = SIZE;
149
- auto Ptr = DPCTLaligned_alloc_device (64 , nbytes, Q );
155
+ auto Ptr = DPCTLaligned_alloc_device (64 , nbytes, QRef );
150
156
EXPECT_TRUE (bool (Ptr));
151
- common_test_body (nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_DEVICE);
152
- DPCTLfree_with_queue (Ptr, Q);
157
+ common_test_body (nbytes, Ptr, QRef, DPCTLSyclUSMType::DPCTL_USM_DEVICE);
158
+ DPCTLfree_with_queue (Ptr, QRef);
159
+ DPCTLQueue_Delete (QRef);
153
160
}
154
161
155
162
TEST_F (TestDPCTLSyclUSMInterface, AlignedAllocHost)
156
163
{
157
- sycl::queue q;
158
- DPCTLSyclQueueRef Q = dpctl::syclinterface::wrap<sycl::queue>(&q);
159
- ASSERT_TRUE (Q);
164
+ DPCTLSyclDeviceSelectorRef DSRef = DPCTLDefaultSelector_Create ();
165
+ ASSERT_TRUE (DSRef);
166
+ DPCTLSyclDeviceRef DRef = DPCTLDevice_CreateFromSelector (DSRef);
167
+ DPCTLDeviceSelector_Delete (DSRef);
168
+ ASSERT_TRUE (DRef);
169
+ DPCTLSyclQueueRef QRef = DPCTLQueue_CreateForDevice (DRef);
170
+ DPCTLDevice_Delete (DRef);
171
+ ASSERT_TRUE (QRef);
172
+
160
173
const size_t nbytes = SIZE;
161
- auto Ptr = DPCTLaligned_alloc_host (64 , nbytes, Q );
174
+ auto Ptr = DPCTLaligned_alloc_host (64 , nbytes, QRef );
162
175
EXPECT_TRUE (bool (Ptr));
163
- common_test_body (nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_HOST);
164
- DPCTLfree_with_queue (Ptr, Q);
176
+ common_test_body (nbytes, Ptr, QRef, DPCTLSyclUSMType::DPCTL_USM_HOST);
177
+ DPCTLfree_with_queue (Ptr, QRef);
178
+
179
+ DPCTLQueue_Delete (QRef);
165
180
}
166
181
167
182
struct TestDPCTLSyclUSMNullArgs : public ::testing::Test
0 commit comments