kfdtest: Separate LLVM initialization and instantiation

Assembler function from LLVM is not multi-thread safe and is ASIC dependent.
To extend kfdtest to test on multiple GPU separate LLVM initialization and
assembler instantiation. Each test uses its own assembler.

Signed-off-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Change-Id: I94c996e807b81d8b19361b450be985b12042477c


[ROCm/ROCR-Runtime commit: e1fdd6fb5f]
This commit is contained in:
Xiaogang Chen authored and Xiaogang Chen committed 2024-12-16 12:46:07 -05:00
1 orang tua 95ee8b36d7
melakukan ca76e3fde0
3 files changed
+32 -13

No files matched your search

@@ -26,6 +26,7 @@
#include "KFDTestUtil.hpp"
#include "GoogleTestExtension.hpp"
#include "OSWrapper.hpp"
#include "Assemble.hpp"
#define KFD_TEST_DEFAULT_TIMEOUT 60000
@@ -72,6 +73,7 @@ GTEST_API_ int main(int argc, char **argv) {
bool success = GetCommandLineArguments(argc, argv, args);
if (success) {
int r;
if ((GetHwCapabilityHWS() || args.HwsEnabled == HWCAP__FORCE_ENABLED) &&
(args.HwsEnabled != HWCAP__FORCE_DISABLED))
g_TestENVCaps |= ENVCAPS_HWSCHEDULING;
@@ -104,6 +106,15 @@ GTEST_API_ int main(int argc, char **argv) {
LOG() << "Sleep time in seconds as specified by user: " << std::dec << g_SleepTime << std::endl;
}
return RUN_ALL_TESTS();
/* init LLVM one time*/
Init_LLVM();
r = RUN_ALL_TESTS();
/* shutdown LLVM after tests finish */
Shutdown_LLVM();
LOG() << "kfdtest finished with return code: " << r << std::endl;
return r;
}
}