Skip to content

Commit

Permalink
Fix for non-graph XRT use cases (#8356)
Browse files Browse the repository at this point in the history
Signed-off-by: Sravankumar allu <[email protected]>
Co-authored-by: Sravankumar allu <[email protected]>
  • Loading branch information
SravanKumarAllu-xilinx and Sravankumar allu authored Aug 21, 2024
1 parent 2e9f19e commit e9b1c0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/runtime_src/core/edge/user/hwctx_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ namespace zynqaie {
{
#ifdef XRT_ENABLE_AIE
auto device{xrt_core::get_userpf_device(m_shim)};
m_aie_array = std::make_unique<Aie>(device);
auto data = device->get_axlf_section(AIE_METADATA, m_uuid);
if (data.first && data.second)
m_aie_array = std::make_unique<Aie>(device);
#endif
}

Expand Down
9 changes: 3 additions & 6 deletions src/runtime_src/core/edge/user/shim.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,14 @@ class shim {
auto hwctx_obj = dynamic_cast<zynqaie::hwctx_object*>(hwctx_hdl);

if (nullptr != hwctx_obj) {
if (!(m_aie_array = hwctx_obj->get_aie_array_from_hwctx()))
throw xrt_core::error(-EINVAL, "No AIE presented");
m_aie_array = hwctx_obj->get_aie_array_from_hwctx();
}
}
else {
auto device = xrt_core::get_userpf_device(m_shim);
auto drv = ZYNQ::shim::handleCheck(device->get_device_handle());
if (!drv->isAieRegistered())
throw xrt_core::error(-EINVAL, "No AIE presented");

m_aie_array = drv->getAieArray();
if (drv->isAieRegistered())
m_aie_array = drv->getAieArray();
}
#endif
}
Expand Down

0 comments on commit e9b1c0b

Please sign in to comment.