SWDEV-439004, SWDEV-440021 - Fix GL Interop & Unit_hipP2pLinkTypeAndHopFunc testcases
- hipGLDeviceListNextFrame is not supported yet - Initialize GL interop before calling interop related APIs - Skip GL interop tests when display is not connected - Load librocm_smi64.so from /opt/rocm/lib/ Change-Id: Ie4879c18317aa377a95d6f2d0d5314d4adf38649
This commit is contained in:
@@ -41,10 +41,16 @@ TEST_CASE("Unit_hipGLGetDevices_Positive_Basic") {
|
||||
unsigned int gl_device_count = 0;
|
||||
std::vector<int> gl_devices(device_count, -1);
|
||||
|
||||
HIP_CHECK(hipGLGetDevices(&gl_device_count, gl_devices.data(), device_count, device_list));
|
||||
|
||||
REQUIRE(gl_device_count == 1);
|
||||
REQUIRE(gl_devices.at(0) == 0);
|
||||
if (device_list == hipGLDeviceListNextFrame) {
|
||||
HIP_CHECK_ERROR(hipGLGetDevices(&gl_device_count, gl_devices.data(),
|
||||
device_count, device_list), hipErrorNotSupported);
|
||||
REQUIRE(gl_device_count == 0);
|
||||
REQUIRE(gl_devices.at(0) == -1);
|
||||
} else {
|
||||
HIP_CHECK(hipGLGetDevices(&gl_device_count, gl_devices.data(), device_count, device_list));
|
||||
REQUIRE(gl_device_count == 1);
|
||||
REQUIRE(gl_devices.at(0) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipGLGetDevices_Positive_Parameters") {
|
||||
@@ -56,18 +62,21 @@ TEST_CASE("Unit_hipGLGetDevices_Positive_Parameters") {
|
||||
std::vector<int> gl_devices(device_count, -1);
|
||||
|
||||
SECTION("pHipDeviceCount == nullptr") {
|
||||
HIP_CHECK(hipGLGetDevices(nullptr, gl_devices.data(), device_count, hipGLDeviceListAll));
|
||||
REQUIRE(gl_devices.at(0) == 0);
|
||||
HIP_CHECK_ERROR(hipGLGetDevices(nullptr, gl_devices.data(),
|
||||
device_count, hipGLDeviceListAll), hipErrorInvalidValue);
|
||||
REQUIRE(gl_devices.at(0) == -1);
|
||||
}
|
||||
|
||||
SECTION("pHipDevices == nullptr") {
|
||||
HIP_CHECK(hipGLGetDevices(&gl_device_count, nullptr, device_count, hipGLDeviceListAll));
|
||||
REQUIRE(gl_device_count == 1);
|
||||
HIP_CHECK_ERROR(hipGLGetDevices(&gl_device_count, nullptr,
|
||||
device_count, hipGLDeviceListAll), hipErrorInvalidValue);
|
||||
REQUIRE(gl_device_count == 0);
|
||||
}
|
||||
|
||||
SECTION("hipDeviceCount == 0") {
|
||||
HIP_CHECK(hipGLGetDevices(&gl_device_count, gl_devices.data(), 0, hipGLDeviceListAll));
|
||||
REQUIRE(gl_device_count == 1);
|
||||
HIP_CHECK_ERROR(hipGLGetDevices(&gl_device_count, gl_devices.data(),
|
||||
0, hipGLDeviceListAll), hipErrorInvalidValue);
|
||||
REQUIRE(gl_device_count == 0);
|
||||
REQUIRE(gl_devices.at(0) == -1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user