Skip to content

Commit

Permalink
Merge pull request #888 from CHIP-SPV/fix-887
Browse files Browse the repository at this point in the history
Fix 887
  • Loading branch information
pvelesko authored Jul 24, 2024
2 parents 2a9f3b5 + a9ab17a commit 083c374
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CHIPDriver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void CHIPInitializeCallOnce() {

extern void CHIPInitialize() {
std::call_once(Initialized, &CHIPInitializeCallOnce);
if (!Backend)

Check warning on line 128 in src/CHIPDriver.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

src/CHIPDriver.cc:128:8 [readability-implicit-bool-conversion]

implicit conversion 'chipstar::Backend *' -> bool

Check warning on line 128 in src/CHIPDriver.cc

View workflow job for this annotation

GitHub Actions / cpp-linter

src/CHIPDriver.cc:128:16 [readability-braces-around-statements]

statement should be inside braces
CHIPERR_LOG_AND_THROW("Backend not initialized",
hipErrorInitializationError);
}

void CHIPUninitializeCallOnce() {
Expand Down
1 change: 1 addition & 0 deletions tests/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ add_hip_runtime_test(TestPositiveHasNoIGBAs.hip)

add_hip_runtime_test(CatchMemLeak1.hip)
add_hip_runtime_test(TestBufferDevAddr.hip)
add_hip_runtime_test(Test887.hip)

add_hip_runtime_test(host-math-funcs.hip)
set_tests_properties("host-math-funcs" PROPERTIES
Expand Down
28 changes: 28 additions & 0 deletions tests/runtime/Test887.hip
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <cstdio>
#include <hip/hip_runtime.h>

class Test {
public:
float *output;
Test();
~Test();
};

// Constructor
Test::Test() {
output = NULL;
hipMalloc(&output, sizeof(float) * 100);
}

// Destructor
Test::~Test() {
printf("destructor called\n");
hipFree(output);
}

Test test = Test();

int main() {
printf("testing\n");
return 0;
}

0 comments on commit 083c374

Please sign in to comment.