EXSWCPHIPT-42: Changes to HIP RTC Framework implementation (#2732)

- Removed ifdef from hipTestContext class
- Fix potential race condition in hipTest::launchRTCKernel()
- Improve documentation
- Move moduleUnloading to main() instead of explicitly calling it on every test
- Fix code formating
- Fix segmentation fault caused by using catch2 macro after catch2 is destroyed

[ROCm/hip commit: d46d399976]
This commit is contained in:
Fábio
2022-06-28 04:30:37 +01:00
committed by GitHub
parent ca34408b7c
commit cc7ae07901
7 changed files with 42 additions and 28 deletions
@@ -1,3 +1,4 @@
#include <cstdlib>
#include <hip_test_common.hh>
#include <picojson.h>
#include <fstream>
@@ -211,7 +212,10 @@ bool TestContext::parseJsonFile() {
void TestContext::cleanContext() {
for (auto& pair : compiledKernels) {
REQUIRE(hipSuccess == hipModuleUnload(pair.second.module));
hipError_t error = hipModuleUnload(pair.second.module);
if (error != hipSuccess) {
throw std::runtime_error("Unable to unload rtc module");
}
}
}
+4 -1
View File
@@ -9,5 +9,8 @@ int main(int argc, char** argv) {
std::cout << "HIP_SKIP_THIS_TEST" << std::endl;
return 0;
}
return Catch::Session().run(argc, argv);
int out = Catch::Session().run(argc, argv);
TestContext::get().cleanContext();
return out;
}