Skip to content

Commit d588947

Browse files
Msvc inline macros (pytorch#15197)
### Summary Add MSVC support to inline macro ### Test plan Manual testing for now. Will add CI support when I get a full msvc build working.
1 parent bdc9cef commit d588947

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runtime/platform/compiler.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@
5555
*/
5656

5757
#define ET_NORETURN [[noreturn]]
58+
59+
// Inline/NoInline
60+
#if defined(_MSC_VER)
61+
#define ET_NOINLINE __declspec(noinline)
62+
#define ET_INLINE __forceinline
63+
#else
5864
#define ET_NOINLINE __attribute__((noinline))
5965
#define ET_INLINE __attribute__((always_inline)) inline
60-
#define ET_INLINE_ATTRIBUTE __attribute__((always_inline))
66+
#endif
6167

6268
#if defined(__GNUC__)
6369

0 commit comments

Comments
 (0)