Skip to content

Commit 09949b0

Browse files
Add check by symbol instead of HIP version
1 parent 1ecf7ec commit 09949b0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cmake/onnxruntime_providers_migraphx.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@
5959
target_compile_definitions(onnxruntime_providers_migraphx PRIVATE HAVE_MIGRAPHX_API_ONNX_OPTIONS_SET_EXTERNAL_DATA_PATH=1)
6060
endif()
6161

62+
check_symbol_exists(migraphx_get_onnx_operators_size
63+
"migraphx/migraphx.h" HAVE_MIGRAPHX_API_GET_ONNX_OPERATORS)
64+
65+
if(HAVE_MIGRAPHX_API_GET_ONNX_OPERATORS)
66+
target_compile_definitions(onnxruntime_providers_migraphx PRIVATE HAVE_MIGRAPHX_API_GET_ONNX_OPERATORS=1)
67+
endif()
68+
69+
70+
6271
if (onnxruntime_ENABLE_TRAINING_OPS)
6372
onnxruntime_add_include_to_target(onnxruntime_providers_migraphx onnxruntime_training)
6473
target_link_libraries(onnxruntime_providers_migraphx PRIVATE onnxruntime_training)

onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ GetUnsupportedNodeIndices(const GraphViewer& graph_viewer,
874874
/*out*/ std::unordered_set<std::string>& mgx_required_initializers,
875875
const logging::Logger& logger) {
876876

877-
#if (HIP_VERSION_MAJOR == 7 && HIP_VERSION_MINOR >= 2) || (HIP_VERSION_MAJOR > 7)
877+
#ifdef HAVE_MIGRAPHX_API_GET_ONNX_OPERATORS
878878
// In ROCm 7.2 onward we'll query the MIGraphX API to get the supported op list
879879
static std::set<std::string> mgx_supported_ops{};
880880
auto list = migraphx::get_onnx_operators();

0 commit comments

Comments
 (0)