rocr: Disable WaitAny() in AsyncEventsLoop()
- Add the new path to avoid WaitAny() calls in AsyncEventsLoopp() with HSA_WAIT_ANY_DEBUG key. The new path is selected by default. The optimizaiton combines all logic of WaitAny() in a single processing loop and avoids extra memory allocations or ref counting. Also it won't spin on the CPU if all events are busy. Change-Id: I197ce60d0d023fbb672f700d6e87702686f1f55a
Cette révision appartient à :
révisé par
David Yat Sin
Parent
d90fbee9c4
révision
0fc7369ba5
@@ -556,6 +556,8 @@ class Runtime {
|
||||
std::vector<hsa_signal_condition_t> cond_;
|
||||
std::vector<hsa_signal_value_t> value_;
|
||||
std::vector<hsa_amd_signal_handler> handler_;
|
||||
std::vector<HsaEvent*> hsa_events_; //!< A list of HSA events for KFD wait
|
||||
std::vector<uint64_t> age_; //!< The age list for KFD wait
|
||||
std::vector<void*> arg_;
|
||||
};
|
||||
|
||||
|
||||
@@ -379,6 +379,12 @@ class Signal {
|
||||
/// @brief Checks if signal is currently in use by a wait API.
|
||||
bool InWaiting() const { return waiting_ != 0; }
|
||||
|
||||
/// @brief Increments the waiting indicator.
|
||||
void WaitingInc() { waiting_++; }
|
||||
|
||||
/// @brief Decrements the waiting indicator.
|
||||
void WaitingDec() { waiting_--; }
|
||||
|
||||
// Prep for copy profiling. Store copy agent and ready API block.
|
||||
__forceinline void async_copy_agent(core::Agent* agent) {
|
||||
async_copy_agent_ = agent;
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur