From d789fd929b382b39c93a82ff7085efd44646fda6 Mon Sep 17 00:00:00 2001 From: Michael Ranieri Date: Fri, 13 Dec 2024 17:12:57 -0800 Subject: [PATCH] compiler builtin detection failing for nvcc Summary: cuda 12.5 & platform010 w/ clang-15 seem to choke on this builtin. It seems like NVCC started to incorrectly report that it supports this builtin, but then doesn't provide the implementation. It seems like this builtin is very rarely used in fbsource. I can only find one reference: https://www.internalfb.com/code/fbsource/[df6fa76c6cd1d4956407c84ee5cf1f645255cb98]/xplat/thrift/lib/cpp/util/VarintUtils-inl.h?lines=474 so the surface area for failures should be pretty small Reviewed By: Gownta Differential Revision: D67039459 fbshipit-source-id: a2b9ebcb5dec12de2bdd7b95686da3c7a50764bd --- third-party/folly/src/folly/lang/Hint-inl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/folly/src/folly/lang/Hint-inl.h b/third-party/folly/src/folly/lang/Hint-inl.h index 259051e0ad8581..2c207a55165b62 100644 --- a/third-party/folly/src/folly/lang/Hint-inl.h +++ b/third-party/folly/src/folly/lang/Hint-inl.h @@ -51,7 +51,7 @@ FOLLY_ALWAYS_INLINE void compiler_may_unsafely_assume_separate_storage( void const* const a, void const* const b) { FOLLY_SAFE_DCHECK( a != b, "compiler-hint separate storage assumption fails at runtime"); -#if FOLLY_HAS_BUILTIN(__builtin_assume_separate_storage) +#if FOLLY_HAS_BUILTIN(__builtin_assume_separate_storage) && !defined(__CUDACC__) __builtin_assume_separate_storage(a, b); #endif }