Skip to content

Commit

Permalink
[Tests] Make would fail with no device error without GPUs (#2909)
Browse files Browse the repository at this point in the history
* Fix make failed with no device error without GPUs

* Add DISCOVERY_MODE PRE_TEST option in gtest_discover_tests so  test binary will execute during runtime to discover the tests before actually running them

* Set DISCOVERY_MODE to PRE_TEST in gtest_discover_tests() so test binary will execute during runtime to discover the tests before actually running them

* Remove duplicated DISCOVERY_MODE option
  • Loading branch information
xinlipn authored Apr 26, 2024
1 parent 2232184 commit 0903930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ function(add_gtest TEST_NAME TEST_CPP)
if(NOT MIOPEN_EMBED_DB STREQUAL "")
target_link_libraries(${TEST_NAME} $<BUILD_INTERFACE:miopen_data>)
endif()
if(NOT WIN32) # TODO: cannot run on Windows due to missing DLL dependencies
if(NOT WIN32 AND MIOPEN_TEST_DISCRETE) # TODO: cannot run on Windows due to missing DLL dependencies
# Enable CMake to discover the test binary
gtest_discover_tests(${TEST_NAME} DISCOVERY_TIMEOUT 300 PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL};CODECOV_TEST=${CODECOV_TEST};MIOPEN_TEST_DBSYNC=${MIOPEN_TEST_DBSYNC};MIOPEN_TEST_CONV=${MIOPEN_TEST_CONV};MIOPEN_TEST_DEEPBENCH=${MIOPEN_TEST_DEEPBENCH};MIOPEN_DEBUG_TUNING_ITERATIONS_MAX=${MIOPEN_DEBUG_TUNING_ITERATIONS_MAX}")
gtest_discover_tests(${TEST_NAME} DISCOVERY_TIMEOUT 300 DISCOVERY_MODE PRE_TEST PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL};CODECOV_TEST=${CODECOV_TEST};MIOPEN_TEST_DBSYNC=${MIOPEN_TEST_DBSYNC};MIOPEN_TEST_CONV=${MIOPEN_TEST_CONV};MIOPEN_TEST_DEEPBENCH=${MIOPEN_TEST_DEEPBENCH};MIOPEN_DEBUG_TUNING_ITERATIONS_MAX=${MIOPEN_DEBUG_TUNING_ITERATIONS_MAX}")
endif()
target_link_libraries(${TEST_NAME} BZip2::BZip2)
if(WIN32)
Expand Down

0 comments on commit 0903930

Please sign in to comment.