Fix undefined __assert_fail on FreeBSD (#111761)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111761
Approved by: https://github.com/Skylion007
This commit is contained in:
cyy 2023-10-23 12:46:00 +00:00 committed by PyTorch MergeBot
parent 1eb6c4314b
commit e676ec2fe7

View File

@ -333,7 +333,7 @@ constexpr uint32_t CUDA_THREADS_PER_BLOCK_FALLBACK = 256;
// CUDA_KERNEL_ASSERT checks the assertion
// even when NDEBUG is defined. This is useful for important assertions in CUDA
// code that would otherwise be suppressed when building Release.
#if defined(__ANDROID__) || defined(__APPLE__) || \
#if defined(__ANDROID__) || defined(__APPLE__) || defined(__FreeBSD__) || \
(defined(USE_ROCM) && ROCM_VERSION < 40100)
// Those platforms do not support assert()
#define CUDA_KERNEL_ASSERT(cond)