From 4dd709bfac3be6d0a7a1352926993b19e3dfda51 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Fri, 14 Jun 2024 11:54:41 +0000 Subject: [PATCH] test: remove not needed test files Signed-off-by: Mateusz Jablonski --- manifests/manifest.yml | 2 +- opencl/test/unit_test/CMakeLists.txt | 21 --------- .../api/cl_compile_program_tests.inl | 44 +++++++------------ .../api/cl_get_program_info_tests.inl | 8 ++-- .../offline_compiler_tests.cpp | 31 ++++++++++--- .../test_files/copy_buffer_to_image.cl | 23 ---------- .../test_files/copybuffer_with_header.cl | 15 ------- .../test/unit_test/test_files/emptykernel.cl | 11 ----- .../test_files/kernel_for_specific_device.skl | 2 - .../kernel_for_specific_device_options.txt | 8 ---- .../test/unit_test/test_files/simple_header.h | 12 ----- ...t_basic_kernel_memory_alignment_private.cl | 22 ---------- .../test_files/test_constant_memory.cl | 15 ------- 13 files changed, 44 insertions(+), 170 deletions(-) delete mode 100644 opencl/test/unit_test/test_files/copy_buffer_to_image.cl delete mode 100644 opencl/test/unit_test/test_files/copybuffer_with_header.cl delete mode 100644 opencl/test/unit_test/test_files/emptykernel.cl delete mode 100644 opencl/test/unit_test/test_files/kernel_for_specific_device.skl delete mode 100644 opencl/test/unit_test/test_files/kernel_for_specific_device_options.txt delete mode 100644 opencl/test/unit_test/test_files/simple_header.h delete mode 100644 opencl/test/unit_test/test_files/test_basic_kernel_memory_alignment_private.cl delete mode 100644 opencl/test/unit_test/test_files/test_constant_memory.cl diff --git a/manifests/manifest.yml b/manifests/manifest.yml index 08d6d40943..4fa6e91f0e 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -42,7 +42,7 @@ components: dest_dir: kernels_bin type: git branch: kernels_bin - revision: 2892-1869 + revision: 2892-1871 kmdaf: branch: kmdaf dest_dir: kmdaf diff --git a/opencl/test/unit_test/CMakeLists.txt b/opencl/test/unit_test/CMakeLists.txt index 947e3da4de..6fa689cdba 100644 --- a/opencl/test/unit_test/CMakeLists.txt +++ b/opencl/test/unit_test/CMakeLists.txt @@ -325,10 +325,6 @@ set(TEST_KERNEL_BINDLESS test_files/stateful_copy_buffer.cl ) -set(TEST_KERNEL_BINDLESS_IMAGES - test_files/copy_buffer_to_image.cl -) - set(TEST_KERNEL_PRINTF test_files/printf.cl ) @@ -352,9 +348,6 @@ macro(macro_for_each_platform) set(PLATFORM_TEST_KERNELS ${TEST_KERNELS}) set(IMAGE_SUPPORT FALSE) CORE_CONTAINS_PLATFORM("SUPPORTED_IMAGES" ${CORE_TYPE} ${PLATFORM_IT} IMAGE_SUPPORT) - if(NOT ${IMAGE_SUPPORT}) - list(REMOVE_ITEM PLATFORM_TEST_KERNELS "${CMAKE_CURRENT_SOURCE_DIR}/test_files/copy_buffer_to_image.cl") - endif() foreach(KERNEL_TO_REMOVE ${${CORE_TYPE}_TEST_KERNELS_BLOCKLIST}) set(KERNEL_TO_REMOVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/test_files/${KERNEL_TO_REMOVE}") @@ -401,20 +394,6 @@ macro(macro_for_each_platform) endforeach() endif() - set(BINDLESS_KERNELS_IMAGES "") - if(IMAGE_SUPPORT) - set(BINDLESS_KERNELS_IMAGES ${TEST_KERNEL_BINDLESS_IMAGES}) - endif() - - foreach(file ${TEST_KERNEL_BINDLESS} ${BINDLESS_KERNELS_IMAGES}) - foreach(REVISION_CONFIG ${${PLATFORM_IT}_${CORE_TYPE}_REVISIONS}) - parse_revision_config(${REVISION_CONFIG} ${PLATFORM_IT_LOWER} DEVICE_ID REVISION_ID) - if(NOT ("${CORE_TYPE_LOWER}" STREQUAL "gen8")) - neo_gen_kernels_with_internal_options(${PLATFORM_IT_LOWER} ${DEVICE_ID} ${REVISION_ID} ${file} "bindless" ${TEST_KERNEL_BINDLESS_internal_options}) - endif() - endforeach() - endforeach() - if(PLATFORM_2_0_LOWER) foreach(REVISION_CONFIG ${${PLATFORM_IT}_${CORE_TYPE}_REVISIONS}) parse_revision_config(${REVISION_CONFIG} ${PLATFORM_IT_LOWER} DEVICE_ID REVISION_ID) diff --git a/opencl/test/unit_test/api/cl_compile_program_tests.inl b/opencl/test/unit_test/api/cl_compile_program_tests.inl index a18a375c40..bee5bd9017 100644 --- a/opencl/test/unit_test/api/cl_compile_program_tests.inl +++ b/opencl/test/unit_test/api/cl_compile_program_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -66,47 +66,35 @@ TEST_F(ClCompileProgramTests, GivenKernelAsSingleSourceWhenCompilingProgramThenS TEST_F(ClCompileProgramTests, GivenKernelAsSourceWithHeaderWhenCompilingProgramThenSuccessIsReturned) { cl_program pProgram = nullptr; cl_program pHeader = nullptr; - size_t sourceSize = 0; - std::string testFile; - const char *simpleHeaderName = "simple_header.h"; - testFile.append(clFiles); - testFile.append("/copybuffer_with_header.cl"); + auto copyBufferWithHeader = R"===( +#include "simple_header.h" +__kernel void CopyBuffer(){} + )==="; - auto pSource = loadDataFromFile( - testFile.c_str(), - sourceSize); + auto copyBufferWithHeaderSize = sizeof(copyBufferWithHeader); - ASSERT_NE(0u, sourceSize); - ASSERT_NE(nullptr, pSource); + auto header = R"===( +extenr __kernel void AddBuffer(); + )==="; - const char *sources[1] = {pSource.get()}; + auto headerSize = sizeof(header); + auto headerName = "simple_header.h"; pProgram = clCreateProgramWithSource( pContext, 1, - sources, - &sourceSize, + ©BufferWithHeader, + ©BufferWithHeaderSize, &retVal); EXPECT_NE(nullptr, pProgram); ASSERT_EQ(CL_SUCCESS, retVal); - testFile.clear(); - testFile.append(clFiles); - testFile.append("simple_header.h"); - auto pHeaderSource = loadDataFromFile( - testFile.c_str(), - sourceSize); - - ASSERT_NE(0u, sourceSize); - ASSERT_NE(nullptr, pHeaderSource); - - const char *headerSources[1] = {pHeaderSource.get()}; pHeader = clCreateProgramWithSource( pContext, 1, - headerSources, - &sourceSize, + &header, + &headerSize, &retVal); EXPECT_NE(nullptr, pHeader); @@ -119,7 +107,7 @@ TEST_F(ClCompileProgramTests, GivenKernelAsSourceWithHeaderWhenCompilingProgramT nullptr, 1, &pHeader, - &simpleHeaderName, + &headerName, nullptr, nullptr); diff --git a/opencl/test/unit_test/api/cl_get_program_info_tests.inl b/opencl/test/unit_test/api/cl_get_program_info_tests.inl index bd07404e40..cb5b059071 100644 --- a/opencl/test/unit_test/api/cl_get_program_info_tests.inl +++ b/opencl/test/unit_test/api/cl_get_program_info_tests.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -172,7 +172,6 @@ TEST_F(ClGetProgramInfoTests, GivenIlWhenBuildingProgramThenGetProgramInfoReturn } TEST(clGetProgramInfoTest, GivenMultiDeviceProgramCreatedWithBinaryWhenGettingDevicesThenCorrectDevicesAreReturned) { - REQUIRE_IMAGES_OR_SKIP(defaultHwInfo); MockUnrestrictiveContextMultiGPU context; auto numDevicesForProgram = 2u; @@ -189,7 +188,7 @@ TEST(clGetProgramInfoTest, GivenMultiDeviceProgramCreatedWithBinaryWhenGettingDe testFile.c_str(), binarySize0); - retrieveBinaryKernelFilename(testFile, "copy_buffer_to_image_", ".bin"); + retrieveBinaryKernelFilename(testFile, "copybuffer_", ".bin"); pBinary1 = loadDataFromFile( testFile.c_str(), @@ -228,7 +227,6 @@ TEST(clGetProgramInfoTest, GivenMultiDeviceProgramCreatedWithBinaryWhenGettingDe } TEST(clGetProgramInfoTest, GivenMultiDeviceProgramCreatedWithBinaryWhenGettingBinariesThenCorrectBinariesAreReturned) { - REQUIRE_IMAGES_OR_SKIP(defaultHwInfo); MockUnrestrictiveContextMultiGPU context; auto numDevicesForProgram = 2u; @@ -245,7 +243,7 @@ TEST(clGetProgramInfoTest, GivenMultiDeviceProgramCreatedWithBinaryWhenGettingBi testFile.c_str(), binarySize0); - retrieveBinaryKernelFilename(testFile, "copy_buffer_to_image_", ".bin"); + retrieveBinaryKernelFilename(testFile, "copybuffer_", ".bin"); pBinary1 = loadDataFromFile( testFile.c_str(), diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp index a3ba55200c..97aabb70ae 100644 --- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp @@ -2859,10 +2859,14 @@ TEST(OfflineCompilerTest, GivenKernelWhenNoCharAfterKernelSourceThenBuildWithSuc auto retVal = mockOfflineCompiler->buildSourceCode(); EXPECT_EQ(CL_INVALID_PROGRAM, retVal); + const char kernelWithNoCharAfterKernel[] = "__kernel void empty(){}"; + Source source{reinterpret_cast(kernelWithNoCharAfterKernel), sizeof(kernelWithNoCharAfterKernel), "emptykernel.cl"}; + static_cast(mockOfflineCompiler->argHelper)->inputs.push_back(source); + std::vector argv = { "ocloc", "-file", - clFiles + "emptykernel.cl", + "emptykernel.cl", "-device", gEnvironment->devicePrefix.c_str()}; @@ -3248,10 +3252,12 @@ TEST(OfflineCompilerTest, givenSpirvInputFileWhenCmdLineHasOptionsThenCorrectOpt NEO::setIgcDebugVars(igcDebugVars); MockOfflineCompiler mockOfflineCompiler; + Source source{reinterpret_cast(spirvMagic.data()), spirvMagic.size(), "some_file.spv"}; + static_cast(mockOfflineCompiler.argHelper)->inputs.push_back(source); std::vector argv = { "ocloc", "-file", - clFiles + "emptykernel.cl", + "some_file.spv", "-spirv_input", "-device", gEnvironment->devicePrefix.c_str(), @@ -4065,17 +4071,28 @@ TEST(OfflineCompilerTest, givenCompilerWhenBuildSourceCodeFailsThenGenerateElfBi TEST(OfflineCompilerTest, givenDeviceSpecificKernelFileWhenCompilerIsInitializedThenOptionsAreReadFromFile) { auto mockOfflineCompiler = std::unique_ptr(new MockOfflineCompiler()); ASSERT_NE(nullptr, mockOfflineCompiler); - std::string kernelFileName(clFiles + "kernel_for_specific_device.skl"); - std::string optionsFileName(clFiles + "kernel_for_specific_device_options.txt"); + auto kernelForSpecificDevice = "__kernel void empty(){}"; + Source source{reinterpret_cast(kernelForSpecificDevice), sizeof(kernelForSpecificDevice), "emptykernel.cl"}; + static_cast(mockOfflineCompiler->argHelper)->inputs.push_back(source); - ASSERT_TRUE(fileExists(kernelFileName)); - ASSERT_TRUE(fileExists(optionsFileName)); + const char options[] = R"===( +/* + * Copyright (C) 2024 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +-cl-opt-disable +)==="; + Source optionsSource{reinterpret_cast(options), sizeof(options), "emptykernel_options.txt"}; + static_cast(mockOfflineCompiler->argHelper)->inputs.push_back(optionsSource); std::vector argv = { "ocloc", "-q", "-file", - kernelFileName, + "emptykernel.cl", "-device", gEnvironment->devicePrefix.c_str()}; diff --git a/opencl/test/unit_test/test_files/copy_buffer_to_image.cl b/opencl/test/unit_test/test_files/copy_buffer_to_image.cl deleted file mode 100644 index d47f01be89..0000000000 --- a/opencl/test/unit_test/test_files/copy_buffer_to_image.cl +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2020 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable - -__kernel void CopyBufferToImage3d(__global uchar *src, - __write_only image3d_t output, - int srcOffset, - int4 dstOffset, - uint2 Pitch) { - const uint x = get_global_id(0); - const uint y = get_global_id(1); - const uint z = get_global_id(2); - - int4 dstCoord = (int4)(x, y, z, 0) + dstOffset; - uint LOffset = srcOffset + (y * Pitch.x) + (z * Pitch.y); - - write_imageui(output, dstCoord, (uint4)(*(src + LOffset + x), 0, 0, 1)); -} \ No newline at end of file diff --git a/opencl/test/unit_test/test_files/copybuffer_with_header.cl b/opencl/test/unit_test/test_files/copybuffer_with_header.cl deleted file mode 100644 index 618b630e3b..0000000000 --- a/opencl/test/unit_test/test_files/copybuffer_with_header.cl +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (C) 2018-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "simple_header.h" -__kernel void -CopyBuffer( - __global unsigned int *src, - __global unsigned int *dst) { - int id = (int)get_global_id(0); - dst[id] = src[id]; -} diff --git a/opencl/test/unit_test/test_files/emptykernel.cl b/opencl/test/unit_test/test_files/emptykernel.cl deleted file mode 100644 index b8e16e07a5..0000000000 --- a/opencl/test/unit_test/test_files/emptykernel.cl +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (C) 2018-2020 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - - /* No character after the last "}" */ - __kernel void empty() -{ -} \ No newline at end of file diff --git a/opencl/test/unit_test/test_files/kernel_for_specific_device.skl b/opencl/test/unit_test/test_files/kernel_for_specific_device.skl deleted file mode 100644 index 27bd526cee..0000000000 --- a/opencl/test/unit_test/test_files/kernel_for_specific_device.skl +++ /dev/null @@ -1,2 +0,0 @@ -__kernel void simple_device_specific_kernel() { -} \ No newline at end of file diff --git a/opencl/test/unit_test/test_files/kernel_for_specific_device_options.txt b/opencl/test/unit_test/test_files/kernel_for_specific_device_options.txt deleted file mode 100644 index cdb6089f8a..0000000000 --- a/opencl/test/unit_test/test_files/kernel_for_specific_device_options.txt +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (C) 2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - --cl-opt-disable diff --git a/opencl/test/unit_test/test_files/simple_header.h b/opencl/test/unit_test/test_files/simple_header.h deleted file mode 100644 index 5ba49f9b37..0000000000 --- a/opencl/test/unit_test/test_files/simple_header.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (C) 2018-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma once - -extern __kernel void AddBuffer( - __global float *src, - __global float *dst); diff --git a/opencl/test/unit_test/test_files/test_basic_kernel_memory_alignment_private.cl b/opencl/test/unit_test/test_files/test_basic_kernel_memory_alignment_private.cl deleted file mode 100644 index 26833511a8..0000000000 --- a/opencl/test/unit_test/test_files/test_basic_kernel_memory_alignment_private.cl +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2018-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -__kernel void test(__global ulong *results) { - __private char mem0[3]; - __private char2 mem2[3]; - __private char3 mem3[3]; - __private char4 mem4[3]; - __private char8 mem8[3]; - __private char16 mem16[3]; - - results[0] = (ulong)&mem0[0]; - results[1] = (ulong)&mem2[0]; - results[2] = (ulong)&mem3[0]; - results[3] = (ulong)&mem4[0]; - results[4] = (ulong)&mem8[0]; - results[5] = (ulong)&mem16[0]; -} diff --git a/opencl/test/unit_test/test_files/test_constant_memory.cl b/opencl/test/unit_test/test_files/test_constant_memory.cl deleted file mode 100644 index 3e98f6fa92..0000000000 --- a/opencl/test/unit_test/test_files/test_constant_memory.cl +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (C) 2018-2021 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -__constant uint constant_a[2] = {0xabcd5432u, 0xaabb5533u}; - -__kernel void test(__global uint *in, __global uint *out) { - int i = get_global_id(0); - int j = get_global_id(0) % (sizeof(constant_a) / sizeof(constant_a[0])); - - out[i] = constant_a[j]; -}