Skip to content

Commit a18c0d4

Browse files
committed
cache fc kernel
test=develop
1 parent 6e1ee7f commit a18c0d4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

paddle/fluid/operators/math/fc_compute.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@ inline void FCCompute(const BlasT<DeviceContext, T>& blas, const int M,
3030
return;
3131
}
3232
if (relu) {
33-
auto compute =
34-
jit::Get<jit::kVAddRelu, jit::XYZNTuples<T>, platform::CPUPlace>(N);
33+
auto compute = jit::KernelFuncs<jit::kVAddRelu, jit::XYZNTuples<T>,
34+
platform::CPUPlace>::Cache()
35+
.At(N);
3536
for (int i = 0; i < M; i++) {
3637
T* dst = Y + i * N;
3738
compute(B, dst, dst, N);
3839
}
3940
} else {
40-
auto compute =
41-
jit::Get<jit::kVAdd, jit::XYZNTuples<T>, platform::CPUPlace>(N);
41+
auto compute = jit::KernelFuncs<jit::kVAdd, jit::XYZNTuples<T>,
42+
platform::CPUPlace>::Cache()
43+
.At(N);
4244
#ifdef PADDLE_WITH_MKLML
4345
#pragma omp parallel for
4446
#endif

0 commit comments

Comments
 (0)