提交 2dabadd1 编写于 作者: L liuqi

Use iters at relu and addn benchmark.

上级 8f246d81
...@@ -32,11 +32,15 @@ static void AddNBenchmark(int iters, int n, int type) { ...@@ -32,11 +32,15 @@ static void AddNBenchmark(int iters, int n, int type) {
if (type == DeviceType::CPU) { if (type == DeviceType::CPU) {
AddNFunctor<DeviceType::CPU, float> addn_functor; AddNFunctor<DeviceType::CPU, float> addn_functor;
while (--iters) {
addn_functor(inputs, &output[0], n); addn_functor(inputs, &output[0], n);
}
} else if (type == DeviceType::NEON) { } else if (type == DeviceType::NEON) {
AddNFunctor<DeviceType::NEON, float> neon_addn_functor; AddNFunctor<DeviceType::NEON, float> neon_addn_functor;
while (--iters) {
neon_addn_functor(inputs, &output[0], n); neon_addn_functor(inputs, &output[0], n);
} }
}
} }
static const int kBenchmarkSize = 10000000; static const int kBenchmarkSize = 10000000;
......
...@@ -27,11 +27,15 @@ static void ReluBenchmark(int iters, int n, int type) { ...@@ -27,11 +27,15 @@ static void ReluBenchmark(int iters, int n, int type) {
if (type == DeviceType::CPU) { if (type == DeviceType::CPU) {
ReluFunctor<DeviceType::CPU, float> relu_functor; ReluFunctor<DeviceType::CPU, float> relu_functor;
while (--iters) {
relu_functor(&input[0], &output[0], n); relu_functor(&input[0], &output[0], n);
}
} else if (type == DeviceType::NEON) { } else if (type == DeviceType::NEON) {
ReluFunctor<DeviceType::NEON, float> neon_relu_functor; ReluFunctor<DeviceType::NEON, float> neon_relu_functor;
while (--iters) {
neon_relu_functor(&input[0], &output[0], n); neon_relu_functor(&input[0], &output[0], n);
} }
}
} }
static const int kBenchmarkSize = 10000000; static const int kBenchmarkSize = 10000000;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册