Open siboehm opened 1 year ago
This code:
#define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_TBB #include <iostream> #include <thrust/device_vector.h> #include <thrust/reduce.h> int main() { thrust::device_vector<float> vec(30, 1.0); float res = thrust::reduce(vec.begin(), vec.end(), 0.0f); std::cout << res << std::endl; }
Results in tsan failures (I checked all 4 combinations of clang and gcc, OpenMP and TBB):
SUMMARY: ThreadSanitizer: data race (/home/simon/.cache/bazel/_bazel_simon/bc7bfb2fb5f4ce0fca17a46af902a577/external/gcc_toolchain_files/x86_64-buildroot-linux-gnu/sysroot/../lib64/libtsan.so.2+0x6a443) in operator delete(void*, unsigned long, std::align_val_t)
This code:
Results in tsan failures (I checked all 4 combinations of clang and gcc, OpenMP and TBB):
Full stracktrace
``` WARNING: ThreadSanitizer: data race (pid=1388483) Read of size 4 at 0x7ffe0b2eb960 by thread T1: #0 thrust::system::tbb::detail::reduce_detail::body