pytorch
2962fee9 - Fix/suppress a type warning in PyTorch (#55142)

Commit
3 years ago
Fix/suppress a type warning in PyTorch (#55142) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55142 Declare some functions C10_HOST_DEVICE to fix the NVCC warning. During pytorch compilation, NVCC compiler was emmiting several warnings like this one: ``` caffe2/c10/util/TypeCast.h(39): warning: calling a constexpr __host__ function from a __host__ __device__ function is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this. detected during: instantiation of "dest_t c10::static_cast_with_inter_type<dest_t, src_t>::apply(src_t) [with dest_t=c10::complex<double>, src_t=__nv_bool]" (158): here instantiation of "To c10::convert<To,From>(From) [with To=c10::complex<double>, From=__nv_bool]" (170): here instantiation of "To c10::checked_convert<To,From>(From, const char *) [with To=c10::complex<double>, From=__nv_bool]" caffe2/c10/core/Scalar.h(63): here ``` How to reproduce. - Make sure you are on remote/master - run: `buck build mode/dev-nosan caffe2/torch/fb/sparsenn:sparsenn_operators_gpu` Test Plan: - compilation completes without warnings. Reviewed By: r-barnes Differential Revision: D27469757 fbshipit-source-id: f8c4eedb637c6d487ac49bb310e48be11db204e2
Author
Vladimir Petrovic
Parents
Loading