mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[PyTorch] s/__attribute__((__noinline__))/__attribute__((noinline))/ (#52362)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52362
AFAICT, it is documented to be the latter and not the former.
GCC: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
Clang: https://clang.llvm.org/docs/AttributeReference.html
Both versions work in the oldest and newest GCC & Clang versions on Godbolt: https://godbolt.org/z/s6f4PW
So why change?
1) lack of underscores matches the documentation
2) AMD HIP defines `__noinline__` as a macro, which doesn't play well with the underscore version.
See 2080cc113a/include/hip/hcc_detail/host_defines.h (L54)
ghstack-source-id: 121875424
Test Plan: Rely on existing CI
Reviewed By: bhosmer
Differential Revision: D26488991
fbshipit-source-id: 6cfcdfd41c58170659e263cd519ac5359ffd5d46
This commit is contained in:
parent
f7aa88b400
commit
eaad002cf6
|
|
@ -179,7 +179,7 @@ namespace at { namespace cuda { using namespace c10::hip; }}
|
|||
/// C10_NOINLINE - Functions whose declaration is annotated with this will not
|
||||
/// be inlined.
|
||||
#ifdef __GNUC__
|
||||
#define C10_NOINLINE __attribute__((__noinline__))
|
||||
#define C10_NOINLINE __attribute__((noinline))
|
||||
#elif _MSC_VER
|
||||
#define C10_NOINLINE __declspec(noinline)
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user