Skip to content

Commit

Permalink
Fix 887
Browse files Browse the repository at this point in the history
Backend destruction was done along with
_hipUnregisterFatBinary.

delay destruction by using destructor attribute
  • Loading branch information
pvelesko committed Jul 23, 2024
1 parent 1f94cd5 commit 8f8cc8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions src/CHIPBindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4968,9 +4968,6 @@ extern "C" void __hipUnregisterFatBinary(void *Data) {

logDebug("Modules left: {}", NumBins - 1);

if (Backend && NumBins == 1)
CHIPUninitialize();

CHIP_CATCH_NO_RETURN
}

Expand Down
4 changes: 2 additions & 2 deletions src/CHIPDriver.hh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extern void CHIPInitialize();
* @brief
* Singleton backend initialization function outer wrapper
*/
extern void CHIPUninitialize();
__attribute__((destructor)) extern void CHIPUninitialize();

/**
* @brief
Expand Down Expand Up @@ -175,7 +175,7 @@ private:
Type Type_;

public:
BackendType(){};
BackendType() {};

Check warning on line 178 in src/CHIPDriver.hh

View workflow job for this annotation

GitHub Actions / cpp-linter

src/CHIPDriver.hh:178:3 [modernize-use-equals-default]

use '= default' to define a trivial default constructor
BackendType(const std::string &StrIn) {
if (StrIn == "opencl") {
Type_ = BackendType::OpenCL;
Expand Down

0 comments on commit 8f8cc8f

Please sign in to comment.