Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/util/hsa_rsrc_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,12 @@ HsaRsrcFactory::HsaRsrcFactory(bool initialize_hsa) : initialize_hsa_(initialize
CHECK_STATUS("loader API table query failed", status);

// Instantiate HSA timer
timer_ = new HsaTimer;
CHECK_STATUS("HSA timer allocation failed",
(timer_ == NULL) ? HSA_STATUS_ERROR : HSA_STATUS_SUCCESS);
timer_ = nullptr; // Ensure timer_ is initialized to nullptr
try {
timer_ = new HsaTimer;
} catch (const std::bad_alloc&) {
CHECK_STATUS("HSA timer allocation failed", HSA_STATUS_ERROR);
}

// System timeout
timeout_ =
Expand Down