diff --git a/include/onnxruntime/core/session/onnxruntime_c_api.h b/include/onnxruntime/core/session/onnxruntime_c_api.h index 8f22f2f75eec4..0753726448731 100644 --- a/include/onnxruntime/core/session/onnxruntime_c_api.h +++ b/include/onnxruntime/core/session/onnxruntime_c_api.h @@ -598,11 +598,11 @@ typedef struct OrtTensorRTProviderOptions { * \see OrtApi::SessionOptionsAppendExecutionProvider_MIGraphX */ typedef struct OrtMIGraphXProviderOptions { - int device_id; // hip device id. - int migraphx_fp16_enable; // enable MIGraphX FP16 precision. Default 0 = false, nonzero = true - int migraphx_int8_enable; // 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 device_id; // hip device id. + int migraphx_fp16_enable; // enable MIGraphX FP16 precision. Default 0 = false, nonzero = true + int migraphx_int8_enable; // 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 } OrtMIGraphXProviderOptions; /** \brief OpenVINO Provider Options diff --git a/onnxruntime/core/providers/migraphx/migraphx_call.cc b/onnxruntime/core/providers/migraphx/migraphx_call.cc index cd947420b7615..1b45644130ad0 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_call.cc +++ b/onnxruntime/core/providers/migraphx/migraphx_call.cc @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "core/providers/shared_library/provider_api.h" #include #include #include #include -#include "migraphx_call.h" +#include "core/providers/shared_library/provider_api.h" #include "core/common/common.h" #include "core/common/status.h" +#include "migraphx_call.h" namespace onnxruntime { diff --git a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc index 501cebca77e3f..8e7f3ee890720 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc +++ b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc @@ -1,5 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License +#include +#include +#include +#include +#include #include "core/providers/shared_library/provider_api.h" #define ORT_API_MANUAL_INIT @@ -12,14 +17,10 @@ #include "gpu_data_transfer.h" #include "migraphx_inc.h" -#include -#include -#include -#include - // TODO: find a better way to share this #include "core/providers/rocm/rocm_stream_handle.h" + #if defined(_MSC_VER) #pragma warning(disable : 4244 4245) #elif __GNUC__ diff --git a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.h b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.h index ff2e6150821b5..fab0e3c477581 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_execution_provider.h +++ b/onnxruntime/core/providers/migraphx/migraphx_execution_provider.h @@ -3,18 +3,18 @@ #pragma once +#include +#include +#include +#include #include "core/framework/arena_extend_strategy.h" #include "core/framework/execution_provider.h" #include "core/platform/ort_mutex.h" #include "migraphx_execution_provider_info.h" - -#include -#include #include "migraphx_inc.h" // TODO: find a better way to share this // #include "core/providers/cuda/rocm_stream_handle.h" -#include -#include + namespace onnxruntime { diff --git a/onnxruntime/core/providers/migraphx/migraphx_execution_provider_utils.h b/onnxruntime/core/providers/migraphx/migraphx_execution_provider_utils.h index 1fccff645bcb3..19c817f1909a7 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_execution_provider_utils.h +++ b/onnxruntime/core/providers/migraphx/migraphx_execution_provider_utils.h @@ -152,7 +152,7 @@ bool canEvalNodeArgument(const GraphViewer& graph, return true; } -float ConvertSinglePrecisionIEEE754ToFloat(uint32_t input) { +float ConvertSinglePrecisionIEEE754ToFloat(unisgned long input) { int s = (input >> 31) & 0x01; int e = ((input & 0x7f800000) >> 23) - 127; int p = -1; @@ -224,7 +224,7 @@ bool ReadDynamicRange(const std::string file_name, size_t length = infile.tellg(); infile.seekg(0, std::ios::beg); std::unique_ptr data{new char[length]}; - infile.read((char*)data.get(), length); + infile.read(reinterpret_cast(data.get()), length); infile.close(); auto flat_table = flatbuffers::GetRoot(reinterpret_cast(data.get())); auto flat_dict = flat_table->dict(); diff --git a/onnxruntime/core/providers/migraphx/migraphx_provider_factory.cc b/onnxruntime/core/providers/migraphx/migraphx_provider_factory.cc index 4a62311e965e5..7de6c9e3164f6 100644 --- a/onnxruntime/core/providers/migraphx/migraphx_provider_factory.cc +++ b/onnxruntime/core/providers/migraphx/migraphx_provider_factory.cc @@ -1,5 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License +#include #include "core/providers/shared_library/provider_api.h" #include "core/providers/migraphx/migraphx_provider_factory.h" @@ -8,7 +9,6 @@ #include "hip_allocator.h" #include "gpu_data_transfer.h" #include "core/framework/provider_options.h" -#include #include "core/session/onnxruntime_c_api.h" @@ -48,7 +48,8 @@ struct MIGraphX_Provider : Provider { info.target_device = "gpu"; info.fp16_enable = options.migraphx_fp16_enable; info.int8_enable = options.migraphx_int8_enable; - info.int8_calibration_table_name = options.migraphx_int8_calibration_table_name == nullptr ? "" : options.migraphx_int8_calibration_table_name; + info.int8_calibration_table_name = options.migraphx_int8_calibration_table_name == nullptr ? "" : + options.migraphx_int8_calibration_table_name; info.int8_use_native_calibration_table = options.migraphx_use_native_calibration_table != 0; return std::make_shared(info); } diff --git a/onnxruntime/core/providers/migraphx/ort_trt_int8_cal_table.fbs.h b/onnxruntime/core/providers/migraphx/ort_trt_int8_cal_table.fbs.h index 09b3f67baac21..9639040f772da 100644 --- a/onnxruntime/core/providers/migraphx/ort_trt_int8_cal_table.fbs.h +++ b/onnxruntime/core/providers/migraphx/ort_trt_int8_cal_table.fbs.h @@ -3,8 +3,8 @@ #ifndef ONNXRUNTIME_CORE_PROVIDERS_MIGRAPHX_ORT_TRT_INT8_CAL_TABLE_FBS_H_ #define ONNXRUNTIME_CORE_PROVIDERS_MIGRAPHX_ORT_TRT_INT8_CAL_TABLE_FBS_H_ -#include "flatbuffers/flatbuffers.h" #include +#include "flatbuffers/flatbuffers.h" namespace CalTableFlatBuffers { diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 6d46322f4bcdb..1abe1628dd643 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -718,7 +718,10 @@ std::unique_ptr CreateExecutionProviderInstance( } } } - LOGS_DEFAULT(WARNING) << "Failed to create " << type << ". Please reference https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#requirements to ensure all dependencies are met."; + LOGS_DEFAULT(WARNING) << "Failed to create " + << type + << ". Please reference " + << "https://onnxruntime.ai/docs/execution-providers/TensorRT-ExecutionProvider.html#requirements to ensure all dependencies are met."; #endif } else if (type == kMIGraphXExecutionProvider) { #ifdef USE_MIGRAPHX @@ -820,8 +823,8 @@ std::unique_ptr CreateExecutionProviderInstance( LOGS_DEFAULT(WARNING) << "Failed to create " << type << ". Please reference " - << " https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements" - << " to ensure all dependencies are met."; + << "https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#requirements" + << "to ensure all dependencies are met."; #endif } else if (type == kRocmExecutionProvider) { #ifdef USE_ROCM