Skip to content

Commit 9c1db5f

Browse files
Adjust tests to account for namespace of wrap/unwrap
1 parent 459754b commit 9c1db5f

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

libsyclinterface/tests/test_sycl_context_interface.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ TEST_P(TestDPCTLContextInterface, ChkCreateWithDevicesGetDevices)
103103
DPCTLDeviceVectorRef DVRef = nullptr;
104104
DPCTLDeviceVectorRef Res_DVRef = nullptr;
105105

106-
/* TODO: Once we have wrappers for sub-device creation let us use those
107-
* functions.
108-
*/
109106
EXPECT_NO_FATAL_FAILURE(nCUs = DPCTLDevice_GetMaxComputeUnits(DRef));
110107
if (nCUs > 1) {
111108
EXPECT_NO_FATAL_FAILURE(

libsyclinterface/tests/test_sycl_device_aspects.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ auto build_params()
134134
return build_gtest_values(pairs);
135135
}
136136

137+
using namespace dpctl::syclinterface;
138+
137139
} // namespace
138140

139141
struct TestDPCTLSyclDeviceInterfaceAspects
@@ -161,7 +163,7 @@ struct TestDPCTLSyclDeviceInterfaceAspects
161163
EXPECT_NO_FATAL_FAILURE(DRef = DPCTLDevice_CreateFromSelector(DSRef));
162164
if (!DRef)
163165
GTEST_SKIP_("Device not found");
164-
auto D = unwrap(DRef);
166+
auto D = unwrap<device>(DRef);
165167
auto syclAspect = GetParam().second.second;
166168
try {
167169
hasAspect = D->has(syclAspect);

libsyclinterface/tests/test_sycl_device_subdevices.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <gtest/gtest.h>
3737

3838
using namespace sycl;
39+
using namespace dpctl::syclinterface;
3940

4041
const DPCTLPartitionAffinityDomainType a_dpctl_domain =
4142
DPCTLPartitionAffinityDomainType::not_applicable;
@@ -137,7 +138,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityNotApplicable)
137138
EXPECT_NO_FATAL_FAILURE(
138139
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
139140

140-
auto D = unwrap(DRef);
141+
auto D = unwrap<device>(DRef);
141142
try {
142143
auto subDevices = D->create_sub_devices<
143144
info::partition_property::partition_by_affinity_domain>(domain);
@@ -166,7 +167,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityNuma)
166167
EXPECT_NO_FATAL_FAILURE(
167168
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
168169

169-
auto D = unwrap(DRef);
170+
auto D = unwrap<device>(DRef);
170171
size_t expected_size = 0;
171172
try {
172173
auto subDevices = D->create_sub_devices<
@@ -197,7 +198,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityL4Cache)
197198
EXPECT_NO_FATAL_FAILURE(
198199
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
199200

200-
auto D = unwrap(DRef);
201+
auto D = unwrap<device>(DRef);
201202
size_t expected_size = 0;
202203
try {
203204
auto subDevices = D->create_sub_devices<
@@ -228,7 +229,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityL3Cache)
228229
EXPECT_NO_FATAL_FAILURE(
229230
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
230231

231-
auto D = unwrap(DRef);
232+
auto D = unwrap<device>(DRef);
232233
size_t expected_size = 0;
233234
try {
234235
auto subDevices = D->create_sub_devices<
@@ -259,7 +260,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityL2Cache)
259260
EXPECT_NO_FATAL_FAILURE(
260261
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
261262

262-
auto D = unwrap(DRef);
263+
auto D = unwrap<device>(DRef);
263264
size_t expected_size = 0;
264265
try {
265266
auto subDevices = D->create_sub_devices<
@@ -290,7 +291,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkCreateSubDevicesByAffinityL1Cache)
290291
EXPECT_NO_FATAL_FAILURE(
291292
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
292293

293-
auto D = unwrap(DRef);
294+
auto D = unwrap<device>(DRef);
294295
size_t expected_size = 0;
295296
try {
296297
auto subDevices = D->create_sub_devices<
@@ -322,7 +323,7 @@ TEST_P(TestDPCTLSyclDeviceInterface,
322323
EXPECT_NO_FATAL_FAILURE(
323324
DVRef = DPCTLDevice_CreateSubDevicesByAffinity(DRef, dpctl_domain));
324325

325-
auto D = unwrap(DRef);
326+
auto D = unwrap<device>(DRef);
326327
size_t expected_size = 0;
327328
try {
328329
auto subDevices = D->create_sub_devices<

libsyclinterface/tests/test_sycl_queue_interface.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <gtest/gtest.h>
3838

3939
using namespace sycl;
40+
using namespace dpctl::syclinterface;
4041

4142
namespace
4243
{
@@ -347,7 +348,7 @@ TEST(TestDPCTLSyclQueueInterface, CheckMemOpsZeroQRef)
347348

348349
TEST_P(TestDPCTLQueueMemberFunctions, CheckGetBackend)
349350
{
350-
auto q = unwrap(QRef);
351+
auto q = unwrap<queue>(QRef);
351352
auto Backend = q->get_device().get_platform().get_backend();
352353
auto Bty = DPCTLQueue_GetBackend(QRef);
353354
switch (Bty) {

libsyclinterface/tests/test_sycl_queue_submit.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ namespace
4141
{
4242
constexpr size_t SIZE = 1024;
4343
static_assert(SIZE % 8 == 0);
44+
45+
using namespace dpctl::syclinterface;
46+
4447
} /* end of anonymous namespace */
4548

4649
struct TestQueueSubmit : public ::testing::Test
@@ -92,8 +95,8 @@ TEST_F(TestQueueSubmit, CheckSubmitRange_saxpy)
9295
auto c = DPCTLmalloc_shared(SIZE * sizeof(float), QRef);
9396
ASSERT_TRUE(c != nullptr);
9497

95-
auto a_ptr = reinterpret_cast<float *>(unwrap(a));
96-
auto b_ptr = reinterpret_cast<float *>(unwrap(b));
98+
auto a_ptr = reinterpret_cast<float *>(unwrap<void>(a));
99+
auto b_ptr = reinterpret_cast<float *>(unwrap<void>(b));
97100
// Initialize a,b
98101
for (auto i = 0ul; i < SIZE; ++i) {
99102
a_ptr[i] = i + 1.0;
@@ -103,7 +106,8 @@ TEST_F(TestQueueSubmit, CheckSubmitRange_saxpy)
103106
// Create kernel args for axpy
104107
float d = 10.0;
105108
size_t Range[] = {SIZE};
106-
void *args2[4] = {unwrap(a), unwrap(b), unwrap(c), (void *)&d};
109+
void *args2[4] = {unwrap<void>(a), unwrap<void>(b), unwrap<void>(c),
110+
(void *)&d};
107111
DPCTLKernelArgType addKernelArgTypes[] = {DPCTL_VOID_PTR, DPCTL_VOID_PTR,
108112
DPCTL_VOID_PTR, DPCTL_FLOAT};
109113
auto ERef = DPCTLQueue_SubmitRange(
@@ -152,8 +156,8 @@ TEST_F(TestQueueSubmit, CheckSubmitNDRange_saxpy)
152156
auto c = DPCTLmalloc_shared(SIZE * sizeof(float), QRef);
153157
ASSERT_TRUE(c != nullptr);
154158

155-
auto a_ptr = reinterpret_cast<float *>(unwrap(a));
156-
auto b_ptr = reinterpret_cast<float *>(unwrap(b));
159+
auto a_ptr = reinterpret_cast<float *>(unwrap<void>(a));
160+
auto b_ptr = reinterpret_cast<float *>(unwrap<void>(b));
157161
// Initialize a,b
158162
for (auto i = 0ul; i < SIZE; ++i) {
159163
a_ptr[i] = i + 1.0;
@@ -164,7 +168,8 @@ TEST_F(TestQueueSubmit, CheckSubmitNDRange_saxpy)
164168
float d = 10.0;
165169
size_t gRange[] = {1, 1, SIZE};
166170
size_t lRange[] = {1, 1, 8};
167-
void *args2[4] = {unwrap(a), unwrap(b), unwrap(c), (void *)&d};
171+
void *args2[4] = {unwrap<void>(a), unwrap<void>(b), unwrap<void>(c),
172+
(void *)&d};
168173
DPCTLKernelArgType addKernelArgTypes[] = {DPCTL_VOID_PTR, DPCTL_VOID_PTR,
169174
DPCTL_VOID_PTR, DPCTL_FLOAT};
170175
DPCTLSyclEventRef events[1];

0 commit comments

Comments
 (0)