Skip to content

Commit 8b91c9b

Browse files
committed
rm threadpool arg
1 parent 25dcd3c commit 8b91c9b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/nnpack/interface.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ function softmax!(x::A) where A<:AbstractVecOrMat{Float64}
1212
end
1313

1414
softmax!(x::A) where A<:AbstractVecOrMat{Float32} =
15-
nnp_softmax_output(x, x, threadpool = shared_threadpool[])
15+
nnp_softmax_output(x, x)
1616

1717
softmax!(y::A, x::A) where A<:AbstractVecOrMat{Float64} = softmax!(Float32.(y), Float32.(x))
1818

1919
softmax!(y::A, x::A) where A<:AbstractVecOrMat{Float32} =
20-
nnp_softmax_output(x, y, threadpool = shared_threadpool[])
20+
nnp_softmax_output(x, y)
2121

2222
softmax(x::A) where A<:AbstractVecOrMat{Float64} = softmax(Float32.(x))
2323

2424
softmax(x::A) where A<:AbstractVecOrMat{Float32} =
25-
nnp_softmax_output(x, similar(x), threadpool = shared_threadpool[])
25+
nnp_softmax_output(x, similar(x))
2626

2727
maxpool(x::A, k; pad = map(_->0,k), stride = k) where A<:AbstractArray{Float64, 4} =
2828
maxpool(Float32.(x), k, pad = pad, stride = stride)
@@ -40,7 +40,7 @@ maxpool!(y::A, x::A, k; pad = map(_->0,k), stride = k) where A<:AbstractArray{Fl
4040
maxpool!(Float32.(y), Float32.(x), k, pad = pad, stride = stride)
4141

4242
maxpool!(y::A, x::A, k; pad = map(_->0,k), stride = k) where A<:AbstractArray{Float32, 4} =
43-
nnp_max_pooling_output(x, y, k, padding = expand(Val{length(k)}, pad), stride = expand(Val{length(k)}, stride), threadpool = shared_threadpool[])
43+
nnp_max_pooling_output(x, y, k, padding = expand(Val{length(k)}, pad), stride = expand(Val{length(k)}, stride))
4444

4545
conv(x::A, w::A; pad = 0, stride = 1, dilation = 1, algo = UInt32(0)) where A<:AbstractArray{Float64, 4} =
4646
conv(Float32.(x), Float32.(w), pad = pad, stride = stride, dilation = dilation, algo = algo)
@@ -88,7 +88,7 @@ function conv!(y::A1, x::A1, w::A1, b::A2; pad = 0, stride = 1, dilation = 1, al
8888
if flipkernel == 0
8989
w = reverse(reverse(w, dims=1), dims=2)
9090
end
91-
nnp_convolution_output(y, x, w, b, algo = algo, padding = pad, stride = stride, threadpool = shared_threadpool[])
91+
nnp_convolution_output(y, x, w, b, algo = algo, padding = pad, stride = stride)
9292
end
9393

9494
crosscor!(y::A1, x::A1, w::A1, b::A2; pad = 0, stride = 1, dilation = 1, algo = UInt32(0)) where {A1<:AbstractArray{Float64, 4}, A2<:AbstractArray{Float64, 1}} =
@@ -104,7 +104,7 @@ function ∇conv_data(dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1, algo
104104
pad_, stride_, fallback = check_support(x, (size(w, 1), size(w, 2)), pad, stride, dilation)
105105
if fallback
106106
conv2d_grad_x!(zeros(Float32, size(x)), x, w, dy, padding = pad_, stride = stride_, dilation = dilation)
107-
else
107+
else
108108
∇conv_data!(zeros(Float32, size(x)), dy, x, w; pad = pad_, stride = stride_, dilation = dilation, algo = UInt32(algo))
109109
end
110110
end
@@ -114,7 +114,7 @@ end
114114

115115
function ∇conv_data!(dx::A, dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1, algo = UInt32(0), flipkernel = 0) where A<:AbstractArray{Float32, 4}
116116
flipkernel == 0 && (w = reverse(reverse(w, dims=1), dims=2))
117-
nnp_convolution_input_gradient(dx, x, dy, w, padding = pad, stride = stride, algo = algo, threadpool = shared_threadpool[])
117+
nnp_convolution_input_gradient(dx, x, dy, w, padding = pad, stride = stride, algo = algo)
118118
end
119119

120120
∇conv_filter(dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1, algo = UInt32(0)) where A<:AbstractArray{Float64, 4} =
@@ -124,7 +124,7 @@ function ∇conv_filter(dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1, al
124124
pad_, stride_, fallback = check_support(x, (size(w, 1), size(w, 2)), pad, stride, dilation)
125125
if fallback
126126
conv2d_grad_w!(zeros(Float32, size(w)), x, w, dy, padding = pad_, stride = stride_, dilation = dilation)
127-
else
127+
else
128128
∇conv_filter!(zeros(Float32, size(w)), dy, x, w; pad = pad_, stride = stride_, dilation = dilation, algo = UInt32(algo))
129129
end
130130
end
@@ -134,6 +134,6 @@ end
134134

135135
function ∇conv_filter!(dw::A, dy::A, x::A, w::A; pad = 0, stride = 1, dilation = 1, algo = UInt32(0), flipkernel = 0) where A<:AbstractArray{Float32, 4}
136136
flipkernel == 0 && (w = reverse(reverse(w, dims=1), dims=2))
137-
dw .= nnp_convolution_kernel_gradient(dw, x, dy, w, padding = pad, stride = stride, algo = algo, threadpool = shared_threadpool[])
137+
dw .= nnp_convolution_kernel_gradient(dw, x, dy, w, padding = pad, stride = stride, algo = algo)
138138
flipkernel == 0 ? reverse(reverse(dw, dims=1), dims=2) : dw
139139
end

0 commit comments

Comments
 (0)