From b6825933f87c325fac4b2c515bd1dc3818221309 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Thu, 23 Jan 2020 11:57:37 +0100 Subject: [PATCH] Replace Event::eventNotReady with CompletionStamp::levelNotReady - move some files to core - remove unnecessary includes Related-To: NEO-4175 Change-Id: Ib33dff644452c7cfd6fda7e9bb4b68cd6eb3a61c Signed-off-by: Mateusz Hoppe --- core/command_container/cmdcontainer.h | 2 +- core/command_stream/CMakeLists.txt | 1 + .../command_stream/csr_definitions.h | 0 core/gen11/preamble_gen11.cpp | 4 +-- core/gen12lp/preamble_gen12lp.cpp | 4 +-- core/gen9/preamble_gen9.cpp | 4 +-- core/gen9/preemption_gen9.cpp | 4 +-- core/helpers/CMakeLists.txt | 5 +++ core/helpers/completion_stamp.cpp | 14 ++++++++ core/helpers/completion_stamp.h | 5 ++- .../helpers/dirty_state_helpers.cpp | 4 +-- .../helpers/dirty_state_helpers.h | 2 +- {runtime => core}/helpers/flush_stamp.cpp | 4 +-- {runtime => core}/helpers/flush_stamp.h | 2 +- core/helpers/options.h | 4 +-- runtime/command_queue/command_queue.cpp | 4 +-- .../cpu_data_transfer_handler.cpp | 4 +-- runtime/command_queue/enqueue_common.h | 10 +++--- runtime/command_stream/CMakeLists.txt | 1 - .../command_stream_receiver.cpp | 4 +-- .../command_stream/command_stream_receiver.h | 2 +- .../command_stream_receiver_hw.h | 2 +- .../command_stream_receiver_hw_base.inl | 7 ++-- .../command_stream_receiver_hw_ext.inl | 4 +-- .../command_stream/submissions_aggregator.cpp | 4 +-- .../command_stream/submissions_aggregator.h | 2 +- runtime/event/async_events_handler.cpp | 2 +- runtime/event/event.cpp | 22 ++++++------- runtime/event/event.h | 9 +++--- runtime/event/event_builder.cpp | 4 +-- runtime/event/event_tracker.cpp | 10 +++--- runtime/event/user_event.cpp | 8 ++--- runtime/helpers/CMakeLists.txt | 4 --- runtime/helpers/hardware_commands_helper.inl | 2 +- runtime/helpers/state_compute_mode_helper.h | 4 +-- runtime/helpers/task_information.cpp | 4 +-- .../os_interface/linux/drm_command_stream.inl | 2 +- .../windows/wddm_device_command_stream.inl | 2 +- .../gl/windows/gl_arb_sync_event_windows.cpp | 2 +- .../gl/windows/gl_sync_event_windows.cpp | 4 +-- .../command_queue/command_queue_hw_tests.cpp | 14 ++++---- .../command_queue/command_queue_tests.cpp | 2 +- .../command_queue/enqueue_barrier_tests.cpp | 2 +- .../command_queue/enqueue_handler_tests.cpp | 8 ++--- .../enqueue_read_buffer_event_tests.cpp | 6 ++-- .../enqueue_write_buffer_event_tests.cpp | 6 ++-- ...and_stream_receiver_flush_task_2_tests.cpp | 2 +- ...nd_stream_receiver_with_aub_dump_tests.cpp | 2 +- .../submissions_aggregator_tests.cpp | 2 +- .../event/async_events_handler_tests.cpp | 28 ++++++++-------- unit_tests/event/event_tests.cpp | 32 +++++++++---------- unit_tests/event/event_tracker_tests.cpp | 18 +++++------ unit_tests/event/user_events_tests.cpp | 28 ++++++++-------- unit_tests/event/user_events_tests_mt.cpp | 2 +- .../helpers/dirty_state_helpers_tests.cpp | 4 +-- unit_tests/helpers/dispatch_flags_helper.h | 4 +-- unit_tests/helpers/flush_stamp_tests.cpp | 4 +-- unit_tests/kernel/kernel_tests.cpp | 2 +- unit_tests/mocks/mock_csr.h | 2 +- .../linux/drm_command_stream_tests.cpp | 2 +- .../windows/device_command_stream_tests.cpp | 2 +- unit_tests/profiling/profiling_tests.cpp | 2 +- ...blocked_enqueue_barrier_scenario_tests.cpp | 4 +-- .../gl/windows/gl_arb_sync_event_tests.cpp | 4 +-- .../sharings/gl/windows/gl_sharing_tests.cpp | 4 +-- 65 files changed, 190 insertions(+), 178 deletions(-) rename {runtime => core}/command_stream/csr_definitions.h (100%) create mode 100644 core/helpers/completion_stamp.cpp rename {runtime => core}/helpers/dirty_state_helpers.cpp (84%) rename {runtime => core}/helpers/dirty_state_helpers.h (87%) rename {runtime => core}/helpers/flush_stamp.cpp (94%) rename {runtime => core}/helpers/flush_stamp.h (96%) diff --git a/core/command_container/cmdcontainer.h b/core/command_container/cmdcontainer.h index d56204ed10..b6be2f803e 100644 --- a/core/command_container/cmdcontainer.h +++ b/core/command_container/cmdcontainer.h @@ -6,10 +6,10 @@ */ #pragma once +#include "core/command_stream/csr_definitions.h" #include "core/helpers/heap_helper.h" #include "core/helpers/non_copyable_or_moveable.h" #include "core/indirect_heap/indirect_heap.h" -#include "runtime/command_stream/csr_definitions.h" #include #include diff --git a/core/command_stream/CMakeLists.txt b/core/command_stream/CMakeLists.txt index 1c25a86676..e9e58064bf 100644 --- a/core/command_stream/CMakeLists.txt +++ b/core/command_stream/CMakeLists.txt @@ -6,6 +6,7 @@ set(NEO_CORE_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/csr_definitions.h ${CMAKE_CURRENT_SOURCE_DIR}/csr_deps.cpp ${CMAKE_CURRENT_SOURCE_DIR}/csr_deps.h ${CMAKE_CURRENT_SOURCE_DIR}/linear_stream.cpp diff --git a/runtime/command_stream/csr_definitions.h b/core/command_stream/csr_definitions.h similarity index 100% rename from runtime/command_stream/csr_definitions.h rename to core/command_stream/csr_definitions.h diff --git a/core/gen11/preamble_gen11.cpp b/core/gen11/preamble_gen11.cpp index 0e7bd5ca56..ab9315a702 100644 --- a/core/gen11/preamble_gen11.cpp +++ b/core/gen11/preamble_gen11.cpp @@ -1,13 +1,13 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/command_stream/csr_definitions.h" #include "core/helpers/pipeline_select_helper.h" #include "core/helpers/preamble_bdw_plus.inl" -#include "runtime/command_stream/csr_definitions.h" #include "reg_configs_common.h" diff --git a/core/gen12lp/preamble_gen12lp.cpp b/core/gen12lp/preamble_gen12lp.cpp index 11764f4827..5b8aa93363 100644 --- a/core/gen12lp/preamble_gen12lp.cpp +++ b/core/gen12lp/preamble_gen12lp.cpp @@ -1,12 +1,12 @@ /* - * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/command_stream/csr_definitions.h" #include "core/helpers/preamble_bdw_plus.inl" -#include "runtime/command_stream/csr_definitions.h" #include "runtime/gen12lp/helpers_gen12lp.h" #include "runtime/helpers/hardware_commands_helper.h" diff --git a/core/gen9/preamble_gen9.cpp b/core/gen9/preamble_gen9.cpp index db86cb94f4..ce9dee7c5c 100644 --- a/core/gen9/preamble_gen9.cpp +++ b/core/gen9/preamble_gen9.cpp @@ -1,12 +1,12 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/command_stream/csr_definitions.h" #include "core/helpers/preamble_bdw_plus.inl" -#include "runtime/command_stream/csr_definitions.h" namespace NEO { diff --git a/core/gen9/preemption_gen9.cpp b/core/gen9/preemption_gen9.cpp index ede34b03e3..37a221d1d2 100644 --- a/core/gen9/preemption_gen9.cpp +++ b/core/gen9/preemption_gen9.cpp @@ -1,14 +1,14 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/command_stream/csr_definitions.h" #include "core/command_stream/preemption.h" #include "core/command_stream/preemption.inl" #include "runtime/built_ins/built_ins.h" -#include "runtime/command_stream/csr_definitions.h" #include diff --git a/core/helpers/CMakeLists.txt b/core/helpers/CMakeLists.txt index 8307924b6f..73389f68a5 100644 --- a/core/helpers/CMakeLists.txt +++ b/core/helpers/CMakeLists.txt @@ -13,15 +13,20 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cache_policy.h ${CMAKE_CURRENT_SOURCE_DIR}/common_types.h + ${CMAKE_CURRENT_SOURCE_DIR}/completion_stamp.cpp ${CMAKE_CURRENT_SOURCE_DIR}/completion_stamp.h ${CMAKE_CURRENT_SOURCE_DIR}/debug_helpers.h ${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter_helper.h + ${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.h ${CMAKE_CURRENT_SOURCE_DIR}/engine_control.h ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/engine_node_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/engine_node_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/extendable_enum.h ${CMAKE_CURRENT_SOURCE_DIR}/file_io.cpp ${CMAKE_CURRENT_SOURCE_DIR}/file_io.h + ${CMAKE_CURRENT_SOURCE_DIR}/flush_stamp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/flush_stamp.h ${CMAKE_CURRENT_SOURCE_DIR}/hash.h ${CMAKE_CURRENT_SOURCE_DIR}/heap_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/heap_helper.h diff --git a/core/helpers/completion_stamp.cpp b/core/helpers/completion_stamp.cpp new file mode 100644 index 0000000000..5c2dd50aae --- /dev/null +++ b/core/helpers/completion_stamp.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2017-2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "core/helpers/completion_stamp.h" + +namespace NEO { + +const uint32_t CompletionStamp::levelNotReady = 0xFFFFFFF0; + +} // namespace NEO diff --git a/core/helpers/completion_stamp.h b/core/helpers/completion_stamp.h index ed318ad1f8..fa68977369 100644 --- a/core/helpers/completion_stamp.h +++ b/core/helpers/completion_stamp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,5 +15,8 @@ struct CompletionStamp { uint32_t taskCount; uint32_t taskLevel; FlushStamp flushStamp; + + static const uint32_t levelNotReady; }; + } // namespace NEO diff --git a/runtime/helpers/dirty_state_helpers.cpp b/core/helpers/dirty_state_helpers.cpp similarity index 84% rename from runtime/helpers/dirty_state_helpers.cpp rename to core/helpers/dirty_state_helpers.cpp index 51a05a5897..50a848fce6 100644 --- a/runtime/helpers/dirty_state_helpers.cpp +++ b/core/helpers/dirty_state_helpers.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "runtime/helpers/dirty_state_helpers.h" +#include "core/helpers/dirty_state_helpers.h" #include "core/indirect_heap/indirect_heap.h" diff --git a/runtime/helpers/dirty_state_helpers.h b/core/helpers/dirty_state_helpers.h similarity index 87% rename from runtime/helpers/dirty_state_helpers.h rename to core/helpers/dirty_state_helpers.h index c97ea156b5..7bafc6e664 100644 --- a/runtime/helpers/dirty_state_helpers.h +++ b/core/helpers/dirty_state_helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/runtime/helpers/flush_stamp.cpp b/core/helpers/flush_stamp.cpp similarity index 94% rename from runtime/helpers/flush_stamp.cpp rename to core/helpers/flush_stamp.cpp index 1aac37d91c..55ff87ee9b 100644 --- a/runtime/helpers/flush_stamp.cpp +++ b/core/helpers/flush_stamp.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "runtime/helpers/flush_stamp.h" +#include "core/helpers/flush_stamp.h" using namespace NEO; diff --git a/runtime/helpers/flush_stamp.h b/core/helpers/flush_stamp.h similarity index 96% rename from runtime/helpers/flush_stamp.h rename to core/helpers/flush_stamp.h index e19ccd9e65..7a02a62a7a 100644 --- a/runtime/helpers/flush_stamp.h +++ b/core/helpers/flush_stamp.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * diff --git a/core/helpers/options.h b/core/helpers/options.h index b5675122ed..b541b5707e 100644 --- a/core/helpers/options.h +++ b/core/helpers/options.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -37,7 +37,7 @@ struct HardwareInfo; extern const char *folderAUB; // Initial value for HW tag -// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then Event::EventNotReady. +// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then CompletionStamp::levelNotReady. extern uint32_t initialHardwareTag; // Number of devices in the platform diff --git a/runtime/command_queue/command_queue.cpp b/runtime/command_queue/command_queue.cpp index 7768ca5feb..8beb9ad30d 100644 --- a/runtime/command_queue/command_queue.cpp +++ b/runtime/command_queue/command_queue.cpp @@ -134,7 +134,7 @@ volatile uint32_t *CommandQueue::getHwTagAddress() const { bool CommandQueue::isCompleted(uint32_t taskCount) const { uint32_t tag = getHwTag(); - DEBUG_BREAK_IF(tag == Event::eventNotReady); + DEBUG_BREAK_IF(tag == CompletionStamp::levelNotReady); return tag >= taskCount; } @@ -284,7 +284,7 @@ cl_int CommandQueue::enqueueReleaseSharedObjects(cl_uint numObjects, const cl_me void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionStamp) { DEBUG_BREAK_IF(this->taskLevel > completionStamp.taskLevel); DEBUG_BREAK_IF(this->taskCount > completionStamp.taskCount); - if (completionStamp.taskCount != Event::eventNotReady) { + if (completionStamp.taskCount != CompletionStamp::levelNotReady) { taskCount = completionStamp.taskCount; } flushStamp->setStamp(completionStamp.flushStamp); diff --git a/runtime/command_queue/cpu_data_transfer_handler.cpp b/runtime/command_queue/cpu_data_transfer_handler.cpp index 8e428a39ed..1ccf4edc19 100644 --- a/runtime/command_queue/cpu_data_transfer_handler.cpp +++ b/runtime/command_queue/cpu_data_transfer_handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -44,7 +44,7 @@ void *CommandQueue::cpuDataTransferHandler(TransferProperties &transferPropertie } if (eventsRequest.outEvent) { - eventBuilder.create(this, transferProperties.cmdType, Event::eventNotReady, Event::eventNotReady); + eventBuilder.create(this, transferProperties.cmdType, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); outEventObj = eventBuilder.getEvent(); outEventObj->setQueueTimeStamp(); outEventObj->setCPUProfilingPath(true); diff --git a/runtime/command_queue/enqueue_common.h b/runtime/command_queue/enqueue_common.h index 769e3dbfa5..2da81da7c2 100644 --- a/runtime/command_queue/enqueue_common.h +++ b/runtime/command_queue/enqueue_common.h @@ -157,7 +157,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, } EventBuilder eventBuilder; if (event) { - eventBuilder.create(this, commandType, Event::eventNotReady, 0); + eventBuilder.create(this, commandType, CompletionStamp::levelNotReady, 0); *event = eventBuilder.getEvent(); if (eventBuilder.getEvent()->isProfilingEnabled()) { eventBuilder.getEvent()->setQueueTimeStamp(&queueTimeStamp); @@ -263,7 +263,7 @@ void CommandQueueHw::enqueueHandler(Surface **surfacesForResidency, } } - CompletionStamp completionStamp = {Event::eventNotReady, taskLevel, 0}; + CompletionStamp completionStamp = {CompletionStamp::levelNotReady, taskLevel, 0}; const EnqueueProperties enqueueProperties(blitEnqueue, !multiDispatchInfo.empty(), isCacheFlushCommand(commandType), flushDependenciesForNonKernelCommand, &blitPropertiesContainer); @@ -580,7 +580,7 @@ template void CommandQueueHw::obtainTaskLevelAndBlockedStatus(unsigned int &taskLevel, cl_uint &numEventsInWaitList, const cl_event *&eventWaitList, bool &blockQueueStatus, unsigned int commandType) { auto isQueueBlockedStatus = isQueueBlocked(); taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList); - blockQueueStatus = (taskLevel == Event::eventNotReady) || isQueueBlockedStatus; + blockQueueStatus = (taskLevel == CompletionStamp::levelNotReady) || isQueueBlockedStatus; auto taskLevelUpdateRequired = isTaskLevelUpdateRequired(taskLevel, eventWaitList, numEventsInWaitList, commandType); if (taskLevelUpdateRequired) { @@ -593,7 +593,7 @@ template bool CommandQueueHw::isTaskLevelUpdateRequired(const uint32_t &taskLevel, const cl_event *eventWaitList, const cl_uint &numEventsInWaitList, unsigned int commandType) { bool updateTaskLevel = true; //if we are blocked by user event then no update - if (taskLevel == Event::eventNotReady) { + if (taskLevel == CompletionStamp::levelNotReady) { updateTaskLevel = false; } //if we are executing command without kernel then it will inherit state from @@ -756,7 +756,7 @@ CompletionStamp CommandQueueHw::enqueueNonBlocked( dispatchFlags.csrDependencies.makeResident(getGpgpuCommandStreamReceiver()); } - DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady); + DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); if (anyUncacheableArgs) { dispatchFlags.l3CacheSettings = L3CachingSettings::l3CacheOff; diff --git a/runtime/command_stream/CMakeLists.txt b/runtime/command_stream/CMakeLists.txt index e71a7846c7..883d836381 100644 --- a/runtime/command_stream/CMakeLists.txt +++ b/runtime/command_stream/CMakeLists.txt @@ -24,7 +24,6 @@ set(RUNTIME_SRCS_COMMAND_STREAM ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_with_aub_dump.inl ${CMAKE_CURRENT_SOURCE_DIR}/create_command_stream_impl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/create_command_stream_impl.h - ${CMAKE_CURRENT_SOURCE_DIR}/csr_definitions.h ${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/command_stream_receiver_simulated_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_common_hw_base.inl diff --git a/runtime/command_stream/command_stream_receiver.cpp b/runtime/command_stream/command_stream_receiver.cpp index b84260bb6d..b848e77d2e 100644 --- a/runtime/command_stream/command_stream_receiver.cpp +++ b/runtime/command_stream/command_stream_receiver.cpp @@ -10,6 +10,7 @@ #include "core/command_stream/preemption.h" #include "core/execution_environment/root_device_environment.h" #include "core/helpers/cache_policy.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_helper.h" #include "core/helpers/string.h" #include "core/memory_manager/internal_allocation_storage.h" @@ -23,7 +24,6 @@ #include "runtime/event/event.h" #include "runtime/gtpin/gtpin_notify.h" #include "runtime/helpers/array_count.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/memory_manager/memory_manager.h" #include "runtime/memory_manager/surface.h" @@ -408,7 +408,7 @@ bool CommandStreamReceiver::createAllocationForHostSurface(HostPtrSurface &surfa if (allocation == nullptr) { return false; } - allocation->updateTaskCount(Event::eventNotReady, osContext->getContextId()); + allocation->updateTaskCount(CompletionStamp::levelNotReady, osContext->getContextId()); surface.setAllocation(allocation); internalAllocationStorage->storeAllocation(std::unique_ptr(allocation), TEMPORARY_ALLOCATION); return true; diff --git a/runtime/command_stream/command_stream_receiver.h b/runtime/command_stream/command_stream_receiver.h index 685f2dd87c..f3b47af50e 100644 --- a/runtime/command_stream/command_stream_receiver.h +++ b/runtime/command_stream/command_stream_receiver.h @@ -6,6 +6,7 @@ */ #pragma once +#include "core/command_stream/csr_definitions.h" #include "core/command_stream/linear_stream.h" #include "core/command_stream/thread_arbitration_policy.h" #include "core/helpers/aligned_memory.h" @@ -14,7 +15,6 @@ #include "core/indirect_heap/indirect_heap.h" #include "core/kernel/grf_config.h" #include "runtime/command_stream/aub_subcapture.h" -#include "runtime/command_stream/csr_definitions.h" #include "runtime/command_stream/submissions_aggregator.h" #include "runtime/helpers/blit_commands_helper.h" #include "runtime/helpers/flat_batch_buffer_helper.h" diff --git a/runtime/command_stream/command_stream_receiver_hw.h b/runtime/command_stream/command_stream_receiver_hw.h index 92a3e73351..4a604c9f8a 100644 --- a/runtime/command_stream/command_stream_receiver_hw.h +++ b/runtime/command_stream/command_stream_receiver_hw.h @@ -6,12 +6,12 @@ */ #pragma once +#include "core/helpers/dirty_state_helpers.h" #include "core/helpers/hw_cmds.h" #include "core/helpers/hw_info.h" #include "core/helpers/options.h" #include "runtime/command_stream/command_stream_receiver.h" #include "runtime/execution_environment/execution_environment.h" -#include "runtime/helpers/dirty_state_helpers.h" namespace NEO { template diff --git a/runtime/command_stream/command_stream_receiver_hw_base.inl b/runtime/command_stream/command_stream_receiver_hw_base.inl index e36b229754..2034d78f60 100644 --- a/runtime/command_stream/command_stream_receiver_hw_base.inl +++ b/runtime/command_stream/command_stream_receiver_hw_base.inl @@ -11,6 +11,7 @@ #include "core/execution_environment/root_device_environment.h" #include "core/gmm_helper/page_table_mngr.h" #include "core/helpers/cache_policy.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_helper.h" #include "core/helpers/options.h" #include "core/helpers/preamble.h" @@ -19,17 +20,13 @@ #include "core/indirect_heap/indirect_heap.h" #include "core/memory_manager/internal_allocation_storage.h" #include "core/os_interface/os_context.h" -#include "runtime/command_queue/gpgpu_walker.h" #include "runtime/command_stream/command_stream_receiver_hw.h" #include "runtime/command_stream/experimental_command_buffer.h" #include "runtime/command_stream/scratch_space_controller_base.h" #include "runtime/device/device.h" -#include "runtime/event/event.h" #include "runtime/gtpin/gtpin_notify.h" #include "runtime/helpers/blit_commands_helper.h" #include "runtime/helpers/flat_batch_buffer_helper_hw.h" -#include "runtime/helpers/flush_stamp.h" -#include "runtime/helpers/state_compute_mode_helper.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/memory_manager/memory_manager.h" #include "runtime/utilities/tag_allocator.h" @@ -146,7 +143,7 @@ CompletionStamp CommandStreamReceiverHw::flushTask( DEBUG_BREAK_IF(&commandStreamTask == &commandStream); DEBUG_BREAK_IF(!(dispatchFlags.preemptionMode == PreemptionMode::Disabled ? device.getPreemptionMode() == PreemptionMode::Disabled : true)); - DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady); + DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); DBG_LOG(LogTaskCounts, __FUNCTION__, "Line: ", __LINE__, "taskLevel", taskLevel); diff --git a/runtime/command_stream/definitions/command_stream_receiver_hw_ext.inl b/runtime/command_stream/definitions/command_stream_receiver_hw_ext.inl index f32cc75cd2..20ad421558 100644 --- a/runtime/command_stream/definitions/command_stream_receiver_hw_ext.inl +++ b/runtime/command_stream/definitions/command_stream_receiver_hw_ext.inl @@ -1,14 +1,14 @@ /* - * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once +#include "core/command_stream/csr_definitions.h" #include "core/command_stream/linear_stream.h" #include "runtime/command_stream/command_stream_receiver_hw.h" -#include "runtime/command_stream/csr_definitions.h" namespace NEO { diff --git a/runtime/command_stream/submissions_aggregator.cpp b/runtime/command_stream/submissions_aggregator.cpp index 992887f6cb..66c5ee74cd 100644 --- a/runtime/command_stream/submissions_aggregator.cpp +++ b/runtime/command_stream/submissions_aggregator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -7,8 +7,8 @@ #include "submissions_aggregator.h" +#include "core/helpers/flush_stamp.h" #include "core/memory_manager/graphics_allocation.h" -#include "runtime/helpers/flush_stamp.h" void NEO::SubmissionAggregator::recordCommandBuffer(CommandBuffer *commandBuffer) { this->cmdBuffers.pushTailOne(*commandBuffer); diff --git a/runtime/command_stream/submissions_aggregator.h b/runtime/command_stream/submissions_aggregator.h index 908bcc10b9..379a26e10e 100644 --- a/runtime/command_stream/submissions_aggregator.h +++ b/runtime/command_stream/submissions_aggregator.h @@ -6,11 +6,11 @@ */ #pragma once +#include "core/command_stream/csr_definitions.h" #include "core/command_stream/linear_stream.h" #include "core/memory_manager/residency_container.h" #include "core/utilities/idlist.h" #include "core/utilities/stackvec.h" -#include "runtime/command_stream/csr_definitions.h" #include "runtime/helpers/properties_helper.h" #include diff --git a/runtime/event/async_events_handler.cpp b/runtime/event/async_events_handler.cpp index e9c93b7e1d..aa96294cd7 100644 --- a/runtime/event/async_events_handler.cpp +++ b/runtime/event/async_events_handler.cpp @@ -36,7 +36,7 @@ void AsyncEventsHandler::registerEvent(Event *event) { } Event *AsyncEventsHandler::processList() { - uint32_t lowestTaskCount = Event::eventNotReady; + uint32_t lowestTaskCount = CompletionStamp::levelNotReady; Event *sleepCandidate = nullptr; pendingList.clear(); diff --git a/runtime/event/event.cpp b/runtime/event/event.cpp index 990bf3c6e9..4288e8094f 100644 --- a/runtime/event/event.cpp +++ b/runtime/event/event.cpp @@ -30,8 +30,6 @@ namespace NEO { -const cl_uint Event::eventNotReady = 0xFFFFFFF0; - Event::Event( Context *ctx, CommandQueue *cmdQueue, @@ -323,7 +321,7 @@ void Event::calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t con } inline bool Event::wait(bool blocking, bool useQuickKmdSleep) { - while (this->taskCount == Event::eventNotReady) { + while (this->taskCount == CompletionStamp::levelNotReady) { if (blocking == false) { return false; } @@ -332,7 +330,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) { cmdQueue->waitUntilComplete(taskCount.load(), flushStamp->peekStamp(), useQuickKmdSleep); updateExecutionStatus(); - DEBUG_BREAK_IF(this->taskLevel == Event::eventNotReady && this->executionStatus >= 0); + DEBUG_BREAK_IF(this->taskLevel == CompletionStamp::levelNotReady && this->executionStatus >= 0); auto *allocationStorage = cmdQueue->getGpgpuCommandStreamReceiver().getInternalAllocationStorage(); allocationStorage->cleanAllocationList(this->taskCount, TEMPORARY_ALLOCATION); @@ -341,7 +339,7 @@ inline bool Event::wait(bool blocking, bool useQuickKmdSleep) { } void Event::updateExecutionStatus() { - if (taskLevel == Event::eventNotReady) { + if (taskLevel == CompletionStamp::levelNotReady) { return; } @@ -397,11 +395,11 @@ void Event::unblockEventsBlockedByThis(int32_t transitionStatus) { (void)status; DEBUG_BREAK_IF(!(isStatusCompleted(status) || (peekIsSubmitted(status)))); - uint32_t taskLevelToPropagate = Event::eventNotReady; + uint32_t taskLevelToPropagate = CompletionStamp::levelNotReady; if (isStatusCompletedByTermination(transitionStatus) == false) { //if we are event on top of the tree , obtain taskLevel from CSR - if (taskLevel == Event::eventNotReady) { + if (taskLevel == CompletionStamp::levelNotReady) { this->taskLevel = getTaskLevel(); // NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) taskLevelToPropagate = this->taskLevel; } else { @@ -498,7 +496,7 @@ void Event::submitCommand(bool abortTasks) { } else if (profilingCpuPath && endTimeStamp == 0) { setEndTimeStamp(); } - if (this->taskCount == Event::eventNotReady) { + if (this->taskCount == CompletionStamp::levelNotReady) { if (!this->isUserEvent() && this->eventWithoutCommand) { if (this->cmdQueue) { auto lockCSR = this->getCommandQueue()->getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); @@ -522,7 +520,7 @@ cl_int Event::waitForEvents(cl_uint numEvents, for (const cl_event *it = eventList, *end = eventList + numEvents; it != end; ++it) { Event *event = castToObjectOrAbort(*it); if (event->cmdQueue) { - if (event->taskLevel != Event::eventNotReady) { + if (event->taskLevel != CompletionStamp::levelNotReady) { event->cmdQueue->flush(); } } @@ -572,7 +570,7 @@ inline void Event::unblockEventBy(Event &event, uint32_t taskLevel, int32_t tran } DBG_LOG(EventsDebugEnable, "Event", this, "is unblocked by", &event); - if (this->taskLevel == Event::eventNotReady) { + if (this->taskLevel == CompletionStamp::levelNotReady) { this->taskLevel = std::max(cmdQueue->getGpgpuCommandStreamReceiver().peekTaskLevel(), taskLevel); } else { this->taskLevel = std::max(this->taskLevel.load(), taskLevel); @@ -594,7 +592,7 @@ bool Event::updateStatusAndCheckCompletion() { } bool Event::isReadyForSubmission() { - return taskLevel != Event::eventNotReady ? true : false; + return taskLevel != CompletionStamp::levelNotReady ? true : false; } void Event::addCallback(Callback::ClbFuncT fn, cl_int type, void *data) { @@ -663,7 +661,7 @@ void Event::tryFlushEvent() { //only if event is not completed, completed event has already been flushed if (cmdQueue && updateStatusAndCheckCompletion() == false) { //flush the command queue only if it is not blocked event - if (taskLevel != Event::eventNotReady) { + if (taskLevel != CompletionStamp::levelNotReady) { cmdQueue->getGpgpuCommandStreamReceiver().flushBatchedSubmissions(); } } diff --git a/runtime/event/event.h b/runtime/event/event.h index edcc24249a..8c3f193da2 100644 --- a/runtime/event/event.h +++ b/runtime/event/event.h @@ -6,6 +6,7 @@ */ #pragma once +#include "core/helpers/flush_stamp.h" #include "core/os_interface/os_time.h" #include "core/utilities/arrayref.h" #include "core/utilities/idlist.h" @@ -13,7 +14,6 @@ #include "runtime/api/cl_types.h" #include "runtime/event/hw_timestamps.h" #include "runtime/helpers/base_object.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/task_information.h" #include "runtime/os_interface/performance_counters.h" @@ -78,7 +78,6 @@ class Event : public BaseObject<_cl_event>, public IDNode { }; static const cl_ulong objectMagic = 0x80134213A43C981ALL; - static const cl_uint eventNotReady; Event(CommandQueue *cmdQueue, cl_command_type cmdType, uint32_t taskLevel, uint32_t taskCount); @@ -244,13 +243,13 @@ class Event : public BaseObject<_cl_event>, public IDNode { virtual void unblockEventBy(Event &event, uint32_t taskLevel, int32_t transitionStatus); void updateTaskCount(uint32_t taskCount) { - if (taskCount == Event::eventNotReady) { + if (taskCount == CompletionStamp::levelNotReady) { DEBUG_BREAK_IF(true); return; } uint32_t prevTaskCount = this->taskCount.exchange(taskCount); - if ((prevTaskCount != Event::eventNotReady) && (prevTaskCount > taskCount)) { + if ((prevTaskCount != CompletionStamp::levelNotReady) && (prevTaskCount > taskCount)) { this->taskCount = prevTaskCount; DEBUG_BREAK_IF(true); } @@ -322,7 +321,7 @@ class Event : public BaseObject<_cl_event>, public IDNode { bool calcProfilingData(); MOCKABLE_VIRTUAL void calculateProfilingDataInternal(uint64_t contextStartTS, uint64_t contextEndTS, uint64_t *contextCompleteTS, uint64_t globalStartTS); MOCKABLE_VIRTUAL void synchronizeTaskCount() { - while (this->taskCount == Event::eventNotReady) + while (this->taskCount == CompletionStamp::levelNotReady) ; }; diff --git a/runtime/event/event_builder.cpp b/runtime/event/event_builder.cpp index 2a0fd3591c..a4f89b3534 100644 --- a/runtime/event/event_builder.cpp +++ b/runtime/event/event_builder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -54,7 +54,7 @@ void EventBuilder::finalize() { //do not add as child if: //parent has no parents and is not blocked - if (!(parent->peekIsBlocked() == false && parent->taskLevel != Event::eventNotReady) || + if (!(parent->peekIsBlocked() == false && parent->taskLevel != CompletionStamp::levelNotReady) || (!parent->isEventWithoutCommand() && !parent->peekIsCmdSubmitted())) { parent->addChild(*this->event); } diff --git a/runtime/event/event_tracker.cpp b/runtime/event/event_tracker.cpp index d655d8dc98..927f8fd2a5 100644 --- a/runtime/event/event_tracker.cpp +++ b/runtime/event/event_tracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -46,14 +46,14 @@ void EventsTracker::dumpQueue(CommandQueue *cmdQ, std::ostream &out, CmdqSet &du out << label(cmdQ) << "[label=\"{------CmdQueue, ptr=" << cmdQ << "------|task count="; auto taskCount = cmdQ->taskCount; auto taskLevel = cmdQ->taskLevel; - if (taskCount == Event::eventNotReady) { + if (taskCount == CompletionStamp::levelNotReady) { out << "NOT_READY"; } else { out << taskCount; } out << ", level="; - if (taskLevel == Event::eventNotReady) { + if (taskLevel == CompletionStamp::levelNotReady) { out << "NOT_READY"; } else { out << taskLevel; @@ -96,14 +96,14 @@ void EventsTracker::dumpNode(Event *node, std::ostream &out, const EventIdMap &e "|" << commandType << "|" << status[statusId] << "|" "task count="; - if (taskCount == Event::eventNotReady) { + if (taskCount == CompletionStamp::levelNotReady) { out << "NOT_READY"; } else { out << taskCount; } out << ", level="; - if (taskLevel == Event::eventNotReady) { + if (taskLevel == CompletionStamp::levelNotReady) { out << "NOT_READY"; } else { out << taskLevel; diff --git a/runtime/event/user_event.cpp b/runtime/event/user_event.cpp index 66a0a8c6aa..25e0512a65 100644 --- a/runtime/event/user_event.cpp +++ b/runtime/event/user_event.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,7 @@ namespace NEO { UserEvent::UserEvent(Context *ctx) - : Event(ctx, nullptr, CL_COMMAND_USER, eventNotReady, eventNotReady) { + : Event(ctx, nullptr, CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady) { transitionExecutionStatus(CL_QUEUED); } @@ -36,7 +36,7 @@ uint32_t UserEvent::getTaskLevel() { if (peekExecutionStatus() == CL_COMPLETE) { return 0; } - return Event::eventNotReady; + return CompletionStamp::levelNotReady; } bool UserEvent::isInitialEventStatus() const { @@ -44,7 +44,7 @@ bool UserEvent::isInitialEventStatus() const { } VirtualEvent::VirtualEvent(CommandQueue *cmdQ, Context *ctx) - : Event(ctx, cmdQ, -1, eventNotReady, eventNotReady) { + : Event(ctx, cmdQ, -1, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady) { transitionExecutionStatus(CL_QUEUED); // internal object - no need for API refcount diff --git a/runtime/helpers/CMakeLists.txt b/runtime/helpers/CMakeLists.txt index a97127ecbf..dd00611ea7 100644 --- a/runtime/helpers/CMakeLists.txt +++ b/runtime/helpers/CMakeLists.txt @@ -17,8 +17,6 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/cl_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/convert_color.h ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/device_helpers.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.h ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_info.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_info.h ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_info_builder.h @@ -29,8 +27,6 @@ set(RUNTIME_SRCS_HELPERS_BASE ${CMAKE_CURRENT_SOURCE_DIR}/flat_batch_buffer_helper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/flat_batch_buffer_helper_hw.h ${CMAKE_CURRENT_SOURCE_DIR}/flat_batch_buffer_helper_hw.inl - ${CMAKE_CURRENT_SOURCE_DIR}/flush_stamp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/flush_stamp.h ${CMAKE_CURRENT_SOURCE_DIR}/get_info.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware_commands_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware_commands_helper.inl diff --git a/runtime/helpers/hardware_commands_helper.inl b/runtime/helpers/hardware_commands_helper.inl index ae4871eb9b..1f12841cb0 100644 --- a/runtime/helpers/hardware_commands_helper.inl +++ b/runtime/helpers/hardware_commands_helper.inl @@ -5,6 +5,7 @@ * */ +#include "core/command_stream/csr_definitions.h" #include "core/command_stream/preemption.h" #include "core/debug_settings/debug_settings_manager.h" #include "core/helpers/address_patch.h" @@ -14,7 +15,6 @@ #include "core/helpers/string.h" #include "core/indirect_heap/indirect_heap.h" #include "runtime/command_queue/local_id_gen.h" -#include "runtime/command_stream/csr_definitions.h" #include "runtime/helpers/dispatch_info.h" #include "runtime/kernel/kernel.h" #include "runtime/program/block_kernel_manager.h" diff --git a/runtime/helpers/state_compute_mode_helper.h b/runtime/helpers/state_compute_mode_helper.h index 0d6830c4ee..f56b14e572 100644 --- a/runtime/helpers/state_compute_mode_helper.h +++ b/runtime/helpers/state_compute_mode_helper.h @@ -1,13 +1,13 @@ /* - * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once +#include "core/command_stream/csr_definitions.h" #include "core/helpers/hw_cmds.h" -#include "runtime/command_stream/csr_definitions.h" namespace NEO { template diff --git a/runtime/helpers/task_information.cpp b/runtime/helpers/task_information.cpp index 8dfd63d5eb..4c3189fd23 100644 --- a/runtime/helpers/task_information.cpp +++ b/runtime/helpers/task_information.cpp @@ -72,7 +72,7 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) { false //epilogueRequired ); - DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady); + DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); gtpinNotifyPreFlushTask(&commandQueue); @@ -243,7 +243,7 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate dispatchFlags.epilogueRequired = true; } - DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady); + DEBUG_BREAK_IF(taskLevel >= CompletionStamp::levelNotReady); gtpinNotifyPreFlushTask(&commandQueue); diff --git a/runtime/os_interface/linux/drm_command_stream.inl b/runtime/os_interface/linux/drm_command_stream.inl index 3cec726788..4669fb1537 100644 --- a/runtime/os_interface/linux/drm_command_stream.inl +++ b/runtime/os_interface/linux/drm_command_stream.inl @@ -9,13 +9,13 @@ #include "core/gmm_helper/gmm_helper.h" #include "core/gmm_helper/page_table_mngr.h" #include "core/helpers/aligned_memory.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/preamble.h" #include "core/memory_manager/residency.h" #include "core/os_interface/linux/drm_engine_mapper.h" #include "core/os_interface/linux/drm_neo.h" #include "core/os_interface/linux/os_interface.h" #include "runtime/execution_environment/execution_environment.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/mem_obj/buffer.h" #include "runtime/os_interface/linux/drm_allocation.h" #include "runtime/os_interface/linux/drm_buffer_object.h" diff --git a/runtime/os_interface/windows/wddm_device_command_stream.inl b/runtime/os_interface/windows/wddm_device_command_stream.inl index be46494db3..78344b59b8 100644 --- a/runtime/os_interface/windows/wddm_device_command_stream.inl +++ b/runtime/os_interface/windows/wddm_device_command_stream.inl @@ -12,11 +12,11 @@ #include "core/command_stream/linear_stream.h" #include "core/command_stream/preemption.h" #include "core/gmm_helper/page_table_mngr.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_cmds.h" #include "core/helpers/ptr_math.h" #include "core/helpers/windows/gmm_callbacks.h" #include "runtime/device/device.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/mem_obj/mem_obj.h" #include "runtime/os_interface/windows/wddm/wddm.h" #include "runtime/os_interface/windows/wddm_device_command_stream.h" diff --git a/runtime/sharings/gl/windows/gl_arb_sync_event_windows.cpp b/runtime/sharings/gl/windows/gl_arb_sync_event_windows.cpp index 975af23a07..02b0f1b75c 100644 --- a/runtime/sharings/gl/windows/gl_arb_sync_event_windows.cpp +++ b/runtime/sharings/gl/windows/gl_arb_sync_event_windows.cpp @@ -18,7 +18,7 @@ namespace NEO { GlArbSyncEvent::GlArbSyncEvent(Context &context) - : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, eventNotReady, eventNotReady), + : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady), glSyncInfo(std::make_unique()) { } diff --git a/runtime/sharings/gl/windows/gl_sync_event_windows.cpp b/runtime/sharings/gl/windows/gl_sync_event_windows.cpp index 83ba06aeea..a302d8ba67 100644 --- a/runtime/sharings/gl/windows/gl_sync_event_windows.cpp +++ b/runtime/sharings/gl/windows/gl_sync_event_windows.cpp @@ -20,7 +20,7 @@ namespace NEO { GlSyncEvent::GlSyncEvent(Context &context, const GL_CL_SYNC_INFO &sync) - : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, eventNotReady, eventNotReady), + : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady), glSync(std::make_unique(sync)) { transitionExecutionStatus(CL_SUBMITTED); } @@ -57,6 +57,6 @@ uint32_t GlSyncEvent::getTaskLevel() { if (peekExecutionStatus() == CL_COMPLETE) { return 0; } - return Event::eventNotReady; + return CompletionStamp::levelNotReady; } } // namespace NEO diff --git a/unit_tests/command_queue/command_queue_hw_tests.cpp b/unit_tests/command_queue/command_queue_hw_tests.cpp index 6e9a3c5710..c5bc549e76 100644 --- a/unit_tests/command_queue/command_queue_hw_tests.cpp +++ b/unit_tests/command_queue/command_queue_hw_tests.cpp @@ -680,12 +680,12 @@ HWTEST_F(CommandQueueHwTest, GivenEventThatIsNotCompletedWhenFinishIsCalledAndIt }; auto Value = 0u; - auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, Event::eventNotReady + 1); + auto ev = new Event(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, CompletionStamp::levelNotReady + 1); clSetEventCallback(ev, CL_COMPLETE, ClbFuncTempStruct::ClbFuncT, &Value); auto &csr = this->pCmdQ->getGpgpuCommandStreamReceiver(); EXPECT_GT(3u, csr.peekTaskCount()); - *csr.getTagAddress() = Event::eventNotReady + 1; + *csr.getTagAddress() = CompletionStamp::levelNotReady + 1; ret = clFinish(this->pCmdQ); ASSERT_EQ(CL_SUCCESS, ret); @@ -916,14 +916,14 @@ HWTEST_F(CommandQueueHwTest, givenCommandQueueThatIsBlockedAndUsesCpuCopyWhenEve MockBuffer buffer; cl_event returnEvent = nullptr; auto retVal = CL_SUCCESS; - cmdQHw->taskLevel = Event::eventNotReady; + cmdQHw->taskLevel = CompletionStamp::levelNotReady; size_t offset = 0; size_t size = 4096u; TransferProperties transferProperties(&buffer, CL_COMMAND_READ_BUFFER, 0, false, &offset, &size, nullptr, false); EventsRequest eventsRequest(0, nullptr, &returnEvent); cmdQHw->cpuDataTransferHandler(transferProperties, eventsRequest, retVal); EXPECT_EQ(CL_SUCCESS, retVal); - EXPECT_EQ(Event::eventNotReady, castToObject(returnEvent)->peekTaskCount()); + EXPECT_EQ(CompletionStamp::levelNotReady, castToObject(returnEvent)->peekTaskCount()); clReleaseEvent(returnEvent); } @@ -942,12 +942,12 @@ HWTEST_F(CommandQueueHwTest, givenEventWithRecordedCommandWhenSubmitCommandIsCal std::atomic_bool *atomicFence = nullptr; }; - mockEvent neoEvent(this->pCmdQ, CL_COMMAND_MAP_BUFFER, Event::eventNotReady, Event::eventNotReady); + mockEvent neoEvent(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); neoEvent.atomicFence = &go; EXPECT_TRUE(neoEvent.eventWithoutCommand); neoEvent.eventWithoutCommand = false; - EXPECT_EQ(Event::eventNotReady, neoEvent.peekTaskCount()); + EXPECT_EQ(CompletionStamp::levelNotReady, neoEvent.peekTaskCount()); std::thread t([&]() { while (!go) @@ -1112,7 +1112,7 @@ HWTEST_F(CommandQueueHwTest, givenBlockedOutOfOrderQueueWhenUserEventIsSubmitted neoEvent->updateExecutionStatus(); EXPECT_EQ(neoEvent->peekExecutionStatus(), CL_QUEUED); - EXPECT_EQ(neoEvent->peekTaskCount(), Event::eventNotReady); + EXPECT_EQ(neoEvent->peekTaskCount(), CompletionStamp::levelNotReady); clSetUserEventStatus(userEvent, 0u); diff --git a/unit_tests/command_queue/command_queue_tests.cpp b/unit_tests/command_queue/command_queue_tests.cpp index 10177c9619..8db635e62c 100644 --- a/unit_tests/command_queue/command_queue_tests.cpp +++ b/unit_tests/command_queue/command_queue_tests.cpp @@ -175,7 +175,7 @@ TEST(CommandQueue, givenTimeStampWithTaskCountNotReadyStatusWhenupdateFromComple cmdQ.taskCount = 1u; CompletionStamp cs = { - Event::eventNotReady, + CompletionStamp::levelNotReady, 0, 0}; cmdQ.updateFromCompletionStamp(cs); diff --git a/unit_tests/command_queue/enqueue_barrier_tests.cpp b/unit_tests/command_queue/enqueue_barrier_tests.cpp index 74c21d1622..9ef1e79c32 100644 --- a/unit_tests/command_queue/enqueue_barrier_tests.cpp +++ b/unit_tests/command_queue/enqueue_barrier_tests.cpp @@ -240,7 +240,7 @@ HWTEST_F(BarrierTest, givenBlockedCommandQueueAndEnqueueBarrierWithWaitlistRetur EXPECT_EQ(CL_SUCCESS, retVal); auto pEvent = (Event *)event; - EXPECT_EQ(pEvent->peekTaskCount(), Event::eventNotReady); + EXPECT_EQ(pEvent->peekTaskCount(), CompletionStamp::levelNotReady); event2.setStatus(CL_COMPLETE); clReleaseEvent(event); } diff --git a/unit_tests/command_queue/enqueue_handler_tests.cpp b/unit_tests/command_queue/enqueue_handler_tests.cpp index a0f1be1586..01bacc4380 100644 --- a/unit_tests/command_queue/enqueue_handler_tests.cpp +++ b/unit_tests/command_queue/enqueue_handler_tests.cpp @@ -275,14 +275,14 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingHandlerForMarkerOnBlockedQueueThenTask auto mockCmdQ = std::unique_ptr>(new MockCommandQueueHw(context, pClDevice, 0)); // put queue into initial blocked state - mockCmdQ->taskLevel = Event::eventNotReady; + mockCmdQ->taskLevel = CompletionStamp::levelNotReady; mockCmdQ->enqueueMarkerWithWaitList( 0, nullptr, nullptr); - EXPECT_EQ(Event::eventNotReady, mockCmdQ->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); } HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEventIsCreatedAndCommandQueueInternalRefCountIsIncremeted) { @@ -296,7 +296,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedWithoutReturnEventThenVirtualEv auto mockCmdQ = new MockCommandQueueHw(context, pClDevice, 0); // put queue into initial blocked state - mockCmdQ->taskLevel = Event::eventNotReady; + mockCmdQ->taskLevel = CompletionStamp::levelNotReady; auto initialRefCountInternal = mockCmdQ->getRefInternalCount(); @@ -330,7 +330,7 @@ HWTEST_F(EnqueueHandlerTest, WhenEnqueuingBlockedThenVirtualEventIsSetAsCurrentC auto mockCmdQ = new MockCommandQueueHw(context, pClDevice, 0); // put queue into initial blocked state - mockCmdQ->taskLevel = Event::eventNotReady; + mockCmdQ->taskLevel = CompletionStamp::levelNotReady; bool blocking = false; mockCmdQ->template enqueueHandler(nullptr, diff --git a/unit_tests/command_queue/enqueue_read_buffer_event_tests.cpp b/unit_tests/command_queue/enqueue_read_buffer_event_tests.cpp index df32c29533..36ca365a86 100644 --- a/unit_tests/command_queue/enqueue_read_buffer_event_tests.cpp +++ b/unit_tests/command_queue/enqueue_read_buffer_event_tests.cpp @@ -223,7 +223,7 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN uint32_t taskLevelCmdQ = 17; pCmdQ->taskLevel = taskLevelCmdQ; - Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 4); + Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 4); cl_bool blockingRead = CL_FALSE; size_t size = sizeof(cl_float); @@ -247,8 +247,8 @@ TEST_F(EnqueueReadBuffer, givenInOrderQueueAndForcedCpuCopyOnReadBufferAndEventN ASSERT_NE(nullptr, event); auto pEvent = (Event *)event; - EXPECT_EQ(Event::eventNotReady, pEvent->taskLevel); - EXPECT_EQ(Event::eventNotReady, pCmdQ->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel); event1.taskLevel = 20; event1.setStatus(CL_COMPLETE); pEvent->updateExecutionStatus(); diff --git a/unit_tests/command_queue/enqueue_write_buffer_event_tests.cpp b/unit_tests/command_queue/enqueue_write_buffer_event_tests.cpp index 0b0ba84e32..b90afecb1a 100644 --- a/unit_tests/command_queue/enqueue_write_buffer_event_tests.cpp +++ b/unit_tests/command_queue/enqueue_write_buffer_event_tests.cpp @@ -148,7 +148,7 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe uint32_t taskLevelCmdQ = 17; pCmdQ->taskLevel = taskLevelCmdQ; - Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 4); + Event event1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 4); cl_bool blockingWrite = CL_FALSE; size_t size = sizeof(cl_float); @@ -172,8 +172,8 @@ TEST_F(EnqueueWriteBufferTypeTest, givenInOrderQueueAndForcedCpuCopyOnWriteBuffe ASSERT_NE(nullptr, event); auto pEvent = (Event *)event; - EXPECT_EQ(Event::eventNotReady, pEvent->taskLevel); - EXPECT_EQ(Event::eventNotReady, pCmdQ->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, pEvent->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, pCmdQ->taskLevel); event1.taskLevel = 20; event1.setStatus(CL_COMPLETE); pEvent->updateExecutionStatus(); diff --git a/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 8187563e60..44ec4fe89f 100644 --- a/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -5,13 +5,13 @@ * */ +#include "core/command_stream/csr_definitions.h" #include "core/gmm_helper/gmm_helper.h" #include "core/helpers/hw_helper.h" #include "core/helpers/state_base_address.h" #include "core/memory_manager/internal_allocation_storage.h" #include "core/os_interface/os_context.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" -#include "runtime/command_stream/csr_definitions.h" #include "runtime/command_stream/scratch_space_controller.h" #include "runtime/helpers/hardware_commands_helper.h" #include "test.h" diff --git a/unit_tests/command_stream/command_stream_receiver_with_aub_dump_tests.cpp b/unit_tests/command_stream/command_stream_receiver_with_aub_dump_tests.cpp index 6cfd24dcd7..38a2f0b6fa 100644 --- a/unit_tests/command_stream/command_stream_receiver_with_aub_dump_tests.cpp +++ b/unit_tests/command_stream/command_stream_receiver_with_aub_dump_tests.cpp @@ -6,6 +6,7 @@ */ #include "core/command_stream/preemption.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_helper.h" #include "core/os_interface/os_context.h" #include "runtime/command_stream/aub_command_stream_receiver_hw.h" @@ -14,7 +15,6 @@ #include "runtime/command_stream/tbx_command_stream_receiver_hw.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/helpers/dispatch_info.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/timestamp_packet.h" #include "runtime/platform/platform.h" #include "runtime/utilities/tag_allocator.h" diff --git a/unit_tests/command_stream/submissions_aggregator_tests.cpp b/unit_tests/command_stream/submissions_aggregator_tests.cpp index 20c4fee1a2..0519b3cb19 100644 --- a/unit_tests/command_stream/submissions_aggregator_tests.cpp +++ b/unit_tests/command_stream/submissions_aggregator_tests.cpp @@ -5,9 +5,9 @@ * */ +#include "core/helpers/flush_stamp.h" #include "runtime/command_stream/submissions_aggregator.h" #include "runtime/event/event.h" -#include "runtime/helpers/flush_stamp.h" #include "test.h" #include "unit_tests/mocks/mock_command_queue.h" #include "unit_tests/mocks/mock_context.h" diff --git a/unit_tests/event/async_events_handler_tests.cpp b/unit_tests/event/async_events_handler_tests.cpp index d6e14293ff..52f59bc2f1 100644 --- a/unit_tests/event/async_events_handler_tests.cpp +++ b/unit_tests/event/async_events_handler_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -46,9 +46,9 @@ class AsyncEventsHandlerTests : public ::testing::Test { DebugManager.flags.EnableAsyncEventsHandler.set(false); handler.reset(new MockHandler()); - event1 = new NiceMock(nullptr, CL_COMMAND_BARRIER, Event::eventNotReady, Event::eventNotReady); - event2 = new NiceMock(nullptr, CL_COMMAND_BARRIER, Event::eventNotReady, Event::eventNotReady); - event3 = new NiceMock(nullptr, CL_COMMAND_BARRIER, Event::eventNotReady, Event::eventNotReady); + event1 = new NiceMock(nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); + event2 = new NiceMock(nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); + event3 = new NiceMock(nullptr, CL_COMMAND_BARRIER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); } void TearDown() override { @@ -85,7 +85,7 @@ TEST_F(AsyncEventsHandlerTests, givenEventsWhenListIsProcessedThenUpdateExecutio } TEST_F(AsyncEventsHandlerTests, updateEventsRefInternalCount) { - event1->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); handler->registerEvent(event1); EXPECT_EQ(2, event1->getRefInternalCount()); @@ -96,7 +96,7 @@ TEST_F(AsyncEventsHandlerTests, updateEventsRefInternalCount) { TEST_F(AsyncEventsHandlerTests, givenNotCalledCallbacksWhenListIsProcessedThenDontUnregister) { int submittedCounter(0), completeCounter(0); - event1->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &submittedCounter); event1->addCallback(&this->callbackFcn, CL_COMPLETE, &completeCounter); handler->registerEvent(event1); @@ -156,7 +156,7 @@ TEST_F(AsyncEventsHandlerTests, givenExternallSynchronizedEventWhenListIsProcess } TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAndNoCallbacksToProcessThenUnregister) { - event1->setTaskStamp(Event::eventNotReady - 1, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady - 1, 0); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); handler->registerEvent(event1); handler->registerEvent(event1); @@ -169,8 +169,8 @@ TEST_F(AsyncEventsHandlerTests, givenDoubleRegisteredEventWhenListIsProcessedAnd TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingThenUnreferenceAll) { auto myHandler = new MockHandler(); - event1->setTaskStamp(Event::eventNotReady, 0); - event2->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); + event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); @@ -193,8 +193,8 @@ TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenDestructingTh } TEST_F(AsyncEventsHandlerTests, givenEventsNotHandledByHandlderWhenAsyncExecutionInterruptedThenUnreferenceAll) { - event1->setTaskStamp(Event::eventNotReady, 0); - event2->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); + event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); @@ -224,7 +224,7 @@ TEST_F(AsyncEventsHandlerTests, dontCreateThreadByDefault) { } TEST_F(AsyncEventsHandlerTests, createThreadOnFirstRegister) { - event1->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); EXPECT_FALSE(handler->openThreadCalled); handler->registerEvent(event1); @@ -234,8 +234,8 @@ TEST_F(AsyncEventsHandlerTests, createThreadOnFirstRegister) { TEST_F(AsyncEventsHandlerTests, processAsynchronously) { DebugManager.flags.EnableAsyncEventsHandler.set(true); - event1->setTaskStamp(Event::eventNotReady, 0); - event2->setTaskStamp(Event::eventNotReady, 0); + event1->setTaskStamp(CompletionStamp::levelNotReady, 0); + event2->setTaskStamp(CompletionStamp::levelNotReady, 0); event1->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); event2->addCallback(&this->callbackFcn, CL_SUBMITTED, &counter); diff --git a/unit_tests/event/event_tests.cpp b/unit_tests/event/event_tests.cpp index 436fa374c6..3d1adf2786 100644 --- a/unit_tests/event/event_tests.cpp +++ b/unit_tests/event/event_tests.cpp @@ -47,7 +47,7 @@ TEST(Event, dontUpdateExecutionStatusOnNotReadyEvent) { auto mockDevice = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); MockContext ctx; MockCommandQueue cmdQ(&ctx, mockDevice.get(), 0); - Event event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 0); + Event event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0); EXPECT_FALSE(event.peekIsBlocked()); EXPECT_EQ(CL_QUEUED, event.peekExecutionStatus()); @@ -68,7 +68,7 @@ TEST(Event, givenEventThatStatusChangeWhenPeekIsCalledThenEventIsNotUpdated) { uint32_t callCount = 0u; }; - mockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 0); + mockEvent event(&cmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0); EXPECT_EQ(0u, event.callCount); event.peekExecutionStatus(); EXPECT_EQ(0u, event.callCount); @@ -207,7 +207,7 @@ TEST(Event, waitForEventsWithNotReadyEventDoesNotFlushQueue) { MockContext context; std::unique_ptr cmdQ1(new MockCommandQueueWithFlushCheck(context, device.get())); - std::unique_ptr event1(new Event(cmdQ1.get(), CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 0)); + std::unique_ptr event1(new Event(cmdQ1.get(), CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0)); cl_event eventWaitlist[] = {event1.get()}; Event::waitForEvents(1, eventWaitlist); @@ -216,7 +216,7 @@ TEST(Event, waitForEventsWithNotReadyEventDoesNotFlushQueue) { } TEST(Event, givenNotReadyEventOnWaitlistWhenCheckingUserEventDependeciesThenTrueIsReturned) { - auto event1 = std::make_unique(nullptr, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 0); + auto event1 = std::make_unique(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0); cl_event eventWaitlist[] = {event1.get()}; bool userEventDependencies = Event::checkUserEventDependencies(1, eventWaitlist); @@ -290,7 +290,7 @@ TEST_F(EventTest, GetEventInfo_CL_EVENT_COMMAND_EXECUTION_STATUS_returns_CL_SUBM } TEST_F(EventTest, GetEventInfo_CL_EVENT_COMMAND_EXECUTION_STATUS_returnsSetStatus) { - Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); cl_int eventStatus = -1; event.setStatus(-1); @@ -383,7 +383,7 @@ TEST_F(EventTest, GetEventInfo_InvalidParam) { } TEST_F(EventTest, Event_Wait_NonBlocking) { - Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, Event::eventNotReady); + Event event(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, 3, CompletionStamp::levelNotReady); auto result = event.wait(false, false); EXPECT_FALSE(result); } @@ -927,7 +927,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenCommandSubmittedThenLockCSROccurs) { std::unique_ptr command = std::make_unique(*pCmdQ, kernelOperation, surfaces, kernel); - auto virtualEvent = make_releaseable(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + auto virtualEvent = make_releaseable(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); virtualEvent->setCommand(std::move(command)); @@ -945,7 +945,7 @@ HWTEST_F(EventTest, givenVirtualEventWhenSubmitCommandEventNotReadyAndEventWitho taskLevel, taskCount) {} }; - auto virtualEvent = make_releaseable(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + auto virtualEvent = make_releaseable(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); virtualEvent->submitCommand(false); @@ -1202,23 +1202,23 @@ TEST_F(EventTest, GivenCompletedEventWhenQueryingExecutionStatusAfterFlushThenCs } HWTEST_F(EventTest, submitCommandOnEventCreatedOnMapBufferWithoutCommandUpdatesTaskCount) { - MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_BUFFER, Event::eventNotReady, Event::eventNotReady); + MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_BUFFER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); - EXPECT_EQ(Event::eventNotReady, ev.peekTaskCount()); + EXPECT_EQ(CompletionStamp::levelNotReady, ev.peekTaskCount()); ev.submitCommand(false); EXPECT_EQ(0u, ev.peekTaskCount()); } HWTEST_F(EventTest, submitCommandOnEventCreatedOnMapImageWithoutCommandUpdatesTaskCount) { - MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, Event::eventNotReady, Event::eventNotReady); + MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); - EXPECT_EQ(Event::eventNotReady, ev.peekTaskCount()); + EXPECT_EQ(CompletionStamp::levelNotReady, ev.peekTaskCount()); ev.submitCommand(false); EXPECT_EQ(0u, ev.peekTaskCount()); } TEST_F(EventTest, givenCmdQueueWithoutProfilingWhenIsCpuProfilingIsCalledThenFalseIsReturned) { - MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, Event::eventNotReady, Event::eventNotReady); + MockEvent ev(this->pCmdQ, CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); bool cpuProfiling = ev.isCPUProfilingPath() != 0; EXPECT_FALSE(cpuProfiling); } @@ -1247,7 +1247,7 @@ TEST_F(EventTest, givenCmdQueueWithProfilingWhenIsCpuProfilingIsCalledThenTrueIs const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, CL_QUEUE_PROFILING_ENABLE, 0}; std::unique_ptr pCmdQ(new CommandQueue(&mockContext, pClDevice, props)); - MockEvent ev(pCmdQ.get(), CL_COMMAND_MAP_IMAGE, Event::eventNotReady, Event::eventNotReady); + MockEvent ev(pCmdQ.get(), CL_COMMAND_MAP_IMAGE, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); bool cpuProfiling = ev.isCPUProfilingPath() != 0; EXPECT_TRUE(cpuProfiling); } @@ -1351,8 +1351,8 @@ HWTEST_F(EventTest, givenEventWithNotReadyTaskLevelWhenUnblockedThenGetTaskLevel Event parentEventWithGreaterTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel + 5, 0); Event parentEventWithLowerTaskLevel(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, initialTaskLevel - 5, 0); - Event childEvent0(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); - Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + Event childEvent0(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); + Event childEvent1(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); auto &csr = reinterpret_cast &>(pCmdQ->getGpgpuCommandStreamReceiver()); csr.taskLevel = initialTaskLevel; diff --git a/unit_tests/event/event_tracker_tests.cpp b/unit_tests/event/event_tracker_tests.cpp index 592ff71390..92c6b3236a 100644 --- a/unit_tests/event/event_tracker_tests.cpp +++ b/unit_tests/event/event_tracker_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2019 Intel Corporation + * Copyright (C) 2018-2020 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -109,8 +109,8 @@ TEST(EventsTracker, givenAlreadyDumpedCmdqThenNotDumping) { TEST(EventsTracker, givenCmqdWithTaskCountAndLevelNotReadyThenDumpingCmdqWithNotReadyLabels) { CommandQueue cmdq; - cmdq.taskCount = Event::eventNotReady; - cmdq.taskLevel = Event::eventNotReady; + cmdq.taskCount = CompletionStamp::levelNotReady; + cmdq.taskLevel = CompletionStamp::levelNotReady; std::stringstream stream; std::set dumped; @@ -155,8 +155,8 @@ TEST(EventsTracker, whenCallDumpEdgeThenGetStringWithProperLabelOfDumpedEdge) { TEST(EventsTracker, givenEventWithTaskLevelAndCountNotReadyThenDumpingNodeWithNotReadyLabels) { UserEvent uEvent; - uEvent.taskLevel = Event::eventNotReady; - uEvent.updateTaskCount(Event::eventNotReady); + uEvent.taskLevel = CompletionStamp::levelNotReady; + uEvent.updateTaskCount(CompletionStamp::levelNotReady); std::stringstream stream; std::unordered_map map; @@ -201,7 +201,7 @@ TEST(EventsTracker, givenNullptrEventThenNotDumpingNode) { TEST(EventsTracker, givenEventAndUserEventThenDumpingNodeWithProperLabels) { UserEvent uEvent; - Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); std::stringstream stream; std::unordered_map map; @@ -264,7 +264,7 @@ TEST(EventsTracker, givenEventWithCallbackThenDumpingWithProperLabel) { } TEST(EventsTracker, givenSubmittedEventThenDumpingWithProperLabel) { - Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + Event event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); std::stringstream stream; std::unordered_map map; @@ -482,7 +482,7 @@ TEST(EventsTracker, givenTwoEventsWithSamePtrWhenFirstOneIsDeletedThenDumpingFir } TEST(EventsTracker, whenNotifyCreationOfEventThenEventIsDumped) { - Event event(nullptr, CL_COMMAND_USER, Event::eventNotReady, Event::eventNotReady); + Event event(nullptr, CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); EventsTrackerMock evTrackerMock; std::stringstream expected; @@ -624,7 +624,7 @@ TEST(EventsTracker, whenEventsDebugEnableFlagIsTrueAndCreateOrChangeStatusOrDest EventsTrackerMock evTrackerMock; evTrackerMock.overrideGlobal(); - Event *ev = new Event(nullptr, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, Event::eventNotReady); + Event *ev = new Event(nullptr, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); std::stringstream expected; expected << "digraph events_registry_" << &EventsTracker::getEventsTracker() << " {\nnode [shape=record]\n//pragma: somePragmaData\n\n}\n"; diff --git a/unit_tests/event/user_events_tests.cpp b/unit_tests/event/user_events_tests.cpp index e1963a5566..a89bd3285d 100644 --- a/unit_tests/event/user_events_tests.cpp +++ b/unit_tests/event/user_events_tests.cpp @@ -151,13 +151,13 @@ TEST(UserEvent, givenUserEventWhenStatusIsCompletedThenReturnZeroTaskLevel) { UserEvent uEvent; uEvent.setStatus(CL_QUEUED); - EXPECT_EQ(Event::eventNotReady, uEvent.getTaskLevel()); + EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); uEvent.setStatus(CL_SUBMITTED); - EXPECT_EQ(Event::eventNotReady, uEvent.getTaskLevel()); + EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); uEvent.setStatus(CL_RUNNING); - EXPECT_EQ(Event::eventNotReady, uEvent.getTaskLevel()); + EXPECT_EQ(CompletionStamp::levelNotReady, uEvent.getTaskLevel()); uEvent.setStatus(CL_COMPLETE); EXPECT_EQ(0u, uEvent.getTaskLevel()); @@ -180,10 +180,10 @@ TEST_F(MockEventTests, blockedUserEventPassedToEnqueueNdRangeWithoutReturnEventI auto taskCountAfter = csr.peekTaskCount(); //queue should be in blocked state at this moment, task level should be inherited from user event - EXPECT_EQ(NEO::Event::eventNotReady, pCmdQ->taskLevel); + EXPECT_EQ(NEO::CompletionStamp::levelNotReady, pCmdQ->taskLevel); //queue should be in blocked state at this moment, task count should be inherited from user event - EXPECT_EQ(NEO::Event::eventNotReady, pCmdQ->taskCount); + EXPECT_EQ(NEO::CompletionStamp::levelNotReady, pCmdQ->taskCount); //queue should be in blocked state EXPECT_EQ(pCmdQ->isQueueBlocked(), true); @@ -213,10 +213,10 @@ TEST_F(MockEventTests, blockedUserEventPassedToEnqueueNdRangeWithReturnEventIsNo auto taskCountAfter = csr.peekTaskCount(); //queue should be in blocked state at this moment, task level should be inherited from user event - EXPECT_EQ(NEO::Event::eventNotReady, pCmdQ->taskLevel); + EXPECT_EQ(NEO::CompletionStamp::levelNotReady, pCmdQ->taskLevel); //queue should be in blocked state at this moment, task count should be inherited from user event - EXPECT_EQ(NEO::Event::eventNotReady, pCmdQ->taskCount); + EXPECT_EQ(NEO::CompletionStamp::levelNotReady, pCmdQ->taskCount); //queue should be in blocked state EXPECT_EQ(pCmdQ->isQueueBlocked(), true); @@ -232,7 +232,7 @@ TEST_F(MockEventTests, blockedUserEventPassedToEnqueueNdRangeWithReturnEventIsNo //and if normal event inherited status from user event Event *returnEvent = castToObject(retEvent); - EXPECT_EQ(returnEvent->taskLevel, NEO::Event::eventNotReady); + EXPECT_EQ(returnEvent->taskLevel, NEO::CompletionStamp::levelNotReady); EXPECT_EQ(CL_SUCCESS, retVal); @@ -384,7 +384,7 @@ TEST_F(EventTests, givenQueueThatIsBlockedByUserEventWhenIsQueueBlockedIsCalledT } bool updateExecutionStatusCalled = false; }; - mockEvent mockedVirtualEvent(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, Event::eventNotReady, 0); + mockEvent mockedVirtualEvent(pCmdQ, CL_COMMAND_NDRANGE_KERNEL, CompletionStamp::levelNotReady, 0); pCmdQ->virtualEvent = &mockedVirtualEvent; EXPECT_TRUE(pCmdQ->isQueueBlocked()); @@ -462,8 +462,8 @@ TEST_F(MockEventTests, normalEventsBasingOnUserEventHasProperTaskLevel) { //check if dependency count is increased Event *returnEvent = castToObject(retEvent); - EXPECT_EQ(Event::eventNotReady, returnEvent->taskLevel); - EXPECT_EQ(Event::eventNotReady, returnEvent->peekTaskCount()); + EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->peekTaskCount()); //now set user event for complete status, this triggers update of childs. uEvent->setStatus(CL_COMPLETE); @@ -489,7 +489,7 @@ TEST_F(MockEventTests, waitForEventThatWaitsOnSignaledUserEvent) { //check if dependency count is increased Event *returnEvent = castToObject(retEvent); - EXPECT_EQ(Event::eventNotReady, returnEvent->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, returnEvent->taskLevel); //now set user event for complete status, this triggers update of childs. uEvent->setStatus(CL_COMPLETE); @@ -535,7 +535,7 @@ TEST_F(MockEventTests, enqueueWithAbortedUserEventDoesntFlushToCSR) { EXPECT_EQ(taskCount, taskCountAfter); Event *pChildEvent = (Event *)retEvent; - EXPECT_EQ(Event::eventNotReady, pChildEvent->getTaskLevel()); + EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->getTaskLevel()); cl_int eventStatus = 0; retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL); @@ -572,7 +572,7 @@ TEST_F(MockEventTests, childEventDestructorDoesntProcessBlockedCommandsWhenParen EXPECT_EQ(taskCount, taskCountAfter); Event *pChildEvent = (Event *)retEvent; - EXPECT_EQ(Event::eventNotReady, pChildEvent->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, pChildEvent->taskLevel); cl_int eventStatus = 0; retVal = clGetEventInfo(retEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, NULL); diff --git a/unit_tests/event/user_events_tests_mt.cpp b/unit_tests/event/user_events_tests_mt.cpp index 716d73af37..aef8c22822 100644 --- a/unit_tests/event/user_events_tests_mt.cpp +++ b/unit_tests/event/user_events_tests_mt.cpp @@ -95,7 +95,7 @@ TEST_F(EventTests, givenUserEventBlockingEnqueueWithBlockingFlagWhenUserEventIsC while (true) { pCmdQ->takeOwnership(); - if (pCmdQ->taskLevel == Event::eventNotReady) { + if (pCmdQ->taskLevel == CompletionStamp::levelNotReady) { pCmdQ->releaseOwnership(); break; } diff --git a/unit_tests/helpers/dirty_state_helpers_tests.cpp b/unit_tests/helpers/dirty_state_helpers_tests.cpp index cd093d2bf0..c644491d49 100644 --- a/unit_tests/helpers/dirty_state_helpers_tests.cpp +++ b/unit_tests/helpers/dirty_state_helpers_tests.cpp @@ -1,14 +1,14 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "core/helpers/dirty_state_helpers.h" #include "core/helpers/ptr_math.h" #include "core/indirect_heap/indirect_heap.h" #include "core/memory_manager/graphics_allocation.h" -#include "runtime/helpers/dirty_state_helpers.h" #include "unit_tests/mocks/mock_graphics_allocation.h" #include "gtest/gtest.h" diff --git a/unit_tests/helpers/dispatch_flags_helper.h b/unit_tests/helpers/dispatch_flags_helper.h index 3c171c1322..f6fb351930 100644 --- a/unit_tests/helpers/dispatch_flags_helper.h +++ b/unit_tests/helpers/dispatch_flags_helper.h @@ -1,12 +1,12 @@ /* - * Copyright (C) 2019 Intel Corporation + * Copyright (C) 2019-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once -#include "runtime/command_stream/csr_definitions.h" +#include "core/command_stream/csr_definitions.h" using namespace NEO; diff --git a/unit_tests/helpers/flush_stamp_tests.cpp b/unit_tests/helpers/flush_stamp_tests.cpp index ba6049f78d..c399c099df 100644 --- a/unit_tests/helpers/flush_stamp_tests.cpp +++ b/unit_tests/helpers/flush_stamp_tests.cpp @@ -1,11 +1,11 @@ /* - * Copyright (C) 2017-2019 Intel Corporation + * Copyright (C) 2017-2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "runtime/helpers/flush_stamp.h" +#include "core/helpers/flush_stamp.h" #include "gtest/gtest.h" diff --git a/unit_tests/kernel/kernel_tests.cpp b/unit_tests/kernel/kernel_tests.cpp index f9eb2399cf..e364e301c9 100644 --- a/unit_tests/kernel/kernel_tests.cpp +++ b/unit_tests/kernel/kernel_tests.cpp @@ -7,6 +7,7 @@ #include "core/debug_settings/debug_settings_manager.h" #include "core/gmm_helper/gmm_helper.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_helper.h" #include "core/helpers/options.h" #include "core/memory_manager/allocations_list.h" @@ -17,7 +18,6 @@ #include "core/unit_tests/utilities/base_object_utils.h" #include "runtime/built_ins/builtins_dispatch_builder.h" #include "runtime/command_stream/command_stream_receiver_hw.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/helpers/surface_formats.h" #include "runtime/kernel/kernel.h" diff --git a/unit_tests/mocks/mock_csr.h b/unit_tests/mocks/mock_csr.h index 0581caffc4..b7e56b8b50 100644 --- a/unit_tests/mocks/mock_csr.h +++ b/unit_tests/mocks/mock_csr.h @@ -6,6 +6,7 @@ */ #pragma once +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_info.h" #include "core/helpers/options.h" #include "core/helpers/string.h" @@ -15,7 +16,6 @@ #include "runtime/command_stream/command_stream_receiver_hw.h" #include "runtime/execution_environment/execution_environment.h" #include "runtime/helpers/flat_batch_buffer_helper_hw.h" -#include "runtime/helpers/flush_stamp.h" #include "unit_tests/libult/ult_command_stream_receiver.h" #include "gmock/gmock.h" diff --git a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp index 05c64e1d21..8987a16d77 100644 --- a/unit_tests/os_interface/linux/drm_command_stream_tests.cpp +++ b/unit_tests/os_interface/linux/drm_command_stream_tests.cpp @@ -9,13 +9,13 @@ #include "core/gmm_helper/gmm_helper.h" #include "core/gmm_helper/page_table_mngr.h" #include "core/gmm_helper/resource_info.h" +#include "core/helpers/flush_stamp.h" #include "core/memory_manager/graphics_allocation.h" #include "core/memory_manager/internal_allocation_storage.h" #include "core/memory_manager/residency.h" #include "core/os_interface/linux/os_interface.h" #include "core/os_interface/os_context.h" #include "core/unit_tests/helpers/debug_manager_state_restore.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/helpers/memory_properties_flags_helpers.h" #include "runtime/mem_obj/buffer.h" #include "runtime/os_interface/linux/drm_buffer_object.h" diff --git a/unit_tests/os_interface/windows/device_command_stream_tests.cpp b/unit_tests/os_interface/windows/device_command_stream_tests.cpp index ff1e4ff6f6..dc36255b2d 100644 --- a/unit_tests/os_interface/windows/device_command_stream_tests.cpp +++ b/unit_tests/os_interface/windows/device_command_stream_tests.cpp @@ -7,6 +7,7 @@ #include "core/command_stream/linear_stream.h" #include "core/command_stream/preemption.h" +#include "core/helpers/flush_stamp.h" #include "core/helpers/hw_cmds.h" #include "core/helpers/options.h" #include "core/helpers/windows/gmm_callbacks.h" @@ -18,7 +19,6 @@ #include "runtime/command_stream/command_stream_receiver_with_aub_dump.h" #include "runtime/command_stream/device_command_stream.h" #include "runtime/helpers/built_ins_helper.h" -#include "runtime/helpers/flush_stamp.h" #include "runtime/mem_obj/buffer.h" #include "runtime/memory_manager/memory_manager.h" #include "runtime/os_interface/windows/os_context_win.h" diff --git a/unit_tests/profiling/profiling_tests.cpp b/unit_tests/profiling/profiling_tests.cpp index 59bee85d8b..5416655da1 100644 --- a/unit_tests/profiling/profiling_tests.cpp +++ b/unit_tests/profiling/profiling_tests.cpp @@ -909,7 +909,7 @@ struct ProfilingTimestampPacketsTest : public ::testing::Test { MockContext context; cl_command_queue_properties props[5] = {0, 0, 0, 0, 0}; ReleaseableObjectPtr cmdQ = clUniquePtr(new MockCommandQueue(&context, context.getDevice(0), props)); - ReleaseableObjectPtr> ev = clUniquePtr(new MockEvent(cmdQ.get(), CL_COMMAND_USER, Event::eventNotReady, Event::eventNotReady)); + ReleaseableObjectPtr> ev = clUniquePtr(new MockEvent(cmdQ.get(), CL_COMMAND_USER, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady)); }; TEST_F(ProfilingTimestampPacketsTest, givenTimestampsPacketContainerWithOneElementAndTimestampNodeWhenCalculatingProfilingThenTimesAreTakenFromPacket) { diff --git a/unit_tests/scenarios/blocked_enqueue_barrier_scenario_tests.cpp b/unit_tests/scenarios/blocked_enqueue_barrier_scenario_tests.cpp index 31f954a451..b8e9e1851b 100644 --- a/unit_tests/scenarios/blocked_enqueue_barrier_scenario_tests.cpp +++ b/unit_tests/scenarios/blocked_enqueue_barrier_scenario_tests.cpp @@ -38,14 +38,14 @@ HWTEST_F(BarrierScenarioTest, givenBlockedEnqueueBarrierOnOOQWhenUserEventIsUnbl retVal = clEnqueueBarrierWithWaitList(clCommandQ, 1, &eventBlocking, nullptr); EXPECT_EQ(success, retVal); - EXPECT_EQ(Event::eventNotReady, mockCmdQ->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); EXPECT_NE(nullptr, mockCmdQ->virtualEvent); clSetUserEventStatus(eventBlocking, CL_COMPLETE); userEvent->release(); mockCmdQ->isQueueBlocked(); - EXPECT_NE(Event::eventNotReady, mockCmdQ->taskLevel); + EXPECT_NE(CompletionStamp::levelNotReady, mockCmdQ->taskLevel); EXPECT_EQ(nullptr, mockCmdQ->virtualEvent); retVal = clEnqueueNDRangeKernel(clCommandQ, clKernel, 1, offset, gws, nullptr, 0, nullptr, nullptr); diff --git a/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp b/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp index 2f465186a3..6ed3669dbd 100644 --- a/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp +++ b/unit_tests/sharings/gl/windows/gl_arb_sync_event_tests.cpp @@ -105,7 +105,7 @@ struct GlArbSyncEventTest : public ::testing::Test { MockBaseEvent *getBaseEvent() { if (baseEvent == nullptr) { triggerEvent = new UserEvent(ctx.get()); - baseEvent = new MockBaseEvent(cmdQ.get(), CL_COMMAND_RELEASE_GL_OBJECTS, Event::eventNotReady, Event::eventNotReady); + baseEvent = new MockBaseEvent(cmdQ.get(), CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); triggerEvent->addChild(*baseEvent); } return baseEvent; @@ -229,7 +229,7 @@ TEST_F(GlArbSyncEventTest, whenGlArbSyncEventGetsUnblockedBySubmittedOrCompleted } TEST_F(GlArbSyncEventTest, whenGlArbSyncEventIsCreatedFromBaseEventWithoutValidContextThenCreationFails) { - Event *baseEvent = new Event(nullptr, CL_COMMAND_RELEASE_GL_OBJECTS, Event::eventNotReady, Event::eventNotReady); + Event *baseEvent = new Event(nullptr, CL_COMMAND_RELEASE_GL_OBJECTS, CompletionStamp::levelNotReady, CompletionStamp::levelNotReady); auto *arbEvent = GlArbSyncEvent::create(*baseEvent); EXPECT_EQ(nullptr, arbEvent); baseEvent->release(); diff --git a/unit_tests/sharings/gl/windows/gl_sharing_tests.cpp b/unit_tests/sharings/gl/windows/gl_sharing_tests.cpp index 4d25e20331..697350c3fa 100644 --- a/unit_tests/sharings/gl/windows/gl_sharing_tests.cpp +++ b/unit_tests/sharings/gl/windows/gl_sharing_tests.cpp @@ -1105,8 +1105,8 @@ HWTEST_F(glSharingTests, givenSyncObjectWhenCreateEventIsCalledThenCreateGLSyncO auto eventObj = castToObject(event); EXPECT_TRUE(eventObj->getCommandType() == CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR); EXPECT_TRUE(eventObj->peekExecutionStatus() == CL_SUBMITTED); - EXPECT_EQ(Event::eventNotReady, eventObj->taskLevel); - EXPECT_EQ(Event::eventNotReady, eventObj->getTaskLevel()); + EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->taskLevel); + EXPECT_EQ(CompletionStamp::levelNotReady, eventObj->getTaskLevel()); EXPECT_EQ(1, mockGlSharing->dllParam->getParam("GLRetainSyncCalled")); eventObj->setStatus(CL_COMPLETE);