提交 cc952b2b 编写于 作者: M Megvii Engine Team

fix(rocm): fix rocm megdnntest sleep and a cut code

GitOrigin-RevId: 26de5ca98b28bf93da5c3e9f30c0197eda6d9077
上级 3a03fa7a
...@@ -22,7 +22,7 @@ void SleepForwardImpl::exec() { ...@@ -22,7 +22,7 @@ void SleepForwardImpl::exec() {
double seconds = m_param.time; double seconds = m_param.time;
megdnn_assert(seconds > 0); megdnn_assert(seconds > 0);
auto hdl = static_cast<HandleImpl*>(handle()); auto hdl = static_cast<HandleImpl*>(handle());
sleep(hdl->stream(), hdl->device_prop().clockRate * 18.01 * seconds); sleep(hdl->stream(), hdl->device_prop().clockRate * 1000 * seconds);
} }
} // namespace rocm } // namespace rocm
......
...@@ -121,6 +121,17 @@ std::string PersistentCache::make_category_from_comp_node(CompNode comp_node) { ...@@ -121,6 +121,17 @@ std::string PersistentCache::make_category_from_comp_node(CompNode comp_node) {
prop.name, prop.major, prop.minor, drv, cuda_rt); prop.name, prop.major, prop.minor, drv, cuda_rt);
break; break;
} }
#endif
#if MGB_ROCM
case CompNode::DeviceType::ROCM: {
int drv = -1, hip_rt = -1;
MGB_ROCM_CHECK(hipDriverGetVersion(&drv));
MGB_ROCM_CHECK(hipRuntimeGetVersion(&hip_rt));
auto&& prop = env.rocm_env().device_prop;
return ssprintf("plat=rocm;dev=%s;cap=%d.%d,drv=%d;runtime=%d",
prop.name, prop.major, prop.minor, drv, hip_rt);
break;
}
#endif #endif
case CompNode::DeviceType::CPU: case CompNode::DeviceType::CPU:
return "plat=cpu"; return "plat=cpu";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册