mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[c10] Make __assert_fail CUDA definition compilable with clang host compiler (#34102)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34102 if nvcc is invoked with clang host compiler, it will fail with the following error due to the decorators mismatch defined in cuda and c10: ``` error: attribute "noreturn" did not appear on original declaration ``` Test Plan: Build pytorch with clang Reviewed By: EscapeZero Differential Revision: D20204951 fbshipit-source-id: ff7cef0db43436e50590cb4bbf1ae7302c1440fa
This commit is contained in:
parent
8a14b41617
commit
0689cf8fc1
|
|
@ -218,7 +218,9 @@ constexpr uint32_t CUDA_THREADS_PER_BLOCK_FALLBACK = 256;
|
||||||
#else // __APPLE__, _MSC_VER
|
#else // __APPLE__, _MSC_VER
|
||||||
#if defined(NDEBUG)
|
#if defined(NDEBUG)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#if defined(__CUDA_ARCH__) || !defined(__clang__)
|
||||||
[[noreturn]]
|
[[noreturn]]
|
||||||
|
#endif
|
||||||
#if defined(__CUDA_ARCH__) || defined(__HIP_ARCH__) || defined(__HIP__)
|
#if defined(__CUDA_ARCH__) || defined(__HIP_ARCH__) || defined(__HIP__)
|
||||||
__host__ __device__
|
__host__ __device__
|
||||||
#endif // __CUDA_ARCH__
|
#endif // __CUDA_ARCH__
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user