diff --git a/unit_tests/aub_tests/command_queue/CMakeLists.txt b/unit_tests/aub_tests/command_queue/CMakeLists.txt index 595c49c132..cea07c70cb 100644 --- a/unit_tests/aub_tests/command_queue/CMakeLists.txt +++ b/unit_tests/aub_tests/command_queue/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2017-2019 Intel Corporation +# Copyright (C) 2017-2020 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -21,7 +21,6 @@ target_sources(igdrcl_aub_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_read_write_image_aub_fixture.h ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_verify_memory_buffer_aub_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_verify_memory_image_aub_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_with_timestamp_packet_aub_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_write_buffer_aub_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_write_buffer_rect_aub_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_write_copy_read_buffer_aub_tests.cpp diff --git a/unit_tests/aub_tests/command_queue/enqueue_with_timestamp_packet_aub_tests.cpp b/unit_tests/aub_tests/command_queue/enqueue_with_timestamp_packet_aub_tests.cpp deleted file mode 100644 index 6d22af43c7..0000000000 --- a/unit_tests/aub_tests/command_queue/enqueue_with_timestamp_packet_aub_tests.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2018-2020 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "core/helpers/timestamp_packet.h" -#include "core/unit_tests/helpers/debug_manager_state_restore.h" -#include "core/utilities/tag_allocator.h" -#include "runtime/event/event.h" -#include "runtime/helpers/hardware_commands_helper.h" -#include "runtime/mem_obj/buffer.h" -#include "test.h" -#include "unit_tests/aub_tests/command_queue/command_enqueue_fixture.h" - -using namespace NEO; - -struct TimestampPacketAubTests : public CommandEnqueueAUBFixture, public ::testing::Test { - void SetUp() override { - DebugManagerStateRestore restore; - DebugManager.flags.EnableTimestampPacket.set(true); - CommandEnqueueAUBFixture::SetUp(); - } - - void TearDown() override { - CommandEnqueueAUBFixture::TearDown(); - } -}; - -HWTEST_F(TimestampPacketAubTests, givenTwoBatchedEnqueuesWhenDependencyIsResolvedThenDecrementCounterOnGpu) { - MockContext context(pCmdQ->getDevice().getSpecializedDevice()); - pCommandStreamReceiver->overrideDispatchPolicy(DispatchMode::BatchedDispatch); - - const size_t bufferSize = 1024; - auto retVal = CL_SUCCESS; - uint8_t initialMemory[bufferSize] = {}; - uint8_t writePattern1[bufferSize]; - uint8_t writePattern2[bufferSize]; - std::fill(writePattern1, writePattern1 + sizeof(writePattern1), 1); - std::fill(writePattern2, writePattern2 + sizeof(writePattern2), 1); - - auto buffer = std::unique_ptr(Buffer::create(&context, CL_MEM_COPY_HOST_PTR, bufferSize, initialMemory, retVal)); - //make sure that GPU copy is used - buffer->forceDisallowCPUCopy = true; - cl_event outEvent1, outEvent2; - - pCmdQ->enqueueWriteBuffer(buffer.get(), CL_FALSE, 0, bufferSize, writePattern1, nullptr, 0, nullptr, &outEvent1); - auto node1 = castToObject(outEvent1)->getTimestampPacketNodes()->peekNodes().at(0); - node1->getBaseGraphicsAllocation()->setAubWritable(true, 0xffffffff); // allow to write again after Buffer::create - - pCmdQ->enqueueWriteBuffer(buffer.get(), CL_TRUE, 0, bufferSize, writePattern2, nullptr, 0, nullptr, &outEvent2); - auto node2 = castToObject(outEvent2)->getTimestampPacketNodes()->peekNodes().at(0); - - expectMemory(reinterpret_cast(buffer->getGraphicsAllocation()->getGpuAddress()), writePattern2, bufferSize); - - uint32_t expectedDepsCount = 0; - auto dependenciesGpuAddress = node1->getGpuAddress() + offsetof(TimestampPacketStorage, implicitDependenciesCount); - expectMemory(reinterpret_cast(dependenciesGpuAddress), - &expectedDepsCount, sizeof(uint32_t)); - - uint32_t expectedEndTimestamp[2] = {0, 0}; - auto endTimestampAddress1 = node1->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd); - auto endTimestampAddress2 = node2->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd); - expectMemory(reinterpret_cast(endTimestampAddress1), expectedEndTimestamp, 2 * sizeof(uint32_t)); - expectMemory(reinterpret_cast(endTimestampAddress2), expectedEndTimestamp, 2 * sizeof(uint32_t)); - - clReleaseEvent(outEvent1); - clReleaseEvent(outEvent2); -} - -HWTEST_F(TimestampPacketAubTests, givenMultipleWalkersWhenEnqueueingThenWriteAllTimestamps) { - MockContext context(pCmdQ->getDevice().getSpecializedDevice()); - const size_t bufferSize = 70; - const size_t writeSize = bufferSize - 2; - uint8_t writeData[writeSize] = {}; - cl_int retVal = CL_SUCCESS; - cl_event outEvent; - - auto buffer = std::unique_ptr(Buffer::create(&context, CL_MEM_READ_WRITE, bufferSize, nullptr, retVal)); - buffer->forceDisallowCPUCopy = true; - - pCmdQ->enqueueWriteBuffer(buffer.get(), CL_TRUE, 1, writeSize, writeData, nullptr, 0, nullptr, &outEvent); - - auto ×tampNodes = castToObject(outEvent)->getTimestampPacketNodes()->peekNodes(); - - EXPECT_EQ(2u, timestampNodes.size()); - - uint32_t expectedEndTimestamp[2] = {0, 0}; - auto endTimestampAddress1 = timestampNodes.at(0)->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd); - auto endTimestampAddress2 = timestampNodes.at(1)->getGpuAddress() + offsetof(TimestampPacketStorage, packets[0].contextEnd); - expectMemory(reinterpret_cast(endTimestampAddress1), expectedEndTimestamp, 2 * sizeof(uint32_t)); - expectMemory(reinterpret_cast(endTimestampAddress2), expectedEndTimestamp, 2 * sizeof(uint32_t)); - - clReleaseEvent(outEvent); -}