Skip to content

Commit

Permalink
Fix spelling in threaded_engine_test (apache#14709)
Browse files Browse the repository at this point in the history
  • Loading branch information
KellenSunderland authored and kedarbellare committed Apr 20, 2019
1 parent a121c26 commit 3964144
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 3964144

Please sign in to comment.