Skip to content

Commit

Permalink
Fix global namespace pollution in ATen/Dispatch.h (#13)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookexternal/DRTK#2

Pull Request resolved: #13

X-link: pytorch/pytorch#138626

Was it a typo? Since we already have `at::detail` in `ATen/Dispatch.h`

Deleting `::detail` all together, we don't need the functions in it anymore.

Reviewed By: malfet

Differential Revision: D64642080

fbshipit-source-id: 9ae48a888a854ec85e1caef53d87e6e3cc81591b
  • Loading branch information
slyfox3 authored and facebook-github-bot committed Jan 15, 2025
1 parent 4e833ae commit f0637eb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/include/kernel_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ inline int GET_BLOCKS(const int64_t N, const int64_t max_threads_per_block = CUD
// Dispatches for float and double
#define AT_DISPATCH_FLOATING_TYPES(TYPE, NAME, ...) \
[&] { \
const auto& the_type = TYPE; \
const at::ScalarType _st = TYPE; \
/* don't use TYPE again in case it is an expensive or side-effect op */ \
at::ScalarType _st = ::detail::scalar_type(the_type); \
switch (_st) { \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Double, double, __VA_ARGS__) \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Float, float, __VA_ARGS__) \
Expand All @@ -60,9 +59,8 @@ inline int GET_BLOCKS(const int64_t N, const int64_t max_threads_per_block = CUD
// Dispatches for float, double, and half
#define AT_DISPATCH_FLOATING_TYPES_AND_HALF(TYPE, NAME, ...) \
[&] { \
const auto& the_type = TYPE; \
const at::ScalarType _st = TYPE; \
/* don't use TYPE again in case it is an expensive or side-effect op */ \
at::ScalarType _st = ::detail::scalar_type(the_type); \
switch (_st) { \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Double, double, __VA_ARGS__) \
AT_PRIVATE_CASE_TYPE(at::ScalarType::Float, float, __VA_ARGS__) \
Expand Down

0 comments on commit f0637eb

Please sign in to comment.