Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable threading in simd_op_check to address Issue #3669 #3914

Merged
merged 1 commit into from
May 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/correctness/simd_op_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2476,6 +2476,20 @@ int main(int argc, char **argv) {
num_threads = 1;
}

// TODO: multithreading here is the cause of https://github.com/halide/Halide/issues/3669;
// the fundamental issue is that we make one set of ImageParams to construct many
// Exprs, then realize those Exprs on arbitrary threads; it is known that sharing
// one Func across multiple threads is not guaranteed to be safe, and indeed, TSAN
// reports data races, of which some are likely 'benign' (e.g. Function.freeze) but others
// are highly suspect (e.g. Function.lock_loop_levels). Since multithreading here
// was added just to avoid having this test be the last to finish, the expedient 'fix'
// for now is to remove the multithreading. A proper fix could be made by restructuring this
// test so that every Expr constructed for testing was guaranteed to share no Funcs
// (Function.deep_copy() perhaps). Of course, it would also be desirable to allow Funcs, Exprs, etc
// to be usable across multiple threads, but that is a major undertaking that is
// definitely not worthwhile for present Halide usage patterns.
num_threads = 1;

if (argc > 2) {
// Don't forget: if you want to run the standard tests to a specific output
// directory, you'll need to invoke with the first arg enclosed
Expand Down