SWDEV-457755 - Add TS only for kernel packets in the Accumulate command

Change-Id: I1b2f01c5763761808f49802fa117abc6306a22aa
Este commit está contenido en:
Satyanvesh Dittakavi
2024-04-25 16:41:10 +00:00
cometido por Maneesh Gupta
padre e705e5e0d9
commit 3d540ec113
Se han modificado 3 ficheros con 20 adiciones y 9 borrados
+2
Ver fichero
@@ -82,6 +82,7 @@ public:
Timestamp* ts_; //!< Timestamp object associated with the signal
HwQueueEngine engine_; //!< Engine used with this signal
amd::Monitor lock_; //!< Signal lock for update
bool isPacketDispatch_; //!< True if the packet associated with the signal is dispatch
typedef union {
struct {
@@ -98,6 +99,7 @@ public:
: ts_(nullptr)
, engine_(HwQueueEngine::Compute)
, lock_("Signal Ops Lock", true)
, isPacketDispatch_(false)
{
signal_.handle = 0;
flags_.done_ = true;
+12 -7
Ver fichero
@@ -158,7 +158,7 @@ void Timestamp::checkGpuTime() {
start = std::min(time.start, start);
end = std::max(time.end, end);
if (command().type() == CL_COMMAND_TASK) {
if ((command().type() == CL_COMMAND_TASK) && (it->isPacketDispatch_ == true)) {
static_cast<amd::AccumulateCommand&>(command()).addTimestamps(time.start, time.end);
}
@@ -868,12 +868,17 @@ bool VirtualGPU::dispatchGenericAqlPacket(
// Get active signal for current dispatch if profiling is necessary
packet->completion_signal = Barriers().ActiveSignal(kInitSignalValueOne, timestamp_);
// If profiling is enabled, store the correlation ID in the dispatch packet. The profiler can
// retrieve this correlation ID to attribute waves to specific dispatch locations.
if (std::is_same<decltype(packet), hsa_kernel_dispatch_packet_t*>::value &&
activity_prof::IsEnabled(OP_ID_DISPATCH)) {
auto dispatchPacket = reinterpret_cast<hsa_kernel_dispatch_packet_t*>(packet);
dispatchPacket->reserved2 = timestamp_->command().profilingInfo().correlation_id_;
if (std::is_same<decltype(packet), hsa_kernel_dispatch_packet_t*>::value) {
// If profiling is enabled, store the correlation ID in the dispatch packet. The profiler can
// retrieve this correlation ID to attribute waves to specific dispatch locations.
if (activity_prof::IsEnabled(OP_ID_DISPATCH)) {
auto dispatchPacket = reinterpret_cast<hsa_kernel_dispatch_packet_t*>(packet);
dispatchPacket->reserved2 = timestamp_->command().profilingInfo().correlation_id_;
}
ProfilingSignal* current_signal = Barriers().GetLastSignal();
current_signal->isPacketDispatch_ = true;
}
}
+6 -2
Ver fichero
@@ -103,12 +103,16 @@ void ReportActivity(const amd::Command& command) {
if (command.type() == CL_COMMAND_TASK) {
auto timestamps = static_cast<const amd::AccumulateCommand&>(command).getTimestamps();
std::vector<std::string> kernel_names =
static_cast<const amd::AccumulateCommand&>(command).getKernelNames();
for (uint32_t i = 0; i < timestamps.size(); i++) {
auto it = timestamps[i];
record.begin_ns = it.first;
record.end_ns = it.second;
record.kernel_name =
static_cast<const amd::AccumulateCommand&>(command).getKernelNames()[i].c_str();
if (kernel_names[i].empty()) {
LogError("kernel name cannot be empty");
}
record.kernel_name = kernel_names[i].c_str();
function(ACTIVITY_DOMAIN_HIP_OPS, operation_id, &record);
}
} else {