Skip to content

Commit

Permalink
benchdnn: inputs: add test_matmul_random_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoursler committed Jan 18, 2025
1 parent 4761f89 commit 421274e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/benchdnn/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#===============================================================================
# Copyright 2017-2024 Intel Corporation
# Copyright 2017-2025 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -139,13 +139,16 @@ if(NOT DNNL_CPU_RUNTIME STREQUAL "NONE")
set(has_cpu true)
endif()

find_package(Python3 COMPONENTS Interpreter)

# Very sad CMake older then 3.2 does not support continue() command.
file(GLOB all_drivers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inputs inputs/*)

if(NOT ONEDNN_BUILD_GRAPH)
list(REMOVE_ITEM all_drivers "graph")
endif()

set(RANDOM_CI_DRIVERS "matmul")
foreach(driver ${all_drivers})
set(driver_dir ${CMAKE_CURRENT_SOURCE_DIR}/inputs/${driver})
# Collect input files in groups
Expand All @@ -161,6 +164,17 @@ foreach(driver ${all_drivers})
inputs/brgemm/test_brgemm_all inputs/conv/test_conv_all
inputs/graph/test_graph_all inputs/rnn/test_lstm_all)

if(PYTHON3_FOUND AND ${driver} IN_LIST RANDOM_CI_DRIVERS)
set(SYNTHDNN "${CMAKE_CURRENT_SOURCE_DIR}/../synthdnn/synthdnn.py")
set(RANDOM_CI "${CMAKE_CURRENT_BINARY_DIR}/inputs/${driver}/test_${driver}_random_ci")
execute_process(COMMAND ${PYTHON3_EXECUTABLE} ${SYNTHDNN} ${driver} -s2000 -b ${RANDOM_CI} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE OUT)
if(${RET})
message(Warn "Generation of ${RANDOM_CI} exited with error code ${RET}")
else()
set(test_files_ci "${test_files_ci};test_${driver}_random_ci")
endif()
endif()

if(DNNL_TEST_SET_COVERAGE EQUAL DNNL_TEST_SET_SMOKE)
if(has_gpu)
register_all_tests(gpu "${driver}" "${test_files_smoke}")
Expand Down

0 comments on commit 421274e

Please sign in to comment.