Skip to content

Commit bcf46a8

Browse files
committed
Fix runlist capturing and replay, still WIP
Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
1 parent 5e686e7 commit bcf46a8

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/runtime_src/core/common/api/kernel_int.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ xrt::elf
106106
get_ctrlcode(const xrt::kernel&);
107107

108108
// get_hwctx() - Get hwctx in which the run kernel is created
109+
XRT_CORE_COMMON_EXPORT
109110
xrt::hw_context
110111
get_hwctx(const xrt::run&);
111112

src/runtime_src/core/common/runner/capture.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#define XRT_CORE_COMMON_SOURCE // in same dll as coreutil
55
#define XRT_API_SOURCE // in same dll as coreutil
66

7+
//#define XRT_VERBOSE
8+
79
#include "capture.h"
810
#include "detail/capture_artifacts.h"
911
#include "detail/capture_fnfwd.h"
@@ -870,6 +872,8 @@ class frames
870872
using T = std::decay_t<decltype(v)>;
871873
if constexpr (std::is_same_v<T, std::string>) {
872874
json a = json::object();
875+
XRT_DEBUGF("replay_execution_frame_arguments: argidx=%zu, nm=%s, value=%s\n",
876+
argidx, run.get_bo_arg(argidx)->get_name().c_str(), v.c_str());
873877
a["argidx"] = argidx;
874878
a["bo"] = run.get_bo_arg(argidx)->get_name();
875879
a["fnm"] = v;
@@ -1016,6 +1020,7 @@ class frames
10161020
{
10171021
std::lock_guard lk(m_mutex);
10181022
auto& rl = create_runlist_if_new(rlhdl);
1023+
create_run_if_new(rhdl);
10191024
rl.add_run(m_runs.at(rhdl));
10201025
}
10211026

src/runtime_src/core/common/runner/replay.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "core/common/debug.h"
88
#include "core/common/api/hw_context_int.h"
9+
#include "core/common/api/kernel_int.h"
910
#include "core/common/json/nlohmann/json.hpp"
1011

1112
#include "core/include/xrt/xrt_bo.h"
@@ -358,6 +359,9 @@ struct replayer
358359
void
359360
add(xrt::run run) override
360361
{
362+
if (!m_runlist)
363+
m_runlist = xrt::runlist{xrt_core::kernel_int::get_hwctx(run)};
364+
361365
m_runlist.add(std::move(run));
362366
}
363367

0 commit comments

Comments
 (0)