Skip to content
Merged
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
4 changes: 3 additions & 1 deletion profile/plugin/ml_timeline/clientDev/ml_timeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ namespace xdp {
ptSchema.put("patch", "0");
ptHeader.add_child("schema_version", ptSchema);
ptHeader.put("device", "Client");
ptHeader.put("clock_freq_MHz", 1000);
if (!powerMode.empty()) {
ptHeader.put("power_mode", powerMode);
}
ptHeader.put("id_size", sizeof(uint32_t));
ptHeader.put("cycle_size", 2*sizeof(uint32_t));
ptHeader.put("buffer_size", mBufSz);
Expand Down
5 changes: 5 additions & 0 deletions profile/plugin/ml_timeline/clientDev/ml_timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace xdp {
{
std::unique_ptr<ResultBOContainer> mResultBOHolder;
xrt_core::bo_int::use_type mBOType;
std::string powerMode;

public :
MLTimelineClientDevImpl(VPDatabase* dB, uint32_t sz,
Expand All @@ -39,6 +40,10 @@ namespace xdp {

virtual void updateDevice(void* hwCtxImpl, uint64_t devId = 0);
virtual void finishflushDevice(void* hwCtxImpl, uint64_t implId = 0);

virtual void setPowerMode(const std::string &pMode) {
powerMode = pMode;
}
};

}
Expand Down
2 changes: 2 additions & 0 deletions profile/plugin/ml_timeline/ml_timeline_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace xdp {
virtual void updateDevice(void*, uint64_t) = 0;
virtual void finishflushDevice(void*, uint64_t) = 0;

virtual void setPowerMode(const std::string &) {}

void setHWContextName(const std::string &nm) {
mHwCtxName = nm;
}
Expand Down
9 changes: 9 additions & 0 deletions profile/plugin/ml_timeline/ml_timeline_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ namespace xdp {
xrt_core::message::send(xrt_core::message::severity_level::debug, "XRT", msg.str());
}

try {
const auto pmode = xrt_core::device_query<xrt_core::query::performance_mode>(coreDevice);
mlImpl->setPowerMode(xrt_core::query::performance_mode::parse_status(pmode));
} catch (const xrt_core::query::no_such_key&) {
xrt_core::message::send(xrt_core::message::severity_level::warning, "XRT", "Failed to retrieve Power Mode");
} catch (const std::exception &) {
xrt_core::message::send(xrt_core::message::severity_level::warning, "XRT", "Failed to retrieve Power Mode");
}

#elif defined (XDP_VE2_BUILD)

if (mMultiImpl.find(hwCtxImpl) != mMultiImpl.end()) {
Expand Down
Loading