Skip to content

Commit c582437

Browse files
authored
SWDEV-568100 - Reduce latency before the first graph packet gets dispatched (#2558)
* SWDEV-568100 - Fix latency before the first graph packet gets dispatched * SWDEV-568100 - Removed unused addKernelNames() function
1 parent 65474bf commit c582437

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

rocclr/device/rocm/rocvirtual.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ bool VirtualGPU::dispatchAqlPacketBatch(const std::vector<uint8_t*>& packets,
14661466
dispatchBlockingWait();
14671467

14681468
// Add all kernel names in bulk
1469-
vcmd->addKernelNames(kernelNames);
1469+
vcmd->setKernelNamesRef(&kernelNames);
14701470

14711471
// Dispatch all packets with a single doorbell ring
14721472
// Cast packets vector to AQL packets vector on the fly

rocclr/platform/command.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,7 @@ class AccumulateCommand : public Command {
13831383
private:
13841384
//! Kernel names and timestamps list for activity profiling
13851385
std::vector<std::string> kernelNames_;
1386+
const std::vector<std::string>* kernelNamesRef_ = nullptr;
13861387
std::vector<std::pair<uint64_t, uint64_t>> tsList_;
13871388

13881389
public:
@@ -1394,9 +1395,9 @@ class AccumulateCommand : public Command {
13941395
//! Add kernel name to the list if available
13951396
void addKernelName(const std::string& kernelName) { kernelNames_.push_back(kernelName); }
13961397

1397-
//! Add multiple kernel names in bulk
1398-
void addKernelNames(const std::vector<std::string>& kernelNames) {
1399-
kernelNames_.insert(kernelNames_.end(), kernelNames.begin(), kernelNames.end());
1398+
//! Set kernel names by reference
1399+
void setKernelNamesRef(const std::vector<std::string>* kernelNames) {
1400+
kernelNamesRef_ = kernelNames;
14001401
}
14011402

14021403
//! Add kernel timestamp to the list if available
@@ -1405,7 +1406,9 @@ class AccumulateCommand : public Command {
14051406
}
14061407

14071408
//! Return the kernel names
1408-
const std::vector<std::string>& getKernelNames() const { return kernelNames_; }
1409+
const std::vector<std::string>& getKernelNames() const {
1410+
return kernelNamesRef_ != nullptr ? *kernelNamesRef_ : kernelNames_;
1411+
}
14091412

14101413
//! Return the kernel timestamps
14111414
const std::vector<std::pair<uint64_t, uint64_t>>& getTimestamps() const { return tsList_; }

0 commit comments

Comments
 (0)