[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:
Nikita Shulga 2020-03-02 20:08:53 -08:00 committed by Facebook Github Bot
parent 8a14b41617
commit 0689cf8fc1

View File

@ -218,7 +218,9 @@ constexpr uint32_t CUDA_THREADS_PER_BLOCK_FALLBACK = 256;
#else // __APPLE__, _MSC_VER
#if defined(NDEBUG)
extern "C" {
#if defined(__CUDA_ARCH__) || !defined(__clang__)
[[noreturn]]
#endif
#if defined(__CUDA_ARCH__) || defined(__HIP_ARCH__) || defined(__HIP__)
__host__ __device__
#endif // __CUDA_ARCH__