nbigaouette / onnxruntime-rs

Rust wrapper for Microsoft's ONNX Runtime (version 1.8)
Apache License 2.0
276 stars 99 forks source link

Update bindings to ONNX Runtime v1.7.0 #78

Closed dkim closed 3 years ago

dkim commented 3 years ago

This updates all the bindings to ONNX Runtime v1.7.0 except for bindings for macOS (aarch64), which I do not have access to.

dkim commented 3 years ago

@nbigaouette Can I have your opinion on this?

nbigaouette commented 3 years ago

Sorry for the delay. The time I can put on this is almost null...

I tried generating the M1 bindings, but onnxruntime v1.7.0 fails to compile:

[ 41%] Building CXX object external/onnx/CMakeFiles/onnx.dir/onnx/defs/nn/defs.cc.o                                                                                      [53/1871]
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/session/inference_session.cc:28:
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/framework/ort_value_pattern_planner.h:9:
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/framework/mem_pattern_planner.h:20:
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/common/safeint.h:27:
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:5719:35: error: definition of implicit copy constructor for 'SafeInt<long>' is deprecated b
ecause it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
    _CONSTEXPR14 SafeInt< T, E >& operator =( const SafeInt< T, E >& rhs ) SAFEINT_NOTHROW                                                                                                                          ^
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:6500:12: note: in implicit copy constructor for 'SafeInt<long>' first required here
    return SafeInt<ptrdiff_t, SafeIntDefaultExceptionHandler>( p1 - p2 );
           ^
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:5719:35: error: definition of implicit copy constructor for 'SafeInt<unsigned long>' is dep
recated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
    _CONSTEXPR14 SafeInt< T, E >& operator =( const SafeInt< T, E >& rhs ) SAFEINT_NOTHROW
                                  ^
/Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/framework/mem_pattern_planner.h:160:28: note: in implicit copy constructor for 'SafeInt<unsigned long>' first require
d here
    ORT_ENFORCE(current <= buffer_size_);
                           ^
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/session/onnxruntime_c_api.cc:20:
In file included from /Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/common/safeint.h:27:
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:5719:35: error: definition of implicit copy constructor for 'SafeInt<long>' is deprecated b
ecause it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
    _CONSTEXPR14 SafeInt< T, E >& operator =( const SafeInt< T, E >& rhs ) SAFEINT_NOTHROW
                                  ^
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:6500:12: note: in implicit copy constructor for 'SafeInt<long>' first required here
    return SafeInt<ptrdiff_t, SafeIntDefaultExceptionHandler>( p1 - p2 );
           ^
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:5719:35: error: definition of implicit copy constructor for 'SafeInt<unsigned long>' is dep
recated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
    _CONSTEXPR14 SafeInt< T, E >& operator =( const SafeInt< T, E >& rhs ) SAFEINT_NOTHROW
                                  ^
/Users/nbigaouette/projects/onnxruntime.git/cmake/external/SafeInt/safeint/SafeInt.hpp:6017:16: note: in implicit copy constructor for 'SafeInt<unsigned long>' first required her
e
        return SafeInt< T, E >( ret );
               ^
/Users/nbigaouette/projects/onnxruntime.git/onnxruntime/core/session/onnxruntime_c_api.cc:1079:81: note: in instantiation of function template specialization 'SafeInt<unsigned lo
ng, SafeIntExceptionHandler<onnxruntime::OnnxRuntimeException>>::operator*<unsigned long>' requested here
    char** p = reinterpret_cast<char**>(allocator->Alloc(allocator, alloc_count * sizeof(char*)));
                                                                                ^

I'll merge this as is. Thanks!