You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/12/28 15:55:04 UTC

[GitHub] [incubator-tvm] kevinyuan opened a new issue #4596: codegen.cc:150:32: error: use of deleted function

kevinyuan opened a new issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596
 
 
   Hi,
   
   The latest code has compilation errors with tvm/src/relay/backend/contrib/codegen_c/codegen.cc:
   
   ------------------------
   
   
   [ 90%] Building CXX object CMakeFiles/tvm.dir/src/runtime/cpu_device_api.cc.o
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc: In member function ‘void tvm::relay::contrib::CSourceCodegen::GenCFunc(const tvm::relay::Function&)’:
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:150:32: error: use of deleted function ‘tvm::relay::contrib::CodegenC::CodegenC(tvm::relay::contrib::CodegenC&&)’
        auto builder = CodegenC(sid);
                                   ^
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:39:7: note: ‘tvm::relay::contrib::CodegenC::CodegenC(tvm::relay::contrib::CodegenC&&)’ is implicitly deleted because the default definition would be ill-formed:
    class CodegenC : public ExprVisitor, public CodegenCBase {
          ^
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:39:7: error: use of deleted function ‘tvm::relay::contrib::CodegenCBase::CodegenCBase(tvm::relay::contrib::CodegenCBase&&)’
   In file included from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:28:0:
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen_c.h:70:7: note: ‘tvm::relay::contrib::CodegenCBase::CodegenCBase(tvm::relay::contrib::CodegenCBase&&)’ is implicitly deleted because the default definition would be ill-formed:
    class CodegenCBase {
          ^
   /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen_c.h:70:7: error: use of deleted function ‘std::basic_ostringstream<char>::basic_ostringstream(const std::basic_ostringstream<char>&)’
   In file included from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20:0,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/sstream:387:11: note: ‘std::basic_ostringstream<char>::basic_ostringstream(const std::basic_ostringstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
        class basic_ostringstream : public basic_ostream<_CharT, _Traits>
              ^
   /usr/include/c++/4.8.2/sstream:387:11: error: use of deleted function ‘std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)’
   In file included from /usr/include/c++/4.8.2/istream:39:0,
                    from /usr/include/c++/4.8.2/sstream:38,
                    from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/ostream:58:11: note: ‘std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
        class basic_ostream : virtual public basic_ios<_CharT, _Traits>
              ^
   /usr/include/c++/4.8.2/ostream:58:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
   In file included from /usr/include/c++/4.8.2/ios:44:0,
                    from /usr/include/c++/4.8.2/istream:38,
                    from /usr/include/c++/4.8.2/sstream:38,
                    from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   
   /usr/include/c++/4.8.2/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’ is implicitly deleted because the default definition would be ill-formed:
        class basic_ios : public ios_base
              ^
   In file included from /usr/include/c++/4.8.2/ios:42:0,
                    from /usr/include/c++/4.8.2/istream:38,
                    from /usr/include/c++/4.8.2/sstream:38,
                    from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/bits/ios_base.h:786:5: error: ‘std::ios_base::ios_base(const std::ios_base&)’ is private
        ios_base(const ios_base&);
        ^
   In file included from /usr/include/c++/4.8.2/ios:44:0,
                    from /usr/include/c++/4.8.2/istream:38,
                    from /usr/include/c++/4.8.2/sstream:38,
                    from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/bits/basic_ios.h:66:11: error: within this context
        class basic_ios : public ios_base
              ^
   In file included from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20:0,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/sstream:387:11: error: use of deleted function ‘std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)’
        class basic_ostringstream : public basic_ostream<_CharT, _Traits>
              ^
   /usr/include/c++/4.8.2/sstream:387:11: error: use of deleted function ‘std::basic_stringbuf<char>::basic_stringbuf(const std::basic_stringbuf<char>&)’
   /usr/include/c++/4.8.2/sstream:64:11: note: ‘std::basic_stringbuf<char>::basic_stringbuf(const std::basic_stringbuf<char>&)’ is implicitly deleted because the default definition would be ill-formed:
        class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
              ^
   In file included from /usr/include/c++/4.8.2/ios:43:0,
                    from /usr/include/c++/4.8.2/istream:38,
                    from /usr/include/c++/4.8.2/sstream:38,
                    from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/streambuf:802:7: error: ‘std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
          basic_streambuf(const basic_streambuf& __sb)
          ^
   In file included from /home/kevinyuan/dev/tvm/3rdparty/dmlc-core/include/dmlc/logging.h:20:0,
                    from /home/kevinyuan/dev/tvm/include/tvm/node/functor.h:26,
                    from /home/kevinyuan/dev/tvm/include/tvm/relay/expr_functor.h:28,
                    from /home/kevinyuan/dev/tvm/src/relay/backend/contrib/codegen_c/codegen.cc:19:
   /usr/include/c++/4.8.2/sstream:64:11: error: within this context
        class basic_stringbuf : public basic_streambuf<_CharT, _Traits>
              ^
   [ 91%] Building CXX object CMakeFiles/tvm.dir/src/runtime/dso_library.cc.o
   
   
   make[2]: *** [CMakeFiles/tvm.dir/src/relay/backend/contrib/codegen_c/codegen.cc.o] Error 1
   make[2]: *** Waiting for unfinished jobs....
   make[1]: *** [CMakeFiles/tvm.dir/all] Error 2
   make: *** [all] Error 2
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] comaniac commented on issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
comaniac commented on issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596#issuecomment-569450574
 
 
   According to [this post](https://stackoverflow.com/questions/50926506/deleted-function-std-basic-stringstream-in-linux-with-g), it seems like we triggered the stream move constructor that has not yet supported in gcc 4.8. We'll try to find out the root cause, although we don't have gcc 4.8 to reproduce the issue. The most efficient solution would be upgrading gcc version I think.
   
   btw, the solution @kevinyuan proposed could work, but it's just a workaround.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen closed issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
tqchen closed issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596#issuecomment-569452418
 
 
   Given that we do not really have to move the code generator class, I would say we can simply disable copy and move. If we need to move it, consider wrap it in an unique_ptr

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] zhiics commented on issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
zhiics commented on issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596#issuecomment-569475841
 
 
   copy constructor is triggered by
   
   https://github.com/apache/incubator-tvm/blob/227c7af4464a03b42d7e2fa0949621833137cca2/src/relay/backend/contrib/codegen_c/codegen.cc#L150 
   
   This should be fixed by #4597 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] tqchen commented on issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
tqchen commented on issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596#issuecomment-569447460
 
 
   cc @zhiics @comaniac 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-tvm] kevinyuan commented on issue #4596: codegen.cc:150:32: error: use of deleted function

Posted by GitBox <gi...@apache.org>.
kevinyuan commented on issue #4596: codegen.cc:150:32: error: use of deleted function
URL: https://github.com/apache/incubator-tvm/issues/4596#issuecomment-569429271
 
 
   Not sure if it's correct, but I just adding line 18 to exclude the codegen.cc from default compilation.
   
    18 if(USE_DNNL_CODEGEN STREQUAL "ON")
    19     file(GLOB CSOURCE_RELAY_CONTRIB_SRC src/relay/backend/contrib/codegen_c/codegen.cc)
    20     list(APPEND COMPILER_SRCS ${CSOURCE_RELAY_CONTRIB_SRC})
    21 endif()
    22
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services