Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ cmake_dependent_option(onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS_ENABLE_DUMP_TO_SQLD

# When loading a delay loaded DLL, Windows searches the main EXE's folder first.
cmake_dependent_option(onnxruntime_ENABLE_DELAY_LOADING_WIN_DLLS "Delay load some of the dependent DLls that are part of the OS" ON "WIN32;NOT GDK_PLATFORM" OFF)
option(onnxruntime_USE_DML "Build with DirectML support" OFF)
option(onnxruntime_USE_AMDGPU "Build with AMDGPU support" OFF)
option(onnxruntime_USE_MIGRAPHX "Build with AMDGPU support (deprecated)" OFF)
option(onnxruntime_USE_MIGRAPHX "Build with AMDMIGraphX support" OFF)
option(onnxruntime_USE_WINML "Build with WinML support" OFF)
option(onnxruntime_USE_ACL "Build with ACL support" OFF)
Expand Down Expand Up @@ -254,6 +255,7 @@ option(onnxruntime_USE_CUDA_INTERFACE "Build ONNXRuntime shared lib which is com
option(onnxruntime_USE_OPENVINO_INTERFACE "Build ONNXRuntime shared lib which is compatible with OpenVINO EP interface" OFF)
option(onnxruntime_USE_VITISAI_INTERFACE "Build ONNXRuntime shared lib which is compatible with Vitis-AI EP interface" OFF)
option(onnxruntime_USE_QNN_INTERFACE "Build ONNXRuntime shared lib which is compatible with QNN EP interface" OFF)
option(onnxruntime_USE_AMDGPU_INTERFACE "Build ONNXRuntime shared lib which is compatible with AMDGPU EP interface" OFF)


if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 11.1)
Expand Down Expand Up @@ -963,11 +965,11 @@ if (onnxruntime_USE_JSEP)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES js)
endif()
if (onnxruntime_USE_QNN OR onnxruntime_USE_QNN_INTERFACE)

if(onnxruntime_USE_QNN)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_QNN=1)
else()
list(APPEND ORT_EXTRA_INTERFACE_FLAGS -DUSE_QNN=1)
list(APPEND ORT_EXTRA_INTERFACE_FLAGS -DUSE_QNN=1)
endif()

list(APPEND ONNXRUNTIME_PROVIDER_NAMES qnn)
Expand Down Expand Up @@ -1029,8 +1031,15 @@ if (onnxruntime_USE_DML)
endif()
endif()
if (onnxruntime_USE_MIGRAPHX)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_MIGRAPHX=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES migraphx)
message(WARNING "onnxruntime_USE_MIGRAPHX option is deprecated. Please use onnxruntime_USE_AMDGPU instead.")
set(onnxruntime_USE_AMDGPU ON CACHE BOOL "" FORCE)
endif()
if (onnxruntime_USE_AMDGPU)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_AMDGPU=1)
list(APPEND ONNXRUNTIME_PROVIDER_NAMES amdgpu)
endif()
if (onnxruntime_USE_AMDGPU_INTERFACE AND (NOT onnxruntime_USE_AMDGPU))
list(APPEND ORT_INTERFACE_FLAGS -DUSE_AMDGPU=1)
endif()
if (onnxruntime_USE_ARMNN)
list(APPEND ORT_PROVIDER_FLAGS -DUSE_ARMNN=1)
Expand Down Expand Up @@ -1603,8 +1612,8 @@ if (onnxruntime_USE_CUDA)
endif()
endif()

if (onnxruntime_USE_MIGRAPHX)
set(AMD_MIGRAPHX_HOME ${onnxruntime_MIGRAPHX_HOME})
if (onnxruntime_USE_AMDGPU)
set(AMDGPU_MIGRAPHX_HOME ${onnxruntime_MIGRAPHX_HOME})
endif()

if (onnxruntime_ENABLE_MICROSOFT_INTERNAL)
Expand Down Expand Up @@ -1654,7 +1663,7 @@ if (UNIX OR onnxruntime_USE_NCCL)
if (onnxruntime_USE_NCCL)
if (onnxruntime_USE_CUDA)
set(NCCL_LIBNAME "nccl")
elseif (onnxruntime_USE_ROCM OR onnxruntime_USE_MIGRAPHX)
elseif (onnxruntime_USE_ROCM OR onnxruntime_USE_AMDGPU)
set(NCCL_LIBNAME "rccl")
endif()
find_path(NCCL_INCLUDE_DIR
Expand Down
4 changes: 2 additions & 2 deletions cmake/onnxruntime_csharp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if (onnxruntime_USE_DML)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DML;")
endif()

if (onnxruntime_USE_MIGRAPHX)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_MIGRAPHX;")
if (onnxruntime_USE_AMDGPU)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_AMDGPU;")
endif()

if (onnxruntime_USE_NNAPI_BUILTIN)
Expand Down
8 changes: 4 additions & 4 deletions cmake/onnxruntime_providers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ endif()
if(onnxruntime_USE_DML)
set(PROVIDERS_DML onnxruntime_providers_dml)
endif()
if(onnxruntime_USE_MIGRAPHX)
set(PROVIDERS_MIGRAPHX onnxruntime_providers_migraphx)
if(onnxruntime_USE_AMDGPU)
set(PROVIDERS_AMDGPU onnxruntime_providers_amdgpu)
endif()
if(onnxruntime_USE_WINML)
set(PROVIDERS_WINML onnxruntime_providers_winml)
Expand Down Expand Up @@ -172,8 +172,8 @@ if (onnxruntime_USE_DML)
include(onnxruntime_providers_dml.cmake)
endif()

if (onnxruntime_USE_MIGRAPHX)
include(onnxruntime_providers_migraphx.cmake)
if (onnxruntime_USE_AMDGPU)
include(onnxruntime_providers_amdgpu.cmake)
endif()

if (onnxruntime_USE_ACL)
Expand Down
83 changes: 83 additions & 0 deletions cmake/onnxruntime_providers_amdgpu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

add_definitions(-DUSE_AMDGPU=1)
set(BUILD_LIBRARY_ONLY 1)
include_directories(${protobuf_SOURCE_DIR} ${eigen_SOURCE_DIR} ${onnx_SOURCE_DIR})
set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
if (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter -Wno-missing-field-initializers")
endif()

# Add search paths for default rocm installation
list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hcc /opt/rocm/hip /opt/rocm $ENV{HIP_PATH})

if(POLICY CMP0144)
# Suppress the warning about the small capitals of the package name
cmake_policy(SET CMP0144 NEW)
endif()

if(WIN32 AND NOT HIP_PLATFORM)
set(HIP_PLATFORM "amd")
endif()

find_package(hip REQUIRED)
find_package(migraphx REQUIRED PATHS ${AMDGPU_MIGRAPHX_HOME})

file(GLOB_RECURSE onnxruntime_providers_amdgpu_cc_srcs CONFIGURE_DEPENDS
"${ONNXRUNTIME_ROOT}/core/providers/amdgpu/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/amdgpu/*.cc"
"${ONNXRUNTIME_ROOT}/core/providers/shared_library/*.h"
"${ONNXRUNTIME_ROOT}/core/providers/shared_library/*.cc"
)
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_amdgpu_cc_srcs})
onnxruntime_add_shared_library(onnxruntime_providers_amdgpu ${onnxruntime_providers_amdgpu_cc_srcs})
onnxruntime_add_include_to_target(onnxruntime_providers_amdgpu onnxruntime_common onnx flatbuffers::flatbuffers Boost::mp11 safeint_interface)
add_dependencies(onnxruntime_providers_amdgpu ${onnxruntime_EXTERNAL_DEPENDENCIES})

target_link_libraries(onnxruntime_providers_amdgpu PRIVATE migraphx::c hip::host onnx flatbuffers::flatbuffers Boost::mp11 safeint_interface)
if(onnxruntime_USE_AMD_NITRIS_ADAPTER)
target_link_libraries(onnxruntime_providers_amdgpu PRIVATE onnxruntime_providers_amd_nitris_adapter)
set_target_properties(onnxruntime_providers_amdgpu PROPERTIES OUTPUT_NAME amd_gpu_backend)
else()
target_link_libraries(onnxruntime_providers_amdgpu PRIVATE ${ONNXRUNTIME_PROVIDERS_SHARED})
endif()
target_include_directories(onnxruntime_providers_amdgpu PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/amdgpu/onnxruntime)
set_target_properties(onnxruntime_providers_amdgpu PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(onnxruntime_providers_amdgpu PROPERTIES FOLDER "ONNXRuntime")
target_compile_definitions(onnxruntime_providers_amdgpu PRIVATE ONNXIFI_BUILD_LIBRARY=1 ONNX_ML=1 ONNX_NAMESPACE=onnx)
if(MSVC)
set_property(TARGET onnxruntime_providers_amdgpu APPEND_STRING PROPERTY LINK_FLAGS /DEF:${ONNXRUNTIME_ROOT}/core/providers/amdgpu/symbols.def)
target_link_libraries(onnxruntime_providers_amdgpu PRIVATE ws2_32)
else()
target_compile_options(onnxruntime_providers_amdgpu PRIVATE -Wno-error=sign-compare)
set_property(TARGET onnxruntime_providers_amdgpu APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
endif()
if(UNIX)
set_property(TARGET onnxruntime_providers_amdgpu APPEND_STRING PROPERTY LINK_FLAGS "-Xlinker --version-script=${ONNXRUNTIME_ROOT}/core/providers/amdgpu/version_script.lds -Xlinker --gc-sections")
target_link_libraries(onnxruntime_providers_amdgpu PRIVATE stdc++fs)
endif()

set(CMAKE_REQUIRED_LIBRARIES migraphx::c)

check_symbol_exists(migraphx_onnx_options_set_external_data_path
"migraphx/migraphx.h" HAVE_MIGRAPHX_API_ONNX_OPTIONS_SET_EXTERNAL_DATA_PATH)

if(HAVE_MIGRAPHX_API_ONNX_OPTIONS_SET_EXTERNAL_DATA_PATH)
target_compile_definitions(onnxruntime_providers_amdgpu PRIVATE HAVE_MIGRAPHX_API_ONNX_OPTIONS_SET_EXTERNAL_DATA_PATH=1)
endif()

if (onnxruntime_ENABLE_TRAINING_OPS)
onnxruntime_add_include_to_target(onnxruntime_providers_amdgpu onnxruntime_training)
target_link_libraries(onnxruntime_providers_amdgpu PRIVATE onnxruntime_training)
if (onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
onnxruntime_add_include_to_target(onnxruntime_providers_amdgpu Python::Module)
endif()
endif()

install(TARGETS onnxruntime_providers_amdgpu
EXPORT onnxruntime_providers_amdgpuTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR})
3 changes: 3 additions & 0 deletions cmake/onnxruntime_providers_migraphx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
onnxruntime_add_shared_library_module(onnxruntime_providers_migraphx ${onnxruntime_providers_migraphx_cc_srcs})
onnxruntime_add_include_to_target(onnxruntime_providers_migraphx onnxruntime_common onnx flatbuffers::flatbuffers Boost::mp11 safeint_interface)
add_dependencies(onnxruntime_providers_migraphx onnxruntime_providers_shared ${onnxruntime_EXTERNAL_DEPENDENCIES})
if(WIN32)
set_target_properties(onnxruntime_providers_migraphx PROPERTIES OUTPUT_NAME onnxruntime_providers_amd_gpu)
endif()
target_link_libraries(onnxruntime_providers_migraphx PRIVATE ${migraphx_libs} ${ONNXRUNTIME_PROVIDERS_SHARED} onnx flatbuffers::flatbuffers Boost::mp11 safeint_interface)
target_include_directories(onnxruntime_providers_migraphx PRIVATE ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/amdgpu/onnxruntime)
set_target_properties(onnxruntime_providers_migraphx PROPERTIES LINKER_LANGUAGE CXX)
Expand Down
4 changes: 2 additions & 2 deletions cmake/onnxruntime_python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -928,11 +928,11 @@ if (onnxruntime_USE_TENSORRT)
)
endif()

if (onnxruntime_USE_MIGRAPHX)
if (onnxruntime_USE_AMDGPU)
add_custom_command(
TARGET onnxruntime_pybind11_state POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_FILE:onnxruntime_providers_migraphx>
$<TARGET_FILE:onnxruntime_providers_amdgpu>
$<TARGET_FILE:onnxruntime_providers_shared>
$<TARGET_FILE_DIR:${build_output_target}>/onnxruntime/capi/
)
Expand Down
16 changes: 8 additions & 8 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,9 @@ if(onnxruntime_USE_DNNL)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_dnnl)
endif()

if(onnxruntime_USE_MIGRAPHX)
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_migraphx)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_migraphx onnxruntime_providers_shared)
if(onnxruntime_USE_AMDGPU)
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_amd_gpu)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_amdgpu onnxruntime_providers_shared)
endif()

if(onnxruntime_USE_ROCM)
Expand All @@ -625,7 +625,7 @@ if(onnxruntime_USE_ARMNN)
endif()

set(ONNXRUNTIME_TEST_STATIC_PROVIDER_LIBS
# CUDA, ROCM, TENSORRT, MIGRAPHX, DNNL, and OpenVINO are dynamically loaded at runtime.
# CUDA, ROCM, TENSORRT, AMDGPU, DNNL, and OpenVINO are dynamically loaded at runtime.
# QNN EP can be built as either a dynamic and static libs.
${PROVIDERS_NNAPI}
${PROVIDERS_VSINPU}
Expand Down Expand Up @@ -679,11 +679,11 @@ if(onnxruntime_USE_TENSORRT)
list(APPEND onnxruntime_test_providers_libs ${TENSORRT_LIBRARY_INFER})
endif()

if(onnxruntime_USE_MIGRAPHX)
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/migraphx/*)
if(onnxruntime_USE_AMDGPU)
list(APPEND onnxruntime_test_framework_src_patterns ${TEST_SRC_DIR}/providers/amdgpu/*)
list(APPEND onnxruntime_test_framework_src_patterns "${ONNXRUNTIME_ROOT}/core/providers/migraphx/migraphx_execution_provider_utils.h")
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_migraphx)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_migraphx onnxruntime_providers_shared)
list(APPEND onnxruntime_test_framework_libs onnxruntime_providers_amdgpu)
list(APPEND onnxruntime_test_providers_dependencies onnxruntime_providers_amdgpu onnxruntime_providers_shared)
endif()

if(onnxruntime_USE_NNAPI_BUILTIN)
Expand Down
5 changes: 5 additions & 0 deletions csharp/OnnxRuntime.CSharp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ CMake creates a target to this project
Properties="NuSpecName=NativeGpuLinuxNuget.nuspec;OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu.Linux"
Targets ="CreateNativePackage" />
</Target>
<Target Name="CreateAllAmdGpuPackages" AfterTargets="CreatePackage" Condition="'$(OrtPackageId)' == 'Microsoft.ML.OnnxRuntime.AmdGpu'">
<MSBuild Projects ="$(MSBuildProjectFullPath)"
Properties="NuSpecName=NativeAmdGpuWinNuget.nuspec;OrtPackageId=Microsoft.ML.OnnxRuntime.AmdGpu.Windows"
Targets ="CreateNativePackage" />
</Target>

<ItemGroup>
<LicenseFile Include="$(OnnxRuntimeSourceDirectory)\LICENSE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ IntPtr[] outputValues /* An array of output value pointers. Array must be alloca
public static extern IntPtr /*(OrtStatus*)*/ OrtSessionOptionsAppendExecutionProvider_Tensorrt(IntPtr /*(OrtSessionOptions*)*/ options, int device_id);

[DllImport(NativeLib.DllName, CharSet = CharSet.Ansi)]
public static extern IntPtr /*(OrtStatus*)*/ OrtSessionOptionsAppendExecutionProvider_MIGraphX(IntPtr /*(OrtSessionOptions*)*/ options, int device_id);
public static extern IntPtr /*(OrtStatus*)*/ OrtSessionOptionsAppendExecutionProvider_AMDGPU(IntPtr /*(OrtSessionOptions*)*/ options, int device_id);
#endif
/// <summary>
/// Append a TensorRT EP instance (configured based on given provider options) to the native OrtSessionOptions instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public void AppendExecutionProvider_MIGraphX(int deviceId = 0)
#if __MOBILE__
throw new NotSupportedException($"The MIGraphX Execution Provider is not supported in this build");
#else
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_MIGraphX(handle, deviceId));
NativeApiStatus.VerifySuccess(NativeMethods.OrtSessionOptionsAppendExecutionProvider_AMDGPU(handle, deviceId));
#endif
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void TestSessionOptions()
opt.AppendExecutionProvider_Dnnl(0);
#endif

#if USE_MIGRAPHX
#if USE_AMDGPU
opt.AppendExecutionProvider_MIGraphX(0);
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1582,8 +1582,8 @@ private void VerifyNativeMethodsExist()
#if USE_TENSORRT
,"OrtSessionOptionsAppendExecutionProvider_Tensorrt"
#endif
#if USE_MIGRAPHX
,"OrtSessionOptionsAppendExecutionProvider_MIGraphX"
#if USE_AMDGPU
,"OrtSessionOptionsAppendExecutionProvider_AMDGPU"
#endif
#if USE_NNAPI
,"OrtSessionOptionsAppendExecutionProvider_Nnapi"
Expand Down
1 change: 1 addition & 0 deletions include/onnxruntime/core/graph/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ constexpr const char* kQnnExecutionProvider = "QNNExecutionProvider";
constexpr const char* kRknpuExecutionProvider = "RknpuExecutionProvider";
constexpr const char* kDmlExecutionProvider = "DmlExecutionProvider";
constexpr const char* kMIGraphXExecutionProvider = "MIGraphXExecutionProvider";
constexpr const char* kAMDGPUExecutionProvider = "AMDGPUExecutionProvider";
constexpr const char* kAclExecutionProvider = "ACLExecutionProvider";
constexpr const char* kArmNNExecutionProvider = "ArmNNExecutionProvider";
constexpr const char* kRocmExecutionProvider = "ROCMExecutionProvider";
Expand Down
50 changes: 28 additions & 22 deletions include/onnxruntime/core/session/onnxruntime_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,22 +636,28 @@ typedef struct OrtTensorRTProviderOptions {
// For non-string field, need to create a new separate api to handle it.
} OrtTensorRTProviderOptions;

/** \brief MIGraphX Provider Options
/** \brief AMDGPU Provider Options
*
* \see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX
* \see OrtApi::SessionOptionsAppendExecutionProvider_AMDGPU
*/
typedef struct OrtMIGraphXProviderOptions {
typedef struct OrtAMDGPUProviderOptions {
int device_id; // hip device id.
int migraphx_fp16_enable; // MIGraphX FP16 precision. Default 0 = false, nonzero = true
int migraphx_int8_enable; // MIGraphX INT8 precision. Default 0 = false, nonzero = true
int migraphx_use_native_calibration_table; // MIGraphx INT8 cal table. Default 0 = false, noznero = true
const char* migraphx_int8_calibration_table_name; // MIGraphx INT8 calibration table name
int migraphx_save_compiled_model; // migraphx save compiled model. Default 0 = false, noznero = true
const char* migraphx_save_model_path; // migraphx model path name
int migraphx_load_compiled_model; // migraphx int8 cal table. Default 0 = false, noznero = true
const char* migraphx_load_model_path; // migraphx model path name
bool migraphx_exhaustive_tune; // migraphx tuned compile Default = false
} OrtMIGraphXProviderOptions;
int amdgpu_fp16_enable; // MIGraphX FP16 precision. Default 0 = false, nonzero = true
int amdgpu_fp8_enable; // MIGraphX FP8 precision. Default 0 = false, nonzero = true
int amdgpu_int8_enable; // MIGraphX INT8 precision. Default 0 = false, nonzero = true
int amdgpu_use_native_calibration_table; // MIGraphx INT8 cal table. Default 0 = false, noznero = true
const char* amdgpu_int8_calibration_table_name; // MIGraphx INT8 calibration table name
const char* amdgpu_cache_dir; // MIGraphX model cache directory
int amdgpu_exhaustive_tune; // amdgpu tuned compile Default = false
size_t amdgpu_mem_limit;
int amdgpu_arena_extend_strategy;

} OrtAMDGPUProviderOptions;

/** \brief MIGraphX Provider Options (legacy support)
*/
#define OrtMIGraphXProviderOptions OrtAMDGPUProviderOptions
#define SessionOptionsAppendExecutionProvider_MIGraphX SessionOptionsAppendExecutionProvider_AMDGPU

/** \brief OpenVINO Provider Options
* \brief This Struct is frozen since ORT 1.13.0. Its maintained part of Legacy API for compatibility.
Expand Down Expand Up @@ -3534,19 +3540,19 @@ struct OrtApi {

/// @}

/** \brief Append MIGraphX provider to session options
/** \brief Append AMDGPU provider to session options (deprecated)
*
* If MIGraphX is not available (due to a non MIGraphX enabled build, or if MIGraphX is not installed on the system), this function will return failure.
* If MIGraphX is not available (due to a non AMDGPU enabled build, or if AMDGPU is not installed on the system), this function will return failure.
*
* \param[in] options
* \param[in] migraphx_options
* \param[in] amdgpu_options
*
* \snippet{doc} snippets.dox OrtStatus Return Value
*
* \since Version 1.11.
*/
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_MIGraphX,
_In_ OrtSessionOptions* options, _In_ const OrtMIGraphXProviderOptions* migraphx_options);
ORT_API2_STATUS(SessionOptionsAppendExecutionProvider_AMDGPU,
_In_ OrtSessionOptions* options, _In_ const OrtAMDGPUProviderOptions* amdgpu_options);

/** \brief Replace initialized Tensors with external data with the data provided in initializers.
*
Expand Down Expand Up @@ -6066,14 +6072,14 @@ ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_CUDA, _In_ OrtSessionOpt
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_ROCM, _In_ OrtSessionOptions* options, int device_id);

/*
* This is the old way to add the MIGraphX provider to the session, please use
* SessionOptionsAppendExecutionProvider_MIGraphX above to access the latest functionality
* This is the old way to add the AMDGPU provider to the session, please use
* SessionOptionsAppendExecutionProvider_AMDGPU above to access the latest functionality
* This function always exists, but will only succeed if Onnxruntime was built with
* HIP support and the MIGraphX provider shared library exists
* HIP support and the AMDGPU provider shared library exists
*
* \param device_id HIP device id, starts from zero.
*/
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_MIGraphX, _In_ OrtSessionOptions* options, int device_id);
ORT_API_STATUS(OrtSessionOptionsAppendExecutionProvider_AMDGPU, _In_ OrtSessionOptions* options, int device_id);

/*
* This is the old way to add the oneDNN provider to the session, please use
Expand Down
Loading