diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.h b/onnxruntime/core/providers/acl/nn/batch_norm.h index 0bf7a10ba7..35878f3d39 100755 --- a/onnxruntime/core/providers/acl/nn/batch_norm.h +++ b/onnxruntime/core/providers/acl/nn/batch_norm.h @@ -38,7 +38,7 @@ class BatchNorm final : public OpKernel { ORT_ENFORCE(st.IsOK(), st.ErrorMessage()); provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~BatchNorm() { diff --git a/onnxruntime/core/providers/acl/nn/conv.h b/onnxruntime/core/providers/acl/nn/conv.h index 7d4fc2b170..e857abe629 100644 --- a/onnxruntime/core/providers/acl/nn/conv.h +++ b/onnxruntime/core/providers/acl/nn/conv.h @@ -40,7 +40,7 @@ class Conv : public onnxruntime::Conv { public: explicit Conv(const OpKernelInfo& info) : onnxruntime::Conv(info), conv_attrs_(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Conv() { diff --git a/onnxruntime/core/providers/acl/nn/pool.h b/onnxruntime/core/providers/acl/nn/pool.h index 5383610286..94761fce23 100644 --- a/onnxruntime/core/providers/acl/nn/pool.h +++ b/onnxruntime/core/providers/acl/nn/pool.h @@ -35,7 +35,7 @@ class Pool final : public onnxruntime::Pool { public: explicit Pool(const OpKernelInfo& info) : onnxruntime::Pool(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Pool() { @@ -54,7 +54,7 @@ class MaxPoolV8 final : public onnxruntime::MaxPoolV8 { public: explicit MaxPoolV8(const OpKernelInfo& info) : onnxruntime::MaxPoolV8(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~MaxPoolV8() { @@ -68,4 +68,4 @@ class MaxPoolV8 final : public onnxruntime::MaxPoolV8 { ACLExecutionProvider* provider_; }; } // namespace acl -} \ No newline at end of file +} diff --git a/onnxruntime/core/providers/acl/tensor/concat.h b/onnxruntime/core/providers/acl/tensor/concat.h index c0b1be5238..82d105e191 100644 --- a/onnxruntime/core/providers/acl/tensor/concat.h +++ b/onnxruntime/core/providers/acl/tensor/concat.h @@ -29,7 +29,7 @@ class Concat : public onnxruntime::Concat { explicit Concat(const OpKernelInfo& info) : onnxruntime::Concat(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Concat() {} diff --git a/onnxruntime/core/providers/armnn/activation/activations.h b/onnxruntime/core/providers/armnn/activation/activations.h index ff191cd890..7d0f0dc617 100644 --- a/onnxruntime/core/providers/armnn/activation/activations.h +++ b/onnxruntime/core/providers/armnn/activation/activations.h @@ -24,7 +24,7 @@ class Relu : public OpKernel { public: explicit Relu(const OpKernelInfo& info) : OpKernel(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Relu() { diff --git a/onnxruntime/core/providers/armnn/nn/conv.h b/onnxruntime/core/providers/armnn/nn/conv.h index c6a463bdc8..3db77c9c25 100644 --- a/onnxruntime/core/providers/armnn/nn/conv.h +++ b/onnxruntime/core/providers/armnn/nn/conv.h @@ -22,7 +22,7 @@ class Conv : public onnxruntime::Conv { public: explicit Conv(const OpKernelInfo& info) : onnxruntime::Conv(info), conv_attrs_(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Conv() { diff --git a/onnxruntime/core/providers/armnn/nn/pool.h b/onnxruntime/core/providers/armnn/nn/pool.h index 264abba894..c621cf7749 100644 --- a/onnxruntime/core/providers/armnn/nn/pool.h +++ b/onnxruntime/core/providers/armnn/nn/pool.h @@ -22,7 +22,7 @@ class Pool final : public onnxruntime::Pool { public: explicit Pool(const OpKernelInfo& info) : onnxruntime::Pool(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~Pool() { @@ -49,7 +49,7 @@ class MaxPoolV8 final : public onnxruntime::MaxPoolV8 { public: explicit MaxPoolV8(const OpKernelInfo& info) : onnxruntime::MaxPoolV8(info) { provider_ = (const_cast( - dynamic_cast(info.GetExecutionProvider()))); + static_cast(info.GetExecutionProvider()))); } ~MaxPoolV8() { diff --git a/onnxruntime/core/providers/cuda/cuda_allocator.cc b/onnxruntime/core/providers/cuda/cuda_allocator.cc index f7af8c122d..d8eacc6ef1 100644 --- a/onnxruntime/core/providers/cuda/cuda_allocator.cc +++ b/onnxruntime/core/providers/cuda/cuda_allocator.cc @@ -13,7 +13,7 @@ namespace onnxruntime { static const GPUDataTransfer* GetGPUDataTransfer(const SessionState* session_state) { OrtDevice gpu_device(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, 0); OrtDevice cpu_device; - return dynamic_cast(session_state->GetDataTransferMgr().GetDataTransfer(gpu_device, cpu_device)); + return static_cast(session_state->GetDataTransferMgr().GetDataTransfer(gpu_device, cpu_device)); } void CUDAAllocator::CheckDevice(bool throw_when_fail) const { diff --git a/onnxruntime/core/providers/cuda/math/einsum.h b/onnxruntime/core/providers/cuda/math/einsum.h index adf74f84d3..ca7563d367 100644 --- a/onnxruntime/core/providers/cuda/math/einsum.h +++ b/onnxruntime/core/providers/cuda/math/einsum.h @@ -19,7 +19,7 @@ class Einsum final : public onnxruntime::Einsum { // We need to cast away the const as PerThreadCublasHandle() is currently a non-const method // TODO: Clean up the CUDAExecutionProvider interface to avoid this cuda_ep_ = const_cast( - dynamic_cast(info.GetExecutionProvider())); + static_cast(info.GetExecutionProvider())); } Status Compute(OpKernelContext* context) const override; diff --git a/onnxruntime/core/providers/cuda/reduction/reduction_ops.h b/onnxruntime/core/providers/cuda/reduction/reduction_ops.h index 239f3bf438..c0e2b10bec 100644 --- a/onnxruntime/core/providers/cuda/reduction/reduction_ops.h +++ b/onnxruntime/core/providers/cuda/reduction/reduction_ops.h @@ -51,7 +51,7 @@ class ReduceKernel : public CudaKernel, public ReduceKernelBase(dynamic_cast(info.GetExecutionProvider())); + cuda_ep_ = const_cast(static_cast(info.GetExecutionProvider())); } // Only Max Min need to set ReduceTensorIndices CUDNN_REDUCE_TENSOR_FLATTENED_INDICES as per cudnn library manual