Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix spelling in threaded_engine_test #14709

Merged
merged 1 commit into from
Apr 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/cpp/engine/threaded_engine_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* present the following workload
* n = reads.size()
* data[write] = (data[reads[0]] + ... data[reads[n]]) / n
* std::this_thread::sleep_for(std::chrono::microsecons(time));
* std::this_thread::sleep_for(std::chrono::microseconds(time));
*/
struct Workload {
std::vector<int> reads;
Expand Down Expand Up @@ -76,7 +76,7 @@ void GenerateWorkload(int num_workloads, int num_var,
/**
* evaluate a single workload
*/
void EvaluateWorload(const Workload& wl, std::vector<double>* data) {
void EvaluateWorkload(const Workload& wl, std::vector<double>* data) {
double tmp = 0;
for (int i : wl.reads) tmp += data->at(i);
data->at(wl.write) = tmp / (wl.reads.size() + 1);
Expand All @@ -88,9 +88,9 @@ void EvaluateWorload(const Workload& wl, std::vector<double>* data) {
/**
* evaluate a list of workload, return the time used
*/
double EvaluateWorloads(const std::vector<Workload>& workloads,
mxnet::Engine* engine,
std::vector<double>* data) {
double EvaluateWorkloads(const std::vector<Workload>& workloads,
mxnet::Engine* engine,
std::vector<double>* data) {
using namespace mxnet;
double t = dmlc::GetTime();
std::vector<Engine::VarHandle> vars;
Expand All @@ -103,10 +103,10 @@ double EvaluateWorloads(const std::vector<Workload>& workloads,
for (const auto& wl : workloads) {
if (wl.reads.size() == 0) continue;
if (engine == NULL) {
EvaluateWorload(wl, data);
EvaluateWorkload(wl, data);
} else {
auto func = [wl, data](RunContext ctx, Engine::CallbackOnComplete cb) {
EvaluateWorload(wl, data); cb();
EvaluateWorkload(wl, data); cb();
};
std::vector<Engine::VarHandle> reads;
for (auto i : wl.reads) {
Expand Down Expand Up @@ -159,7 +159,7 @@ TEST(Engine, RandSumExpr) {
std::vector<std::vector<double>> data(num_engine);
for (int i = 0; i < num_engine; ++i) {
data[i].resize(num_var, 1.0);
t[i] += EvaluateWorloads(workloads, engine[i], &data[i]);
t[i] += EvaluateWorkloads(workloads, engine[i], &data[i]);
}

for (int i = 1; i < num_engine; ++i) {
Expand Down