Skip to content

Commit 709844d

Browse files
committed
Add multithreading heuristic
1 parent 465ace2 commit 709844d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tensors/indexmanipulations.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,7 @@ function add_transform!(tdst::AbstractTensorMap,
474474
end
475475

476476
function use_threaded_transform(t::TensorMap, transformer::TreeTransformer)
477-
# TODO: heuristic for not threading over small tensors
478-
return get_num_transformer_threads() > 1
477+
return get_num_transformer_threads() > 1 && length(t.data) > Strided.MINTHREADLENGTH
479478
end
480479

481480
function add_transform_kernel!(tdst::TensorMap,

0 commit comments

Comments
 (0)