2018-03-27 20:30:05 +08:00
|
|
|
/*
|
2023-01-13 03:31:00 +08:00
|
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
2018-03-27 20:30:05 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-03-27 20:30:05 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-30 03:17:47 +08:00
|
|
|
#include "shared/source/gen9/hw_cmds.h"
|
|
|
|
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
|
|
|
#include "shared/test/common/test_macros/test.h"
|
2021-12-15 01:40:08 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/helpers/hardware_commands_helper.h"
|
|
|
|
#include "opencl/source/mem_obj/buffer.h"
|
2020-05-28 20:05:12 +08:00
|
|
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
2023-01-13 03:31:00 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
2018-03-27 20:30:05 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2018-03-27 20:30:05 +08:00
|
|
|
|
2022-08-16 22:51:17 +08:00
|
|
|
using Gen9KernelTest = Test<ClDeviceFixture>;
|
2018-03-27 20:30:05 +08:00
|
|
|
GEN9TEST_F(Gen9KernelTest, givenKernelWhenCanTransformImagesIsCalledThenReturnsTrue) {
|
2020-01-14 21:32:11 +08:00
|
|
|
MockKernelWithInternals mockKernel(*pClDevice);
|
2018-03-27 20:30:05 +08:00
|
|
|
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
|
|
|
EXPECT_TRUE(retVal);
|
|
|
|
}
|
2021-06-21 23:25:03 +08:00
|
|
|
GEN9TEST_F(Gen9KernelTest, givenBuiltinKernelWhenCanTransformImagesIsCalledThenReturnsFalse) {
|
|
|
|
MockKernelWithInternals mockKernel(*pClDevice);
|
|
|
|
mockKernel.mockKernel->isBuiltIn = true;
|
|
|
|
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
|
|
|
EXPECT_FALSE(retVal);
|
|
|
|
}
|