pytorch
a2ef54c5 - [pytorch] fix CUDA_KERNEL_ASSERT macro for android build (#40151)

Commit
4 years ago
[pytorch] fix CUDA_KERNEL_ASSERT macro for android build (#40151) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40151 For debug android build it throws the following error: ``` In file included from src/pytorch/android/pytorch_android/src/main/cpp/pytorch_jni_common.cpp:9: In file included from src/pytorch/android/pytorch_android/src/main/cpp/pytorch_jni_common.h:2: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/torch/csrc/api/include/torch/types.h:3: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/ATen/ATen.h:5: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/ATen/Context.h:4: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/ATen/Tensor.h:3: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/ATen/core/TensorBody.h:7: In file included from ../../../../src/main/cpp/libtorch_include/armeabi-v7a/c10/core/Scalar.h:13: ../../../../src/main/cpp/libtorch_include/armeabi-v7a/c10/util/TypeCast.h:157:22: error: use of undeclared identifier '__assert_fail' AT_FORALL_QINT_TYPES(DEFINE_UNCASTABLE) ^ ``` Seems __assert_fail() isn't available on Android by default - in NDEBUG mode it forward declares the function and CI passes. But CUDA_KERNEL_ASSERT() shouldn't be relevant for mobile build at all and we already bypass `__APPLE__` so the easiest fix is to add `__ANDROID__`. Test Plan: Imported from OSS Differential Revision: D22095562 Pulled By: ljk53 fbshipit-source-id: 793108a7bc64db161a0747761c0fbd70262e7d5a
Author
Parents
Loading