提交 d666c8eb 编写于 作者: N nhzlx

fix benchmark

上级 900fbb83
...@@ -33,7 +33,7 @@ std::string Benchmark::SerializeToString() const { ...@@ -33,7 +33,7 @@ std::string Benchmark::SerializeToString() const {
ss << batch_size_ << "\t"; ss << batch_size_ << "\t";
ss << num_threads_ << "\t"; ss << num_threads_ << "\t";
ss << latency_ << "\t"; ss << latency_ << "\t";
ss << 1000 / latency_; ss << 1000.0 / latency_;
ss << '\n'; ss << '\n';
return ss.str(); return ss.str();
} }
......
...@@ -11,9 +11,11 @@ ...@@ -11,9 +11,11 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#pragma once
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <string>
namespace paddle { namespace paddle {
namespace inference { namespace inference {
...@@ -31,8 +33,8 @@ struct Benchmark { ...@@ -31,8 +33,8 @@ struct Benchmark {
bool use_gpu() const { return use_gpu_; } bool use_gpu() const { return use_gpu_; }
void SetUseGpu() { use_gpu_ = true; } void SetUseGpu() { use_gpu_ = true; }
int latency() const { return latency_; } float latency() const { return latency_; }
void SetLatency(int x) { latency_ = x; } void SetLatency(float x) { latency_ = x; }
const std::string& name() const { return name_; } const std::string& name() const { return name_; }
void SetName(const std::string& name) { name_ = name; } void SetName(const std::string& name) { name_ = name; }
...@@ -43,7 +45,7 @@ struct Benchmark { ...@@ -43,7 +45,7 @@ struct Benchmark {
private: private:
bool use_gpu_{false}; bool use_gpu_{false};
int batch_size_{0}; int batch_size_{0};
int latency_; float latency_;
int num_threads_{1}; int num_threads_{1};
std::string name_; std::string name_;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册