Skip to content

Commit 56724ab

Browse files
committed
[NvTensorRTRTX EP]: Add missing override specifiers to suppress warnings
Compilation on Clang toolchains fails due to this warning (among others) since ONNX runtime compiles with -Werror by default. ``` /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_execution_provider.h:309:7: error: 'GetDeviceId' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] 309 | int GetDeviceId() const { return device_id_; } | ^ /home/stephan/projects/onnxruntime-winai/include/onnxruntime/core/framework/execution_provider.h:183:15: note: overridden virtual function is here 183 | virtual int GetDeviceId() const { return default_device_.Id(); } | ^ In file included from /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc:18: /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_execution_provider.h:310:10: error: 'Sync' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] 310 | Status Sync() const; | ^ /home/stephan/projects/onnxruntime-winai/include/onnxruntime/core/framework/execution_provider.h:231:26: note: overridden virtual function is here 231 | virtual common::Status Sync() const { return Status::OK(); } | ^ /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc:63:39: error: 'CreateProvider' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] 63 | std::unique_ptr<IExecutionProvider> CreateProvider(const OrtSessionOptions& session_options, | ^ /home/stephan/projects/onnxruntime-winai/include/onnxruntime/core/providers/providers.h:29:47: note: overridden virtual function is here 29 | virtual std::unique_ptr<IExecutionProvider> CreateProvider(const OrtSessionOptions& session_options, | ^ /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc:112:46: error: 'CreateExecutionProviderFactory' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] 112 | std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* param) { | ^ /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/shared_library/provider_host_api.h:19:54: note: overridden virtual function is here 19 | virtual std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* /*provider_options*/) { return nullptr; /home/stephan/projects/onnxruntime-winai/onnxruntime/core/providers/nv_tensorrt_rtx/nv_execution_provider.h:309:7: error: 'GetDeviceId' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] 309 | int GetDeviceId() const { return device_id_; } | ^ /home/stephan/projects/onnxruntime-winai/include/onnxruntime/core/framework/execution_provider.h:183:15: note: overridden virtual function is here 183 | virtual int GetDeviceId() const { return default_device_.Id(); } ```
1 parent a3749f1 commit 56724ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

onnxruntime/core/providers/nv_tensorrt_rtx/nv_execution_provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ class NvExecutionProvider : public IExecutionProvider {
306306
const GraphOptimizerRegistry& graph_optimizer_registry,
307307
IResourceAccountant* /* resource_accountant */) const override;
308308

309-
int GetDeviceId() const { return device_id_; }
310-
Status Sync() const;
309+
int GetDeviceId() const override { return device_id_; }
310+
Status Sync() const override;
311311

312312
common::Status Compile(const std::vector<FusedNodeAndGraph>& fused_nodes_and_graphs,
313313
std::vector<NodeComputeInfo>& node_compute_funcs) override;

onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct NvProviderFactory : IExecutionProviderFactory {
6262

6363
std::unique_ptr<IExecutionProvider> CreateProvider() override;
6464
std::unique_ptr<IExecutionProvider> CreateProvider(const OrtSessionOptions& session_options,
65-
const OrtLogger& session_logger);
65+
const OrtLogger& session_logger) override;
6666

6767
private:
6868
NvExecutionProviderInfo info_;
@@ -110,7 +110,7 @@ struct Nv_Provider : Provider {
110110
return std::make_shared<NvProviderFactory>(info);
111111
}
112112

113-
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* param) {
113+
std::shared_ptr<IExecutionProviderFactory> CreateExecutionProviderFactory(const void* param) override {
114114
if (param == nullptr) {
115115
LOGS_DEFAULT(ERROR) << "[NvTensorRTRTX EP] Passed NULL options to CreateExecutionProviderFactory()";
116116
return nullptr;

0 commit comments

Comments
 (0)