Comments (10)
Okay give this a shot please: -D_LIBCUDACXX_HAS_THREAD_API_EXTERNAL -D_LIBCUDACXX_HAS_THREAD_API_CUDA
from thrust.
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.
I think this actually an issue with https://github.com/NVIDIA/libcudacxx, not Thrust.
from thrust.
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.
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.
Excellent, that worked! Thank you. Quite the magical incantation.
from thrust.
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.
Looks like it's __EMSCRIPTEN__
: https://emscripten.org/docs/compiling/Building-Projects.html#detecting-emscripten-in-preprocessor
from thrust.
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.
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)
- Can thrust support device segmented sort?
- Don't include host_defines.h if not using nvcc in year 2023
- thrust::reduce doesn't work with cuda::proclaim_return_type HOT 1
- THRUST_OPTIONAL_IS_TRIVIALLY_COPY_ASSIGNABLE bug in clang compilation HOT 6
- Compilation error for nvcc 12.X for shuffle and -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP HOT 2
- Compilation error with iterator_adaptor HOT 2
- calling a __host__ function .... from a __global__ function .... is not allowed HOT 8
- Fix failing libcxx tests
- nvcc fatal : Unsupported gpu architecture 'compute_90' for $ cmake --build . -j ${NUM_JOBS} HOT 4
- Compilation error for `transform_reduce` for the openMP implementation HOT 1
- Undefined behaviour on single element assignment HOT 2
- Failed to find Thrust when compiling on conda-forge HOT 1
- Memory pool gets corrupted when oversized allocations are returned to pool out of order HOT 4
- Make libcu++ compile with gcc-6
- Thread Sanitizer failures during thrust::reduce HOT 1
- statically detect precondition violations in thrust::for_each
- Slow thrust::distance called for for_each with C++20 iterators HOT 4
- Thrust with tbb backend uses sequential versions for several algorithms
- Modify Device Value Error in Official Doc Codes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thrust.