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
Tá an tiomantas seo le fáil i:
Xiaogang Chen
2024-12-12 11:53:03 -06:00
tiomanta ag Xiaogang Chen
tuismitheoir 5da1889fb7
tiomantas e1fdd6fb5f
D'athraigh 3 comhad le 32 breiseanna agus 13 scriosta
+12 -1
Féach ar an gComhad
@@ -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;
}
}