Skip to content

Commit

Permalink
Added more optimal thread count choice
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Aug 16, 2021
1 parent 96c01f6 commit 67b54d7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,13 @@ void MKLDNNStridedSliceNode::dimsGluing(const size_t realNDims, const SizeVector

void MKLDNNStridedSliceNode::indicesCalculation() {
// indices calculation before execution for the best performance
params.nThreads = parallel_get_max_threads();
params.srcIndices.resize(params.workAmount, 0);
params.dstIndices.resize(params.workAmount, 0);

// should choose more optimal thread count
const size_t nthr = parallel_get_max_threads();
params.nThreads = nthr > params.workAmount ? params.workAmount : nthr;

if (params.isOptimized) {
indicesCalculationForOptimized();
return;
Expand Down

0 comments on commit 67b54d7

Please sign in to comment.