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

fix(opencl): fix opencl search algo negative stride support

GitOrigin-RevId: 0642d1718d056337a8a68c7c940955de9f1bfa88
上级 4f3875eb
......@@ -667,6 +667,22 @@ struct CompTypeCvter {
return m_workspace_bundle->get_workspace(m_workspace_idx);
}
};
/*!
* \brief get TensorND raw_ptr+low_byte pointer.
*/
inline dt_byte* get_low_ptr(const TensorND* tensor) {
return static_cast<dt_byte*>(tensor->raw_ptr) +
tensor->layout.span().low_byte;
}
/*!
* \brief get the zero element pointer of TensorND.
*/
inline void* get_origin_ptr(const TensorND* tensor, void* ptr) {
return static_cast<void*>(static_cast<dt_byte*>(ptr) -
tensor->layout.span().low_byte);
}
} // namespace megdnn
// vim: syntax=cpp.doxygen
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册