We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c8b7661 + 37dae3f commit d0cee46Copy full SHA for d0cee46
src/nnpack/NNPACK.jl
@@ -34,8 +34,8 @@ Allows NNPACK to intelligently choose which threadpool to use for getting the be
34
performance.
35
"""
36
function allocate_threadpool()
37
- global NNPACK_CPU_THREADS = NNPACK_CPU_THREADS > 8 ? UInt64(8) : floor(log2(NNPACK_CPU_THREADS))
38
- for i in 1:Int(NNPACK_CPU_THREADS)
+ global NNPACK_CPU_THREADS = NNPACK_CPU_THREADS > 8 ? UInt64(8) : UInt64(exp2(floor(log2(NNPACK_CPU_THREADS))))
+ for i in 0:Int(log2(NNPACK_CPU_THREADS))
39
threads = UInt64(2^i)
40
push!(shared_threadpool_dict, threads => Ref(pthreadpool_create(threads)))
41
end
0 commit comments