summaryrefslogtreecommitdiff
path: root/run.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2019-06-05 16:08:33 -0700
committerEric Anholt <eric@anholt.net>2019-06-06 15:49:55 -0700
commit28aae85bdac6e7271f273d6310fc1dc41553f8ec (patch)
treeea1a64f4727b84423940c89a2c35ddc10e1f55f3 /run.c
parentd30e99c24cca48502257254bb1869dd489ca48bf (diff)
run: Limit OMP to the -j threads limit.
The -j argument only worked for the "1" case where OMP is skipped. Otherwise, we'd spawn the max amount of threads (except for -j 1 where OMP is skipped) and overflow the current_shader_names array. Noticed when trying to work around an apparent freedreno bug with too many contexts on the same screen. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'run.c')
-rw-r--r--run.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/run.c b/run.c
index e311f89..c2a7cb6 100644
--- a/run.c
+++ b/run.c
@@ -557,6 +557,7 @@ main(int argc, char **argv)
}
case 'j':
max_threads = atoi(optarg);
+ omp_set_num_threads(max_threads);
break;
case 'b':
generate_prog_bin = 1;