Don't create blits when copy profiling is enabled.
Change-Id: I879827133957ee610c3381ea30c536ec7d10ffab
[ROCm/ROCR-Runtime commit: 1251842900]
このコミットが含まれているのは:
@@ -676,7 +676,7 @@ hsa_status_t GpuAgent::EnableDmaProfiling(bool enable) {
|
||||
}
|
||||
|
||||
for (int i = 0; i < BlitCount; ++i) {
|
||||
if (blits_[i] != NULL) {
|
||||
if (blits_[i].created()) {
|
||||
const hsa_status_t stat = blits_[i]->EnableProfiling(enable);
|
||||
if (stat != HSA_STATUS_SUCCESS) {
|
||||
return stat;
|
||||
|
||||
@@ -328,12 +328,13 @@ hsa_status_t hsa_amd_profiling_async_copy_enable(bool enable) {
|
||||
TRY;
|
||||
IS_OPEN();
|
||||
|
||||
return core::Runtime::runtime_singleton_->IterateAgent(
|
||||
[](hsa_agent_t agent_handle, void* data) -> hsa_status_t {
|
||||
const bool enable = *(reinterpret_cast<bool*>(data));
|
||||
return core::Agent::Convert(agent_handle)->profiling_enabled(enable);
|
||||
},
|
||||
reinterpret_cast<void*>(&enable));
|
||||
hsa_status_t ret = HSA_STATUS_SUCCESS;
|
||||
for (core::Agent* agent : core::Runtime::runtime_singleton_->gpu_agents()) {
|
||||
hsa_status_t err = agent->profiling_enabled(enable);
|
||||
if (err != HSA_STATUS_SUCCESS) ret = err;
|
||||
}
|
||||
return ret;
|
||||
|
||||
CATCH;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,10 +88,13 @@ template <typename T> class lazy_ptr {
|
||||
|
||||
/*
|
||||
* Ensures that the object is created or is being created.
|
||||
* This is useful when early consruction of the object is required.
|
||||
* This is useful when early construction of the object is required.
|
||||
*/
|
||||
void touch() const { make(false); }
|
||||
|
||||
// Tells if the lazy object has been constructed or not.
|
||||
bool created() const { return obj != nullptr; }
|
||||
|
||||
private:
|
||||
mutable std::unique_ptr<T> obj;
|
||||
mutable std::function<T*(void)> func;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする