Skip to content

Commit 8e6dca1

Browse files
author
saumya garg
committed
fix review comments
Signed-off-by: saumya garg <[email protected]>
1 parent 08b09ba commit 8e6dca1

File tree

2 files changed

+38
-9
lines changed

2 files changed

+38
-9
lines changed

src/runtime_src/core/common/api/aie/xrt_graph.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ class profiling_impl
131131

132132
~profiling_impl()
133133
{
134-
device->stop_profiling(profiling_hdl);
134+
try {
135+
device->stop_profiling(profiling_hdl);
136+
}
137+
catch(...) {
138+
//do nothing
139+
}
135140
}
136141

137142
handle
@@ -379,7 +384,7 @@ namespace xrt { namespace aie {
379384

380385
profiling::
381386
profiling(const xrt::device& device)
382-
: impl(std::move(create_profiling_event(device)))
387+
: detail::pimpl<profiling_impl>(std::move(create_profiling_event(device)))
383388
{}
384389

385390
int
@@ -388,7 +393,7 @@ start(xrt::aie::profiling::profiling_option option, const std::string& port1_nam
388393
{
389394
int opt = static_cast<int>(option);
390395
return xdp::native::profiling_wrapper("xrt::aie::profiling::start", [this, opt, &port1_name, &port2_name, value] {
391-
return impl->start_profiling(opt, port1_name, port2_name, value);
396+
return get_handle()->start_profiling(opt, port1_name, port2_name, value);
392397
});
393398
}
394399

@@ -397,7 +402,7 @@ profiling::
397402
read() const
398403
{
399404
return xdp::native::profiling_wrapper("xrt::aie::profiling::read", [this] {
400-
return impl->read_profiling();
405+
return get_handle()->read_profiling();
401406
});
402407
}
403408

@@ -406,7 +411,7 @@ profiling::
406411
stop() const
407412
{
408413
xdp::native::profiling_wrapper("xrt::aie::profiling::stop", [this] {
409-
return impl->stop_profiling();
414+
return get_handle()->stop_profiling();
410415
});
411416
}
412417

src/runtime_src/core/include/xrt/xrt_aie.h

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,32 @@ class profiling_impl;
168168
class profiling : public detail::pimpl<profiling_impl>
169169
{
170170
public:
171-
enum class profiling_option : int { io_total_stream_running_to_idle_cycles = 0, io_stream_start_to_bytes_transferred_cycles = 1, io_stream_start_difference_cycles = 2, io_stream_running_event_count = 3 };
171+
172+
/**
173+
* @enum profiliing_options - contains the enumerated options for performance
174+
* profiling using PLIO and GMIO objects.
175+
*
176+
* @var io_total_stream_running_to_idle_cycles
177+
* Total clock cycles in between the stream running event and the stream
178+
* idle event of the stream port in the interface tile.
179+
* @var io_stream_start_to_bytes_transferred_cycles
180+
* The clock cycles in between the first stream running event to the event that
181+
* the specified bytes are transferred through the stream port in the interface tile.
182+
* @var io_stream_start_difference_cycles
183+
* The clock cycles elapsed between the first stream running events of
184+
* the two platform I/O objects.
185+
* @var io_stream_running_event_count
186+
* Number of stream running events
187+
*
188+
* Please refer UG1079 for more details.
189+
*/
190+
enum class profiling_option : int
191+
{
192+
io_total_stream_running_to_idle_cycles = 0,
193+
io_stream_start_to_bytes_transferred_cycles = 1,
194+
io_stream_start_difference_cycles = 2,
195+
io_stream_running_event_count = 3
196+
};
172197

173198
profiling() = default;
174199

@@ -194,6 +219,8 @@ class profiling : public detail::pimpl<profiling_impl>
194219
* @param value
195220
* The number of bytes to trigger the profiling event.
196221
*
222+
* Please refer UG1079 for more details.
223+
*
197224
* This function configures the performance counters in AI Engine by given
198225
* port names and value. The port names and value will have different
199226
* meanings on different options.
@@ -215,9 +242,6 @@ class profiling : public detail::pimpl<profiling_impl>
215242
*/
216243
void
217244
stop() const;
218-
219-
private:
220-
std::shared_ptr<profiling_impl> impl;
221245
};
222246

223247
}} // aie, xrt

0 commit comments

Comments
 (0)