|
29 | 29 | #include "dpctl_sycl_device_selector_interface.h"
|
30 | 30 | #include "dpctl_sycl_event_interface.h"
|
31 | 31 | #include "dpctl_sycl_queue_interface.h"
|
32 |
| -#include "dpctl_sycl_queue_manager.h" |
33 | 32 | #include "dpctl_sycl_type_casters.hpp"
|
34 | 33 | #include "dpctl_sycl_usm_interface.h"
|
35 | 34 | #include <cstring>
|
@@ -95,67 +94,68 @@ struct TestDPCTLSyclUSMInterface : public ::testing::Test
|
95 | 94 |
|
96 | 95 | TEST_F(TestDPCTLSyclUSMInterface, MallocShared)
|
97 | 96 | {
|
98 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 97 | + sycl::queue q; |
| 98 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
99 | 99 | ASSERT_TRUE(Q);
|
100 | 100 | const size_t nbytes = SIZE;
|
101 | 101 | auto Ptr = DPCTLmalloc_shared(nbytes, Q);
|
102 | 102 | EXPECT_TRUE(bool(Ptr));
|
103 | 103 | common_test_body(nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_SHARED);
|
104 | 104 | DPCTLfree_with_queue(Ptr, Q);
|
105 |
| - DPCTLQueue_Delete(Q); |
106 | 105 | }
|
107 | 106 |
|
108 | 107 | TEST_F(TestDPCTLSyclUSMInterface, MallocDevice)
|
109 | 108 | {
|
110 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 109 | + sycl::queue q; |
| 110 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
111 | 111 | ASSERT_TRUE(Q);
|
112 | 112 | const size_t nbytes = SIZE;
|
113 | 113 | auto Ptr = DPCTLmalloc_device(nbytes, Q);
|
114 | 114 | EXPECT_TRUE(bool(Ptr));
|
115 | 115 | common_test_body(nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_DEVICE);
|
116 | 116 | DPCTLfree_with_queue(Ptr, Q);
|
117 |
| - DPCTLQueue_Delete(Q); |
118 | 117 | }
|
119 | 118 |
|
120 | 119 | TEST_F(TestDPCTLSyclUSMInterface, MallocHost)
|
121 | 120 | {
|
122 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 121 | + sycl::queue q; |
| 122 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
123 | 123 | ASSERT_TRUE(Q);
|
124 | 124 | const size_t nbytes = SIZE;
|
125 | 125 | auto Ptr = DPCTLmalloc_host(nbytes, Q);
|
126 | 126 | EXPECT_TRUE(bool(Ptr));
|
127 | 127 | common_test_body(nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_HOST);
|
128 | 128 | DPCTLfree_with_queue(Ptr, Q);
|
129 |
| - DPCTLQueue_Delete(Q); |
130 | 129 | }
|
131 | 130 |
|
132 | 131 | TEST_F(TestDPCTLSyclUSMInterface, AlignedAllocShared)
|
133 | 132 | {
|
134 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 133 | + sycl::queue q; |
| 134 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
135 | 135 | ASSERT_TRUE(Q);
|
136 | 136 | const size_t nbytes = SIZE;
|
137 | 137 | auto Ptr = DPCTLaligned_alloc_shared(64, nbytes, Q);
|
138 | 138 | EXPECT_TRUE(bool(Ptr));
|
139 | 139 | common_test_body(nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_SHARED);
|
140 | 140 | DPCTLfree_with_queue(Ptr, Q);
|
141 |
| - DPCTLQueue_Delete(Q); |
142 | 141 | }
|
143 | 142 |
|
144 | 143 | TEST_F(TestDPCTLSyclUSMInterface, AlignedAllocDevice)
|
145 | 144 | {
|
146 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 145 | + sycl::queue q; |
| 146 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
147 | 147 | ASSERT_TRUE(Q);
|
148 | 148 | const size_t nbytes = SIZE;
|
149 | 149 | auto Ptr = DPCTLaligned_alloc_device(64, nbytes, Q);
|
150 | 150 | EXPECT_TRUE(bool(Ptr));
|
151 | 151 | common_test_body(nbytes, Ptr, Q, DPCTLSyclUSMType::DPCTL_USM_DEVICE);
|
152 | 152 | DPCTLfree_with_queue(Ptr, Q);
|
153 |
| - DPCTLQueue_Delete(Q); |
154 | 153 | }
|
155 | 154 |
|
156 | 155 | TEST_F(TestDPCTLSyclUSMInterface, AlignedAllocHost)
|
157 | 156 | {
|
158 |
| - auto Q = DPCTLQueueMgr_GetCurrentQueue(); |
| 157 | + sycl::queue q; |
| 158 | + DPCTLSyclQueueRef Q = wrap<queue>(&q); |
159 | 159 | ASSERT_TRUE(Q);
|
160 | 160 | const size_t nbytes = SIZE;
|
161 | 161 | auto Ptr = DPCTLaligned_alloc_host(64, nbytes, Q);
|
|
0 commit comments