SWDEV-447973 - Add generic target codeobj test

Add simple tests to verify generic target code
objects.

Change-Id: Iae148c3c938b18247624938512918dbb3cbc462e
This commit is contained in:
taosang2
2024-06-28 17:17:31 -04:00
committed by Tao Sang
parent 168312b97f
commit f581518103
14 changed files with 720 additions and 4 deletions
+15 -1
View File
@@ -36,7 +36,7 @@ TEST_CASE("Unit_hipModuleLoadData_Positive_Basic") {
HIP_CHECK(hipModuleUnload(module));
}
#if defined(__HIP_PLATFORM_AMD__)
#if HT_AMD
SECTION("Load compiled module from file with compressed code objects") {
const auto loaded_module = LoadModuleIntoBuffer("copyKernelCompressed.code");
HIP_CHECK(hipModuleLoadData(&module, loaded_module.data()));
@@ -46,6 +46,20 @@ TEST_CASE("Unit_hipModuleLoadData_Positive_Basic") {
REQUIRE(kernel != nullptr);
HIP_CHECK(hipModuleUnload(module));
}
SECTION("Load compiled module from file with generic target code objects") {
if (!isGenericTargetSupported()) {
fprintf(stderr, "Generic target test is skipped\n");
return;
}
const auto loaded_module = LoadModuleIntoBuffer("copyKernelGenericTarget.code");
HIP_CHECK(hipModuleLoadData(&module, loaded_module.data()));
REQUIRE(module != nullptr);
hipFunction_t kernel = nullptr;
HIP_CHECK(hipModuleGetFunction(&kernel, module, "copy_ker"));
REQUIRE(kernel != nullptr);
HIP_CHECK(hipModuleUnload(module));
}
#endif
SECTION("Load RTCd module") {