Skip to content

Commit

Permalink
Temporary workaround to implement type_name in a naive way
Browse files Browse the repository at this point in the history
  • Loading branch information
caugonnet committed Oct 13, 2024
1 parent 80e80ff commit 35752d0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cudax/include/cuda/experimental/__stf/utility/traits.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace reserved
template <class T>
constexpr ::std::string_view type_name();

#if 0
// This function is used as a baseline; technically returns an incorrect result but is never used in anger.
template <>
constexpr ::std::string_view type_name<_71d56d6539c0fd76d1af6c69e4e511a>()
Expand Down Expand Up @@ -62,6 +63,16 @@ constexpr ::std::string_view type_name()
return p.substr(type_name_affixes.first, p.size() - type_name_affixes.first - type_name_affixes.second);
}

#else
// This yields the correct result for all types except `_71d56d6539c0fd76d1af6c69e4e511a`.
template <class T>
constexpr ::std::string_view type_name()
{
constexpr ::std::string_view p = __PRETTY_FUNCTION__;
return p;
}
#endif

} // namespace reserved

/**
Expand Down

0 comments on commit 35752d0

Please sign in to comment.