Skip to content

Commit 08b09ba

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

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class profiling_impl
130130
{}
131131

132132
~profiling_impl()
133-
{}
133+
{
134+
device->stop_profiling(profiling_hdl);
135+
}
134136

135137
handle
136138
start_profiling(int option, const std::string& port1_name, const std::string& port2_name, uint32_t value)

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

+9-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "xrt/xrt_bo.h"
2525
#include "xrt/xrt_device.h"
2626
#include "xrt/xrt_graph.h"
27+
#include "xrt/detail/pimpl.h"
2728

2829
#ifdef __cplusplus
2930
# include <cstdint>
@@ -164,17 +165,21 @@ class bo : public xrt::bo
164165
};
165166

166167
class profiling_impl;
167-
class profiling
168+
class profiling : public detail::pimpl<profiling_impl>
168169
{
169170
public:
170171
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 };
172+
173+
profiling() = default;
174+
171175
/**
172176
* event() - Constructor from a device
173177
*
174178
* @param device
175179
* The device on which the profiling should start
176180
*
177181
*/
182+
explicit
178183
profiling(const xrt::device& device);
179184

180185
/**
@@ -212,7 +217,7 @@ class profiling
212217
stop() const;
213218

214219
private:
215-
std::shared_ptr<profiling_impl> impl;
220+
std::shared_ptr<profiling_impl> impl;
216221
};
217222

218223
}} // aie, xrt
@@ -313,8 +318,8 @@ xrtResetAIEArray(xrtDeviceHandle handle);
313318
*
314319
* @handle: Handle to the device
315320
* @option: Profiling option.
316-
* @port1Name: Profiling port 1 name
317-
* @port2Name: Profiling port 2 name
321+
* @port1Name: PLIO/GMIO port 1 name
322+
* @port2Name: PLIO/GMIO port 2 name
318323
* @value: The number of bytes to trigger the profiling event
319324
*
320325
* Return: An integer profiling handle on success,

src/runtime_src/doc/toc/xrt_native_apis.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ The ``xrt::aie::profiling::stop`` function stops the performance profiling assoc
854854
:number-lines: 35
855855
856856
event.stop();
857-
double throughput = (double)output_size_in_bytes / (cycle_count *0.8 * 1e-3);
857+
double throughput = output_size_in_bytes / (cycle_count *0.8 * 1e-3);
858858
// Every AIE cycle is 0.8ns in production board
859859
std::cout << "Throughput of the graph: " << throughput << " MB/s" << std::endl;
860860

0 commit comments

Comments
 (0)