mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Remove device enqueue part 4
-remove structs, class and tests with REQUIRE_DEVICE_ENQUEUE_OR_SKIP Related-To: NEO-6559 Signed-off-by: Katarzyna Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
45ae4fe881
commit
c52223e642
@ -20,7 +20,6 @@ set(IGDRCL_SRCS_tests_fixtures
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_instrumentation_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enqueue_handler_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/execution_model_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/execution_model_kernel_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hello_world_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hello_world_kernel_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image_fixture.cpp
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -11,104 +11,10 @@
|
||||
|
||||
#include "opencl/source/device_queue/device_queue.h"
|
||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/execution_model_kernel_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
|
||||
|
||||
class DeviceQueueFixture {
|
||||
public:
|
||||
void SetUp(Context *context, ClDevice *device) {
|
||||
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(device);
|
||||
cl_int errcodeRet = 0;
|
||||
cl_queue_properties properties[3];
|
||||
|
||||
properties[0] = CL_QUEUE_PROPERTIES;
|
||||
properties[1] = CL_QUEUE_ON_DEVICE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
|
||||
properties[2] = 0;
|
||||
|
||||
ASSERT_NE(nullptr, context);
|
||||
ASSERT_NE(nullptr, device);
|
||||
|
||||
pDevQueue = DeviceQueue::create(context, device,
|
||||
properties[0],
|
||||
errcodeRet);
|
||||
|
||||
ASSERT_NE(nullptr, pDevQueue);
|
||||
|
||||
auto devQueue = context->getDefaultDeviceQueue();
|
||||
|
||||
ASSERT_NE(nullptr, devQueue);
|
||||
EXPECT_EQ(pDevQueue, devQueue);
|
||||
}
|
||||
|
||||
void TearDown() {
|
||||
delete pDevQueue;
|
||||
}
|
||||
|
||||
DeviceQueue *pDevQueue = nullptr;
|
||||
};
|
||||
|
||||
class ExecutionModelKernelTest : public ExecutionModelKernelFixture,
|
||||
public CommandQueueHwFixture,
|
||||
public DeviceQueueFixture,
|
||||
public ::testing::WithParamInterface<std::tuple<const char *, const char *>> {
|
||||
public:
|
||||
void SetUp() override {
|
||||
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
|
||||
|
||||
DebugManager.flags.EnableTimestampPacket.set(0);
|
||||
ExecutionModelKernelFixture::SetUp(std::get<0>(GetParam()), std::get<1>(GetParam()));
|
||||
CommandQueueHwFixture::SetUp(pClDevice, 0);
|
||||
DeviceQueueFixture::SetUp(context, pClDevice);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
if (!IsSkipped()) {
|
||||
DeviceQueueFixture::TearDown();
|
||||
CommandQueueHwFixture::TearDown();
|
||||
ExecutionModelKernelFixture::TearDown();
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<KernelOperation> createBlockedCommandsData(CommandQueue &commandQueue) {
|
||||
auto commandStream = new LinearStream();
|
||||
|
||||
auto &gpgpuCsr = commandQueue.getGpgpuCommandStreamReceiver();
|
||||
gpgpuCsr.ensureCommandBufferAllocation(*commandStream, 1, 1);
|
||||
|
||||
return std::make_unique<KernelOperation>(commandStream, *gpgpuCsr.getInternalAllocationStorage());
|
||||
}
|
||||
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
};
|
||||
|
||||
class ExecutionModelSchedulerTest : public ClDeviceFixture,
|
||||
public CommandQueueHwFixture,
|
||||
public DeviceQueueFixture {
|
||||
public:
|
||||
void SetUp() override {
|
||||
ClDeviceFixture::SetUp();
|
||||
CommandQueueHwFixture::SetUp(pClDevice, 0);
|
||||
DeviceQueueFixture::SetUp(context, pClDevice);
|
||||
|
||||
parentKernel = MockParentKernel::create(*context);
|
||||
ASSERT_NE(nullptr, parentKernel);
|
||||
kernelInfos = MockKernel::toKernelInfoContainer(parentKernel->getKernelInfo(), rootDeviceIndex);
|
||||
pMultiDeviceKernel = new MockMultiDeviceKernel(MockMultiDeviceKernel::toKernelVector(parentKernel), kernelInfos);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
pMultiDeviceKernel->release();
|
||||
|
||||
DeviceQueueFixture::TearDown();
|
||||
CommandQueueHwFixture::TearDown();
|
||||
ClDeviceFixture::TearDown();
|
||||
}
|
||||
KernelInfoContainer kernelInfos;
|
||||
MockMultiDeviceKernel *pMultiDeviceKernel = nullptr;
|
||||
MockParentKernel *parentKernel = nullptr;
|
||||
};
|
||||
|
||||
struct ParentKernelCommandQueueFixture : public CommandQueueHwFixture,
|
||||
testing::Test {
|
||||
|
||||
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/kernel/kernel.h"
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/program/program_from_binary.h"
|
||||
#include "opencl/test/unit_test/test_macros/test_checks_ocl.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct ExecutionModelKernelFixture : public ProgramFromBinaryFixture,
|
||||
public PlatformFixture {
|
||||
using ProgramFromBinaryFixture::SetUp;
|
||||
void SetUp(const char *binaryFileName, const char *kernelName) {
|
||||
REQUIRE_DEVICE_ENQUEUE_OR_SKIP(defaultHwInfo);
|
||||
|
||||
PlatformFixture::SetUp();
|
||||
|
||||
std::string options("-cl-std=CL2.0");
|
||||
this->setOptions(options);
|
||||
ProgramFromBinaryFixture::SetUp(binaryFileName, kernelName);
|
||||
|
||||
ASSERT_NE(nullptr, pProgram);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = pProgram->build(
|
||||
pProgram->getDevices(),
|
||||
nullptr,
|
||||
false);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
pMultiDeviceKernel = MultiDeviceKernel::create<MockKernel>(pProgram,
|
||||
pProgram->getKernelInfosForKernel(kernelName),
|
||||
&retVal);
|
||||
pKernel = pMultiDeviceKernel->getKernel(rootDeviceIndex);
|
||||
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, pKernel);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
if (IsSkipped()) {
|
||||
return;
|
||||
}
|
||||
if (pMultiDeviceKernel != nullptr) {
|
||||
pMultiDeviceKernel->release();
|
||||
}
|
||||
|
||||
ProgramFromBinaryFixture::TearDown();
|
||||
PlatformFixture::TearDown();
|
||||
|
||||
if (pDevice != nullptr) {
|
||||
delete pDevice;
|
||||
pDevice = nullptr;
|
||||
}
|
||||
if (pClDevice != nullptr) {
|
||||
delete pClDevice;
|
||||
pClDevice = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
MultiDeviceKernel *pMultiDeviceKernel = nullptr;
|
||||
Kernel *pKernel = nullptr;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
Reference in New Issue
Block a user