"tests/test_models/vscode:/vscode.git/clone" did not exist on "7c27cd750aa2a689fdad67bf1047f231dfbfe02d"
Commit 9cd5cf4e authored by Paul's avatar Paul
Browse files

Formatting

parent 19ed10f0
...@@ -17,10 +17,9 @@ struct hip_device ...@@ -17,10 +17,9 @@ struct hip_device
{ {
hip_device() { add_stream(); } hip_device() { add_stream(); }
hip_device(std::size_t id, std::size_t n) hip_device(std::size_t id, std::size_t n) : device_id(id)
: device_id(id)
{ {
for(std::size_t i = 0;i< n;i++) for(std::size_t i = 0; i < n; i++)
add_stream(); add_stream();
} }
...@@ -123,7 +122,10 @@ struct hip_device ...@@ -123,7 +122,10 @@ struct hip_device
struct context struct context
{ {
context(std::size_t device_id = 0, std::size_t n = 4) : current_device(std::make_shared<hip_device>(device_id, n)) {} context(std::size_t device_id = 0, std::size_t n = 4)
: current_device(std::make_shared<hip_device>(device_id, n))
{
}
hip_device& get_current_device() hip_device& get_current_device()
{ {
......
...@@ -33,16 +33,13 @@ struct wait_event ...@@ -33,16 +33,13 @@ struct wait_event
argument compute(context& ctx, const shape&, const std::vector<argument>&) const argument compute(context& ctx, const shape&, const std::vector<argument>&) const
{ {
assert(event != nullptr); assert(event != nullptr);
for(auto n:wait_for) for(auto n : wait_for)
ctx.get_stream(n).record(event.get()); ctx.get_stream(n).record(event.get());
ctx.get_stream().wait(event.get()); ctx.get_stream().wait(event.get());
return {}; return {};
} }
void finalize(context& ctx, const shape&, std::vector<shape>) void finalize(context& ctx, const shape&, std::vector<shape>) { event = create_event(); }
{
event = create_event();
}
}; };
struct set_stream struct set_stream
...@@ -79,7 +76,6 @@ void schedule_model::wait(program& p, ...@@ -79,7 +76,6 @@ void schedule_model::wait(program& p,
p.insert_instruction(ins, wait_event{wait_for}); p.insert_instruction(ins, wait_event{wait_for});
} }
static std::unordered_map<std::string, std::size_t> create_weight_map() static std::unordered_map<std::string, std::size_t> create_weight_map()
{ {
return { return {
...@@ -100,10 +96,9 @@ static const std::unordered_map<std::string, std::size_t>& weight_map() ...@@ -100,10 +96,9 @@ static const std::unordered_map<std::string, std::size_t>& weight_map()
return m; return m;
} }
std::size_t schedule_model::weight(const operation& op) const std::size_t schedule_model::weight(const operation& op) const
{ {
if (weight_map().count(op.name()) == 0) if(weight_map().count(op.name()) == 0)
return 0; return 0;
return weight_map().at(op.name()); return weight_map().at(op.name());
} }
......
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