Commit f4432f5a authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format.

parent 98ff3b74
...@@ -26,18 +26,19 @@ namespace gpu { ...@@ -26,18 +26,19 @@ namespace gpu {
template <class Derived> template <class Derived>
struct oper struct oper
{ {
std::string name() const { std::string name() const
{
const std::string& name = get_type_name<Derived>(); const std::string& name = get_type_name<Derived>();
// search the namespace gpu (::gpu::) // search the namespace gpu (::gpu::)
auto pos_ns = name.find("::gpu::"); auto pos_ns = name.find("::gpu::");
if (pos_ns != std::string::npos) if(pos_ns != std::string::npos)
{ {
auto pos_name = name.find("hip_", pos_ns + std::string("::gpu::").length()); auto pos_name = name.find("hip_", pos_ns + std::string("::gpu::").length());
if (pos_name != std::string::npos) if(pos_name != std::string::npos)
{ {
return std::string("gpu::") + name.substr(pos_name + 4); return std::string("gpu::") + name.substr(pos_name + 4);
} }
else else
{ {
return name.substr(pos_ns + 2); return name.substr(pos_ns + 2);
} }
......
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