Unverified Commit 4e11431d authored by shivadbhavsar's avatar shivadbhavsar Committed by GitHub
Browse files

Set device to current hip device when loading programs (#1561)

Currently, we default to device 0 when loading programs. Updating this to use hipGetDevice to set the device for the loaded program.
parent f57edddd
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <migraphx/gpu/hip.hpp> #include <migraphx/gpu/hip.hpp>
#include <migraphx/env.hpp> #include <migraphx/env.hpp>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
#include <migraphx/gpu/device_name.hpp>
#include <unordered_map> #include <unordered_map>
#include <memory> #include <memory>
...@@ -273,7 +274,8 @@ struct context ...@@ -273,7 +274,8 @@ struct context
auto v_streams = v.at("streams"); auto v_streams = v.at("streams");
std::size_t n_streams = v_streams.without_key().to<std::size_t>(); std::size_t n_streams = v_streams.without_key().to<std::size_t>();
this->current_device = std::make_shared<hip_device>(0, n_streams); auto device = get_device_id();
this->current_device = std::make_shared<hip_device>(device, n_streams);
} }
void wait_for(any_ptr queue) void wait_for(any_ptr queue)
......
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