Giter Site home page Giter Site logo

Comments (10)

brycelelbach avatar brycelelbach commented on July 28, 2024 1

Okay give this a shot please: -D_LIBCUDACXX_HAS_THREAD_API_EXTERNAL -D_LIBCUDACXX_HAS_THREAD_API_CUDA

from thrust.

elalish avatar elalish commented on July 28, 2024

This is looking more like a blocker, since even when enabling -pthread in emscripten, we still get Thrust's No Thread API error. So perhaps there is an additional bug regarding detecting pthread support in the emscripten compiler?

Still, considering all the complexities of using pthreads in WASM, especially since we require ALLOW_MEMORY_GROWTH, the better option would still be to simply not require the thread API at all for the serial backend.

from thrust.

brycelelbach avatar brycelelbach commented on July 28, 2024

I think this actually an issue with https://github.com/NVIDIA/libcudacxx, not Thrust.

from thrust.

brycelelbach avatar brycelelbach commented on July 28, 2024

Can you send us the specific compilation error you're getting?

Can you try defining -D_LIBCUDACXX_HAS_NO_THREADS and see if that helps?

from thrust.

elalish avatar elalish commented on July 28, 2024

The original error:

/Users/elalish/Code/manifold/src/third_party/thrust/dependencies/libcudacxx/include/cuda/std/detail/libcxx/include/__config:1559:6: error: "No thread API"

With your define I get:

/Users/elalish/Code/manifold/src/third_party/thrust/dependencies/libcudacxx/include/cuda/std/detail/libcxx/include/__config:1584:2: error: _LIBCUDACXX_HAS_NO_THREADS cannot be set when __STDCPP_THREADS__ is set.

The compile command that generates the error is:

/opt/homebrew/Cellar/emscripten/3.1.31/libexec/em++ @CMakeFiles/collider.dir/includes_CXX.rsp -O3 -DNDEBUG -Werror -Wall -Wno-sign-compare -Wno-unused -fexceptions -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CPP -std=gnu++17 -MD -MT src/collider/CMakeFiles/collider.dir/src/collider.cpp.o -MF CMakeFiles/collider.dir/src/collider.cpp.o.d -o CMakeFiles/collider.dir/src/collider.cpp.o -c /Users/elalish/Code/manifold/src/collider/src/collider.cpp

from thrust.

elalish avatar elalish commented on July 28, 2024

Excellent, that worked! Thank you. Quite the magical incantation.

from thrust.

brycelelbach avatar brycelelbach commented on July 28, 2024

Is there a macro that Emscripten defines that we can use to detect the Emscripten environment? If so, then we can do this automatically.

from thrust.

elalish avatar elalish commented on July 28, 2024

Looks like it's __EMSCRIPTEN__: https://emscripten.org/docs/compiling/Building-Projects.html#detecting-emscripten-in-preprocessor

from thrust.

brycelelbach avatar brycelelbach commented on July 28, 2024

I've created a PR to fix this in libcu++. Can you confirm that the issue is fixed once you define those two macros? Nothing else blows up?

from thrust.

elalish avatar elalish commented on July 28, 2024

Our tests are now passing our CI on a bunch of different systems, so I think it's good. We just added those defines for the emscripten build.

from thrust.

Related Issues (20)

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.