Fix C26436 prefast errors (#13774)
Fixes errors 9196, 9214, 9255, and 9314. Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
This commit is contained in:
Родитель
4128e44b4f
Коммит
e0dcbc3832
|
@ -133,6 +133,8 @@ public:
|
|||
m_isClosed = true;
|
||||
}
|
||||
|
||||
virtual ~Closable() {}
|
||||
|
||||
protected:
|
||||
void VerifyNotClosed() const
|
||||
{
|
||||
|
|
|
@ -299,12 +299,14 @@ struct IKernelInformationAdapter
|
|||
virtual MLOperatorTensor GetConstantInputTensor(uint32_t inputIndex) const = 0;
|
||||
virtual bool HasAttribute(_In_z_ MLConstStringParam name, MLOperatorAttributeType type) const noexcept = 0;
|
||||
virtual MLOperatorAttributes const& GetAttributes() const noexcept = 0;
|
||||
virtual ~IKernelInformationAdapter() {}
|
||||
};
|
||||
|
||||
struct IShapeInformationAdapter
|
||||
{
|
||||
virtual uint32_t GetInputTensorDimensionCount(uint32_t inputIndex) const = 0;
|
||||
virtual std::vector<uint32_t> GetInputTensorShape(uint32_t inputIndex) const = 0;
|
||||
virtual ~IShapeInformationAdapter() {}
|
||||
};
|
||||
|
||||
// To avoid duplicating dozens of templated functions that vary only on the source of the kernel
|
||||
|
@ -323,6 +325,7 @@ struct KernelInformationAdapter : IKernelInformationAdapter
|
|||
virtual MLOperatorTensor GetConstantInputTensor(uint32_t inputIndex) const { return m_informationSource.GetConstantInputTensor(inputIndex); }
|
||||
virtual bool HasAttribute(_In_z_ MLConstStringParam name, MLOperatorAttributeType type) const noexcept { return m_informationSource.HasAttribute(name, type); }
|
||||
virtual MLOperatorAttributes const& GetAttributes() const noexcept { return m_informationSource; }
|
||||
virtual ~KernelInformationAdapter() {}
|
||||
|
||||
InformationSourceType& m_informationSource;
|
||||
};
|
||||
|
@ -338,6 +341,7 @@ struct ShapeInformationAdapter : IShapeInformationAdapter
|
|||
|
||||
virtual uint32_t GetInputTensorDimensionCount(uint32_t inputIndex) const { return m_informationSource.GetInputTensorDimensionCount(inputIndex); }
|
||||
virtual std::vector<uint32_t> GetInputTensorShape(uint32_t inputIndex) const { return m_informationSource.GetInputTensorShape(inputIndex); }
|
||||
virtual ~ShapeInformationAdapter() {}
|
||||
|
||||
InformationSourceType& m_informationSource;
|
||||
};
|
||||
|
|
|
@ -44,6 +44,8 @@ struct TensorResources {
|
|||
WINML_CATCH_ALL_COM
|
||||
}
|
||||
|
||||
virtual ~TensorResources() {}
|
||||
|
||||
// Theses are access directly by TensorMemoryBufferReference<T> and TensorBase
|
||||
std::shared_ptr<_winml::Tensor<T>> cpu_resource_;
|
||||
winrt::com_ptr<ID3D12Resource> gpu_resource_;
|
||||
|
|
|
@ -64,7 +64,8 @@ class WinMLTelemetryHelper {
|
|||
bool telemetry_enabled_ = false;
|
||||
|
||||
WinMLTelemetryHelper();
|
||||
~WinMLTelemetryHelper();
|
||||
virtual ~WinMLTelemetryHelper();
|
||||
|
||||
|
||||
//
|
||||
// Register telemetry provider and check success. Will only succeed if
|
||||
|
|
Загрузка…
Ссылка в новой задаче