Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/plugins/intel_gpu/src/runtime/ze/ze_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,12 @@ ze_stream::ze_stream(const ze_engine &engine, const ExecutionConfig& config)

OV_ZE_EXPECT(zeCommandListCreateImmediate(_engine.get_context(), _engine.get_device(), &command_queue_desc, &m_command_list));
bool use_counter_based_events = m_queue_type == QueueTypes::in_order && info.supports_counter_based_events;
m_user_ev_factory = std::make_shared<ze_event_factory>(engine, config.get_enable_profiling());
if (use_counter_based_events) {
m_ev_factory = std::make_unique<ze_counter_based_event_factory>(engine, config.get_enable_profiling());
m_ev_factory = std::make_shared<ze_counter_based_event_factory>(engine, config.get_enable_profiling());
} else {
m_ev_factory = std::make_unique<ze_event_factory>(engine, config.get_enable_profiling());
// If counter based events are not supported or not used, use the same factory for both user and base events
m_ev_factory = m_user_ev_factory;
}
GPU_DEBUG_INFO << "[GPU] Created L0 stream ("
<< "index=" << index
Expand Down Expand Up @@ -330,7 +332,7 @@ void ze_stream::wait() {
}

event::ptr ze_stream::create_user_event(bool set) {
auto ev = m_ev_factory->create_event(++m_queue_counter);
auto ev = m_user_ev_factory->create_event(++m_queue_counter);
if (set)
ev->set();

Expand Down
6 changes: 4 additions & 2 deletions src/plugins/intel_gpu/src/runtime/ze/ze_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class ze_stream : public stream {
, m_queue_counter(other.m_queue_counter.load())
, m_last_barrier(other.m_last_barrier.load())
, m_last_barrier_ev(other.m_last_barrier_ev)
, m_ev_factory(other.m_ev_factory.release()) {
, m_ev_factory(std::move(other.m_ev_factory))
, m_user_ev_factory(std::move(other.m_user_ev_factory)) {
other.m_command_list = nullptr;
}

Expand Down Expand Up @@ -62,7 +63,8 @@ class ze_stream : public stream {
mutable std::atomic<uint64_t> m_queue_counter{0};
std::atomic<uint64_t> m_last_barrier{0};
std::shared_ptr<ze_event> m_last_barrier_ev = nullptr;
std::unique_ptr<ze_base_event_factory> m_ev_factory;
std::shared_ptr<ze_base_event_factory> m_ev_factory;
std::shared_ptr<ze_base_event_factory> m_user_ev_factory;

#ifdef ENABLE_ONEDNN_FOR_GPU
std::shared_ptr<dnnl::stream> _onednn_stream = nullptr;
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/intel_gpu/tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ if (NOT GPU_RT_TYPE STREQUAL "OCL")
endforeach()
endif()

file(GLOB_RECURSE SOURCES_WITH_ZE_RT
"${CMAKE_CURRENT_SOURCE_DIR}/module_tests/ze_test.cpp"
)
if (NOT GPU_RT_TYPE STREQUAL "L0")
foreach (SOURCE_FILE IN LISTS SOURCES_WITH_ZE_RT)
list (REMOVE_ITEM SOURCES_MAIN ${SOURCE_FILE})
endforeach()
endif()

if (NOT ENABLE_ONEDNN_FOR_GPU)
set(EXCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn/")
foreach (SOURCE_FILE IN LISTS SOURCES_MAIN)
Expand Down
Loading
Loading