SWDEV-254363 - Checks to make sure kernel is launched on the same device as it was launched.

Change-Id: I2f273a70b1a5fc0e9fc9c6144eabd32466ff4e59
This commit is contained in:
kjayapra-amd
2020-09-28 17:53:32 -04:00
committed by Karthik Jayaprakash
parent b673a56fcb
commit c4505bede3
6 changed files with 31 additions and 22 deletions
+6 -2
View File
@@ -160,22 +160,26 @@ DynCO::~DynCO() {
delete fb_info_;
}
hipError_t DynCO::getDeviceVar(DeviceVar** dvar, std::string var_name, int device_id) {
hipError_t DynCO::getDeviceVar(DeviceVar** dvar, std::string var_name) {
amd::ScopedLock lock(dclock_);
CheckDeviceIdMatch();
auto it = vars_.find(var_name);
if (it == vars_.end()) {
DevLogPrintfError("Cannot find the Var: %s ", var_name.c_str());
return hipErrorNotFound;
}
it->second->getDeviceVar(dvar, device_id, module());
it->second->getDeviceVar(dvar, device_id_, module());
return hipSuccess;
}
hipError_t DynCO::getDynFunc(hipFunction_t* hfunc, std::string func_name) {
amd::ScopedLock lock(dclock_);
CheckDeviceIdMatch();
auto it = functions_.find(func_name);
if (it == functions_.end()) {
DevLogPrintfError("Cannot find the function: %s ", func_name.c_str());