Git Product home page Git Product logo

Comments (4)

btgraham avatar btgraham commented on July 19, 2024

Hello.
What is the error message exactly, please?
And what if you replace
workers.emplace_back(std::thread(std::bind(&BatchProducer::batchProducerThread,this,nThread)));
with
workers.emplace_back(std::thread(&BatchProducer::batchProducerThread,this,nThread));
??
Regards
Ben Graham ([email protected])

from sparseconvnet-archived.

SpiderMonkey1975 avatar SpiderMonkey1975 commented on July 19, 2024

Here is the error I get using the original code:

bash-3.2$ make cifar10
nvcc -c -o BatchProducer.o BatchProducer.cu -std=c++11 -O3
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits(3476): error: function "std::__1::__nat::~__nat()"
(1027): here cannot be referenced -- it is a deleted function
detected during:
instantiation of class "std::__1::__invokable_imp<_Fp, _Args...> [with _Fp=BatchProducer _&, _Args=<>]"
(3484): here
instantiation of class "std::__1::__invokable<_Fp, _Args...> [with _Fp=BatchProducer *&, _Args=<>]"
(3503): here
instantiation of class "std::__1::__invoke_of<_Fp, _Args...> [with _Fp=BatchProducer *&, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2023): here
instantiation of "std::__1::__bind_return<_Fp, _BoundArgs, _Args, std::__1::_is_valid_bind_return<_Fp, _BoundArgs, _Args>::value>::type std::__1::__apply_functor(_Fp &, _BoundArgs &, std::__1::__tuple_indices<_Indx...>, _Args &&) [with Fp=void (BatchProducer::)(int), _BoundArgs=std::__1::tuple<BatchProducer *, int>, _Indx=<0UL, 1UL>, _Args=std::__1::tuple<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2087): here
instantiation of "std::__1::__bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>, std::__1::_is_valid_bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>>::value>::type std::__1::__bind<_Fp, _BoundArgs...>::operator()(_Args &&...) [with Fp=void (BatchProducer::)(int), _BoundArgs=<BatchProducer *, int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base(413): here
instantiation of "auto std::__1::__invoke(_Fp &&, _Args &&...)->decltype(()) [with Fp=std::__1::__bind<void (BatchProducer::)(int), BatchProducer _, int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(332): here
instantiation of "void std::__1::__thread_execute(std::__1::tuple<_Fp, _Args...> &, std::__1::__tuple_indices<_Indices...>) [with Fp=std::__1::__bind<void (BatchProducer::)(int), BatchProducer _, int &>, _Args=<>, _Indices=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(342): here
instantiation of "void *std::__1::__thread_proxy<_Fp>(void *) [with Fp=std::__1::tuple<std::__1::__bind<void (BatchProducer::)(int), BatchProducer _, int &>>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(354): here
instantiation of "std::__1::thread::thread(_Fp &&, _Args &&...) [with Fp=std::__1::__bind<void (BatchProducer::)(int), BatchProducer *, int &>, _Args=<>, =void]"
BatchProducer.cu(121): here

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits(3476): error: function "std::__1::__nat::~__nat()"
(1027): here cannot be referenced -- it is a deleted function
detected during:
instantiation of class "std::__1::__invokable_imp<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
(3484): here
instantiation of class "std::__1::__invokable<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
(3503): here
instantiation of class "std::__1::__invoke_of<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2023): here
instantiation of "std::__1::__bind_return<_Fp, _BoundArgs, _Args, std::__1::_is_valid_bind_return<_Fp, _BoundArgs, _Args>::value>::type std::__1::__apply_functor(_Fp &, _BoundArgs &, std::__1::__tuple_indices<_Indx...>, _Args &&) [with Fp=void (BatchProducer::)(int), _BoundArgs=std::__1::tuple<BatchProducer *, int>, _Indx=<0UL, 1UL>, _Args=std::__1::tuple<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2087): here
instantiation of "std::__1::__bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>, std::__1::_is_valid_bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>>::value>::type std::__1::__bind<_Fp, _BoundArgs...>::operator()(_Args &&...) [with Fp=void (BatchProducer::)(int), _BoundArgs=<BatchProducer , int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base(413): here
instantiation of "auto std::__1::__invoke(_Fp &&, _Args &&...)->decltype(()) [with _Fp=std::__1::__bind<void (BatchProducer::
)(int), BatchProducer , int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(332): here
instantiation of "void std::__1::__thread_execute(std::__1::tuple<_Fp, _Args...> &, std::__1::__tuple_indices<_Indices...>) [with _Fp=std::__1::__bind<void (BatchProducer::
)(int), BatchProducer *, int &>, _Args=<>, _Indices=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(342): here
instantiation of "void _std::__1::__thread_proxy<_Fp>(void *) [with Fp=std::__1::tuple<std::__1::__bind<void (BatchProducer::)(int), BatchProducer _, int &>>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(354): here
instantiation of "std::__1::thread::thread(_Fp &&, _Args &&...) [with Fp=std::__1::__bind<void (BatchProducer::)(int), BatchProducer *, int &>, _Args=<>, =void]"
BatchProducer.cu(121): here

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits(3476): error: function "std::__1::__nat::~__nat()"
(1027): here cannot be referenced -- it is a deleted function
detected during:
instantiation of class "std::__1::__invokable_imp<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
(3484): here
instantiation of class "std::__1::__invokable<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
(3503): here
instantiation of class "std::__1::__invoke_of<_Fp, _Args...> [with _Fp=int &, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2023): here
instantiation of "std::__1::__bind_return<_Fp, _BoundArgs, _Args, std::__1::_is_valid_bind_return<_Fp, _BoundArgs, _Args>::value>::type std::__1::__apply_functor(_Fp &, _BoundArgs &, std::__1::__tuple_indices<_Indx...>, _Args &&) [with Fp=void (BatchProducer::)(int), _BoundArgs=std::__1::tuple<BatchProducer *, int>, _Indx=<0UL, 1UL>, _Args=std::__1::tuple<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional(2087): here
instantiation of "std::__1::__bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>, std::__1::_is_valid_bind_returnstd::__1::decay<_Fp::type, std::__1::tuplestd::__1::decay<_BoundArgs::type...>, std::__1::tuple<_Args &&...>>::value>::type std::__1::__bind<_Fp, _BoundArgs...>::operator()(_Args &&...) [with Fp=void (BatchProducer::)(int), _BoundArgs=<BatchProducer , int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base(413): here
instantiation of "auto std::__1::__invoke(_Fp &&, _Args &&...)->decltype(()) [with _Fp=std::__1::__bind<void (BatchProducer::
)(int), BatchProducer , int &>, _Args=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(332): here
instantiation of "void std::__1::__thread_execute(std::__1::tuple<_Fp, _Args...> &, std::__1::__tuple_indices<_Indices...>) [with _Fp=std::__1::__bind<void (BatchProducer::
)(int), BatchProducer *, int &>, _Args=<>, _Indices=<>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(342): here
instantiation of "void _std::__1::__thread_proxy<_Fp>(void *) [with Fp=std::__1::tuple<std::__1::__bind<void (BatchProducer::)(int), BatchProducer _, int &>>]"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/thread(354): here
instantiation of "std::__1::thread::thread(_Fp &&, _Args &&...) [with Fp=std::__1::__bind<void (BatchProducer::)(int), BatchProducer *, int &>, _Args=<>, =void]"
BatchProducer.cu(121): here

2 errors detected in the compilation of "/var/folders/41/f35mc0q121g3rfzcsqbdvz400000gn/T//tmpxft_0000b00f_00000000-7_BatchProducer.cpp1.ii".
make: *** [BatchProducer.o] Error 2

from sparseconvnet-archived.

SpiderMonkey1975 avatar SpiderMonkey1975 commented on July 19, 2024

Dang! Compile worked when I removed the bind call like you suggested. I was sure that I tried that on Saturday. Serves me right coding without coffee. Sincere apologies for the mix-up!

from sparseconvnet-archived.

btgraham avatar btgraham commented on July 19, 2024

I have updated the repo, thanks.
The "bind" was left-over from when I was using Boost threads rather than C++11 threads.
Ben

from sparseconvnet-archived.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.