Skip to content

Commit 886579a

Browse files
Revert "Use static_assert to detect get_type_index used in device code (pytorch#139173)"
This reverts commit d391ed3. Reverted pytorch#139173 on behalf of https://github.com/facebook-github-bot due to Diff reverted internally ([comment](pytorch#139173 (comment)))
1 parent ac7acfb commit 886579a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

c10/util/TypeIndex.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ inline constexpr type_index get_type_index() {
100100
uint64_t,
101101
detail::type_index_impl<std::decay_t<T>>()>::value};
102102
#else
103-
static_assert(false && sizeof(T));
104-
return {};
103+
// There's nothing in theory preventing us from running this on device code
104+
// except for nvcc throwing a compiler error if we enable it.
105+
return (abort(), type_index(0));
105106
#endif
106107
}
107108

0 commit comments

Comments
 (0)