pytorch
bf53784e - Treat cross-execution-space-call as errors for NVCC on Windows (#37302)

Commit
5 years ago
Treat cross-execution-space-call as errors for NVCC on Windows (#37302) Summary: On Windows, when you call those unsupported functions like `std::pow`, `std::isnan` or `std::isinf` in the device function and compile, a warning is thrown: ``` kernel.cu kernel.cu(39): warning: calling a __host__ function from a __host__ __device__ function is not allowed kernel.cu(42): warning: calling a __host__ function from a __host__ __device__ function is not allowed kernel.cu(39): warning: calling a __host__ function("isnan<double> ") from a __host__ __device__ function("test_") is not allowed kernel.cu(42): warning: calling a __host__ function("isinf<double> ") from a __host__ __device__ function("test_") is not allowed ``` However, those calls will lead to runtime errors, see https://github.com/pytorch/pytorch/pull/36749#issuecomment-619239788 and https://github.com/pytorch/pytorch/issues/31108. So we should treat them as errors. Previously, the situation is worse because the warnings are turned off by passing in `-w`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/37302 Differential Revision: D21297207 Pulled By: ngimel fbshipit-source-id: 822b8a98c10e54c38319674763b6681db21c1021
Author
Parents
Loading