Commit 2f7db364 authored by Paul's avatar Paul
Browse files

Formatting

parent e0b0cd9e
......@@ -209,13 +209,16 @@ struct stream_info
continue;
}
auto stream = get_stream(i);
if (m.count(stream) == 0)
if(m.count(stream) == 0)
m[stream] = i;
else
m[stream] = std::min(m[stream], i, by(std::less<>{}, [&](auto x) { return std::distance(x, start); }));
m[stream] = std::min(m[stream], i, by(std::less<>{}, [&](auto x) {
return std::distance(x, start);
}));
}
})(start);
std::transform(m.begin(), m.end(), std::back_inserter(result), [](auto&& p) { return p.second; });
std::transform(
m.begin(), m.end(), std::back_inserter(result), [](auto&& p) { return p.second; });
return result;
}
......@@ -328,11 +331,11 @@ void schedule::apply(program& p) const
// Insert wait instructions
if(si.is_merge_point(ins, stream))
{
for(auto i:si.get_recorded_instructions(ins))
for(auto i : si.get_recorded_instructions(ins))
{
if (not si.has_stream(i))
if(not si.has_stream(i))
continue;
if (stream == si.get_stream(i))
if(stream == si.get_stream(i))
continue;
// Create a new event if it hasn't been recorded
if(ins2wait.count(i) == 0)
......
......@@ -148,10 +148,7 @@ struct context
events.emplace_back(create_event());
}
hipEvent_t get_event(std::size_t i) const
{
return events.at(i).get();
}
hipEvent_t get_event(std::size_t i) const { return events.at(i).get(); }
std::vector<argument> literals{};
void finish() const { gpu_sync(); }
......
......@@ -25,10 +25,7 @@ struct record_event
return {};
}
void finalize(context& ctx, const shape&, std::vector<shape>)
{
ctx.create_events(event);
}
void finalize(context& ctx, const shape&, std::vector<shape>) { ctx.create_events(event); }
};
struct wait_event
......
......@@ -28,9 +28,9 @@ struct schedule_model
/// Schedule a concurrent instruction
void sched(program& p, instruction_ref ins, std::size_t n) const;
// Insert necessary waits before an instruction
void wait(program& p,instruction_ref ins, std::size_t wait_id) const;
void wait(program& p, instruction_ref ins, std::size_t wait_id) const;
// Insert necessary records after an instruction
void record(program& p,instruction_ref ins, std::size_t wait_id) const;
void record(program& p, instruction_ref ins, std::size_t wait_id) const;
/// Compute weights for an operation
std::size_t weight(const operation& op) const;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment