Skip to content

Commit 94d1e00

Browse files
author
Avik Pal
committed
Add basic heuristics
1 parent c4e8573 commit 94d1e00

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/nnpack/performance.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
function select_threadpool(cdims::DenseConvDims, batch_size::Int)
2+
inp_size = input_size(cdims)[1]
3+
if batch_size >= 32
4+
return shared_threadpool_dict[4][]
5+
elseif batch_size >= 16 && inp_size >= 64
6+
return shared_threadpool_dict[4][]
7+
elseif inp_size <= 32
8+
return C_NULL
9+
elseif inp_size >= 128
10+
return shared_threadpool_dict[4][]
11+
elseif inp_size * batch_size >= 256
12+
return shared_threadpool_dict[4][]
13+
end
214
return C_NULL
315
end
416

0 commit comments

Comments
 (0)