mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Various fixes to fix WindowsAI RI build. (#9877)
* WAI RI fixes * span changes * Spaces * Additional warnings to fix * Fix redundant commment
This commit is contained in:
parent
a0afd7303d
commit
57a6f7c205
4 changed files with 9 additions and 8 deletions
|
|
@ -31,7 +31,7 @@ class TensorShape {
|
|||
|
||||
TensorShape(gsl::span<const int64_t> dims);
|
||||
TensorShape(const std::vector<int64_t>& dims) : TensorShape(gsl::make_span(dims)) {}
|
||||
TensorShape(const std::initializer_list<int64_t>& dims) : TensorShape(gsl::make_span(dims)) {}
|
||||
TensorShape(const std::initializer_list<int64_t>& dims) : TensorShape(gsl::make_span(dims.begin(), dims.end())) {}
|
||||
TensorShape(const int64_t* dimension_sizes, size_t dimension_count) : TensorShape(gsl::span<const int64_t>(dimension_sizes, dimension_count)) {}
|
||||
TensorShape(const std::vector<int64_t>& dims, size_t start, size_t end) : TensorShape(gsl::span<const int64_t>(&dims[start], end - start)) {}
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ class TensorShape {
|
|||
Copy dims into an array with given size
|
||||
*/
|
||||
void CopyDims(int64_t* dims, size_t num_dims) const {
|
||||
memcpy(dims, values_.begin(), sizeof(int64_t) * std::min(num_dims, NumDimensions()));
|
||||
memcpy(dims, values_.data(), sizeof(int64_t) * std::min(num_dims, NumDimensions()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +66,7 @@ class TensorShape {
|
|||
and this function does no checks to ensure that
|
||||
*/
|
||||
void CopyDims(int64_t* dims, size_t start_dim, size_t num_dims) const {
|
||||
memcpy(dims, values_.begin() + start_dim, sizeof(int64_t) * std::min(num_dims, NumDimensions() - start_dim));
|
||||
memcpy(dims, values_.data() + start_dim, sizeof(int64_t) * std::min(num_dims, NumDimensions() - start_dim));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1507,7 +1507,7 @@ std::vector<IMLOperatorTensor*> OpKernelContextWrapper::GetOutputTensors(const E
|
|||
std::vector<IMLOperatorTensor*> ret;
|
||||
ret.reserve(m_outputTensors.size());
|
||||
|
||||
ORT_THROW_HR_IF(E_INVALIDARG, m_impl->OutputCount() != outputShapes.EdgeCount());
|
||||
ORT_THROW_HR_IF(E_INVALIDARG, static_cast<size_t>(m_impl->OutputCount()) != outputShapes.EdgeCount());
|
||||
|
||||
for (int i = 0; i < m_impl->OutputCount(); ++i) {
|
||||
ComPtr<IMLOperatorTensor> tensor;
|
||||
|
|
@ -1847,7 +1847,7 @@ void InferAndVerifyOutputSizes(
|
|||
|
||||
if (tensorType.has_shape()) {
|
||||
const auto& shape = tensorType.shape();
|
||||
ML_CHECK_BOOL(shape.dim_size() == outputShapes.GetShape(outputIndex).size());
|
||||
ML_CHECK_BOOL(static_cast<size_t>(shape.dim_size()) == outputShapes.GetShape(outputIndex).size());
|
||||
|
||||
for (uint32_t output_dim = 0; output_dim < outputShapes.GetShape(outputIndex).size(); ++output_dim) {
|
||||
if (shape.dim(output_dim).has_dim_value()) {
|
||||
|
|
|
|||
|
|
@ -1335,7 +1335,7 @@ namespace OperatorHelper
|
|||
auto inputShape = shapeInfo.GetInputTensorShape(i);
|
||||
for (size_t j = 0; j < outputShape.size(); ++j)
|
||||
{
|
||||
if (m_axis == j)
|
||||
if (static_cast<size_t>(m_axis) == j)
|
||||
{
|
||||
outputShape[j] += inputShape[j];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ static constexpr OrtDmlApi ort_dml_api_10_to_x = {
|
|||
const OrtDmlApi* GetOrtDmlApi(_In_ uint32_t /*version*/) NO_EXCEPTION {
|
||||
#ifdef USE_DML
|
||||
return &ort_dml_api_10_to_x;
|
||||
#endif // USE_DML
|
||||
return nullptr;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
Loading…
Reference in a new issue