Skip to content

Commit 135f215

Browse files
test: move image support matcher and unify
Related-to: NEO-16156 Signed-off-by: Damian Tomczak <damian.tomczak@intel.com>
1 parent e989937 commit 135f215

File tree

7 files changed

+18
-32
lines changed

7 files changed

+18
-32
lines changed

level_zero/core/test/unit_tests/sources/image/test_image.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,13 +1783,6 @@ HWTEST_F(ImageCreate, WhenImageViewCreateExtThenSuccessIsReturned) {
17831783
zeImageDestroy(planeY);
17841784
}
17851785

1786-
struct ImageSupport {
1787-
template <PRODUCT_FAMILY productFamily>
1788-
static constexpr bool isMatched() {
1789-
return productFamily >= IGFX_SKYLAKE && NEO::HwMapper<productFamily>::GfxProduct::supportsSampler;
1790-
}
1791-
};
1792-
17931786
HWTEST2_F(ImageCreate, GivenNonBindlessImageWhenGettingDeviceOffsetThenErrorIsReturned, ImageSupport) {
17941787
const size_t width = 32;
17951788
const size_t height = 32;

level_zero/core/test/unit_tests/sources/kernel/test_kernel.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,6 @@ TEST_F(KernelImpSetGroupSizeTest, givenValidGroupSizeWhenSetMultipleTimesThenSet
513513

514514
using SetKernelArg = Test<ModuleFixture>;
515515

516-
struct ImageSupport {
517-
template <PRODUCT_FAMILY productFamily>
518-
static constexpr bool isMatched() {
519-
return productFamily >= IGFX_SKYLAKE && NEO::HwMapper<productFamily>::GfxProduct::supportsSampler;
520-
}
521-
};
522-
523516
HWTEST2_F(SetKernelArg, givenImageAndKernelWhenSetArgImageThenCrossThreadDataIsSet, ImageSupport) {
524517
createKernel();
525518

opencl/test/unit_test/aub_tests/command_queue/enqueue_copy_image_aub_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ struct AUBCopyImage
168168

169169
using AUBCopyImageCCS = AUBCopyImage<false>;
170170

171-
HWTEST2_P(AUBCopyImageCCS, WhenCopyingThenExpectationsMet, ImagesSupportedMatcher) {
171+
HWTEST2_P(AUBCopyImageCCS, WhenCopyingThenExpectationsMet, ImageSupport) {
172172
runAubTest<FamilyType>();
173173
}
174174

@@ -182,7 +182,7 @@ INSTANTIATE_TEST_SUITE_P(AUBCopyImage_simple,
182182

183183
using AUBCopyImageBCS = AUBCopyImage<true>;
184184

185-
HWTEST2_P(AUBCopyImageBCS, WhenCopyingWithBlitterEnabledThenExpectationsMet, ImagesSupportedMatcher) {
185+
HWTEST2_P(AUBCopyImageBCS, WhenCopyingWithBlitterEnabledThenExpectationsMet, ImageSupport) {
186186
runAubTest<FamilyType>();
187187
ASSERT_EQ(pCmdQ->peekLatestSentEnqueueOperation(), EnqueueProperties::Operation::blit);
188188
}

opencl/test/unit_test/aub_tests/command_queue/enqueue_read_image_aub_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ struct AUBReadImage
292292

293293
using AUBReadImageCCS = AUBReadImage<false>;
294294

295-
HWTEST2_F(AUBReadImageCCS, GivenMisalignedHostPtrWhenReadingImageThenExpectationsAreMet, ImagesSupportedMatcher) {
295+
HWTEST2_F(AUBReadImageCCS, GivenMisalignedHostPtrWhenReadingImageThenExpectationsAreMet, ImageSupport) {
296296
const std::vector<size_t> pixelSizes = {1, 2, 4};
297297
const std::vector<size_t> offsets = {0, 4, 8, 12};
298298
const std::vector<size_t> sizes = {3, 2, 1};
@@ -306,7 +306,7 @@ HWTEST2_F(AUBReadImageCCS, GivenMisalignedHostPtrWhenReadingImageThenExpectation
306306
}
307307
}
308308

309-
HWTEST2_P(AUBReadImageCCS, GivenUnalignedMemoryWhenReadingImageThenExpectationsAreMet, ImagesSupportedMatcher) {
309+
HWTEST2_P(AUBReadImageCCS, GivenUnalignedMemoryWhenReadingImageThenExpectationsAreMet, ImageSupport) {
310310
testReadImageUnaligned<FamilyType>();
311311
}
312312

@@ -321,7 +321,7 @@ INSTANTIATE_TEST_SUITE_P(
321321

322322
using AUBReadImageBCS = AUBReadImage<true>;
323323

324-
HWTEST2_F(AUBReadImageBCS, GivenMisalignedHostPtrWhenReadingImageWithBlitterEnabledThenExpectationsAreMet, ImagesSupportedMatcher) {
324+
HWTEST2_F(AUBReadImageBCS, GivenMisalignedHostPtrWhenReadingImageWithBlitterEnabledThenExpectationsAreMet, ImageSupport) {
325325
const std::vector<size_t> pixelSizes = {1, 2, 4};
326326
const std::vector<size_t> offsets = {0, 4, 8, 12};
327327
const std::vector<size_t> sizes = {3, 2, 1};
@@ -336,7 +336,7 @@ HWTEST2_F(AUBReadImageBCS, GivenMisalignedHostPtrWhenReadingImageWithBlitterEnab
336336
}
337337
}
338338

339-
HWTEST2_P(AUBReadImageBCS, GivenUnalignedMemoryWhenReadingImageWithBlitterEnabledThenExpectationsAreMet, ImagesSupportedMatcher) {
339+
HWTEST2_P(AUBReadImageBCS, GivenUnalignedMemoryWhenReadingImageWithBlitterEnabledThenExpectationsAreMet, ImageSupport) {
340340

341341
auto &productHelper = pCmdQ->getDevice().getProductHelper();
342342
if (std::get<2>(GetParam()).imageType == CL_MEM_OBJECT_IMAGE3D &&

opencl/test/unit_test/aub_tests/command_queue/enqueue_write_image_aub_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ struct AUBWriteImage
290290

291291
using AUBWriteImageCCS = AUBWriteImage<false>;
292292

293-
HWTEST2_F(AUBWriteImageCCS, GivenMisalignedHostPtrWhenWritingImageThenExpectationsAreMet, ImagesSupportedMatcher) {
293+
HWTEST2_F(AUBWriteImageCCS, GivenMisalignedHostPtrWhenWritingImageThenExpectationsAreMet, ImageSupport) {
294294
const std::vector<size_t> pixelSizes = {1, 2, 4};
295295
const std::vector<size_t> offsets = {0, 4, 8, 12};
296296
const std::vector<size_t> sizes = {3, 2, 1};
@@ -304,7 +304,7 @@ HWTEST2_F(AUBWriteImageCCS, GivenMisalignedHostPtrWhenWritingImageThenExpectatio
304304
}
305305
}
306306

307-
HWTEST2_P(AUBWriteImageCCS, GivenUnalignedMemoryWhenWritingImageThenExpectationsAreMet, ImagesSupportedMatcher) {
307+
HWTEST2_P(AUBWriteImageCCS, GivenUnalignedMemoryWhenWritingImageThenExpectationsAreMet, ImageSupport) {
308308
testWriteImageUnaligned<FamilyType>();
309309
}
310310

@@ -319,7 +319,7 @@ INSTANTIATE_TEST_SUITE_P(AUBWriteImage_simple, AUBWriteImageCCS,
319319

320320
using AUBWriteImageBCS = AUBWriteImage<true>;
321321

322-
HWTEST2_F(AUBWriteImageBCS, GivenMisalignedHostPtrWhenWritingImageWithBlitterEnabledThenExpectationsAreMet, ImagesSupportedMatcher) {
322+
HWTEST2_F(AUBWriteImageBCS, GivenMisalignedHostPtrWhenWritingImageWithBlitterEnabledThenExpectationsAreMet, ImageSupport) {
323323
const std::vector<size_t> pixelSizes = {1, 2, 4};
324324
const std::vector<size_t> offsets = {0, 4, 8, 12};
325325
const std::vector<size_t> sizes = {3, 2, 1};
@@ -334,7 +334,7 @@ HWTEST2_F(AUBWriteImageBCS, GivenMisalignedHostPtrWhenWritingImageWithBlitterEna
334334
}
335335
}
336336

337-
HWTEST2_P(AUBWriteImageBCS, GivenUnalignedMemoryWhenWritingImageWithBlitterEnabledThenExpectationsAreMet, ImagesSupportedMatcher) {
337+
HWTEST2_P(AUBWriteImageBCS, GivenUnalignedMemoryWhenWritingImageWithBlitterEnabledThenExpectationsAreMet, ImageSupport) {
338338
auto &productHelper = pCmdQ->getDevice().getProductHelper();
339339
if (std::get<2>(GetParam()).imageType == CL_MEM_OBJECT_IMAGE3D &&
340340
!(productHelper.isTile64With3DSurfaceOnBCSSupported(*defaultHwInfo))) {

opencl/test/unit_test/aub_tests/fixtures/image_aub_fixture.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2022-2024 Intel Corporation
2+
* Copyright (C) 2022-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -14,13 +14,6 @@
1414

1515
#include "test_traits_common.h"
1616

17-
struct ImagesSupportedMatcher {
18-
template <PRODUCT_FAMILY productFamily>
19-
static constexpr bool isMatched() {
20-
return TestTraits<NEO::ToGfxCoreFamily<productFamily>::get()>::imagesSupported;
21-
}
22-
};
23-
2417
namespace NEO {
2518
struct ImageAubFixture : public AUBCommandStreamFixture {
2619
typedef AUBCommandStreamFixture CommandStreamFixture;

shared/test/common/test_macros/header/common_matchers.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,10 @@ struct HeaplessSupport {
263263
}
264264
}
265265
};
266+
267+
struct ImageSupport {
268+
template <PRODUCT_FAMILY productFamily>
269+
static constexpr bool isMatched() {
270+
return TestTraits<NEO::ToGfxCoreFamily<productFamily>::get()>::imagesSupported;
271+
}
272+
};

0 commit comments

Comments
 (0)