SWDEV-504084 - Added multidevice testcases for hipModuleGetFunction/Global

Change-Id: I53d6d63f93c800efa2ec0ff2be5ae593756549e0
This commit is contained in:
Marko Arandjelovic
2024-12-18 16:37:55 +00:00
committed by Rakesh Roy
parent fc270bc90c
commit cddb658314
2 changed files with 37 additions and 2 deletions
+18 -1
View File
@@ -71,4 +71,21 @@ TEST_CASE("Unit_hipModuleGetFunction_Negative_Parameters") {
SECTION("kname == __device__ kernel") {
HIP_CHECK_ERROR(hipModuleGetFunction(&kernel, GetModule(), "DeviceKernel"), hipErrorNotFound);
}
}
}
// Test description: Loading kernel function from different device than the one on which the module
// is loaded
TEST_CASE("Unit_hipModuleGetFunction_DiffDevice") {
int numDevices = 0;
HIP_CHECK(hipGetDeviceCount(&numDevices));
if (numDevices < 2) {
SUCCEED("skipped the testcase as no of devices is less than 2");
return;
}
hipFunction_t kernel = nullptr;
auto module = GetModule();
HIP_CHECK(hipSetDevice(1));
HIP_CHECK(hipModuleGetFunction(&kernel, module, "GlobalKernel"));
REQUIRE(kernel != nullptr);
}