mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/29730 Back in the day, Caffe2 had a good idea: instead of spattering target_compile_options all over the codebase, define a helper function which sets all the options for a target. This is especially helpful if I want to split libtorch.so into libtorch_cpu.so and libtorch_cuda.so; I need a way to easily apply options to multiple targets. A shared helper function is just the ticket. I moved every target_compile_options call in caffe2/CMakeLists.txt that didn't seem target dependent (exclusions included OpenMP flags, API-related macros, ONNX related macros and HIP flags) into torch_compile_options. I slavishly preserved the structure: there's a nearly redundant WERROR if() in the output but I preserved it. There is one thing I don't like about this, which is that now the compile options are off in a random directory that no one would expect. But c'est la vie... Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Differential Revision: D18571166 Pulled By: ezyang fbshipit-source-id: 21cd5f7663485077600782078fbb1787fab09035 |
||
|---|---|---|
| .. | ||
| External | ||
| Modules | ||
| Modules_CUDA_fix | ||
| public | ||
| BuildVariables.cmake | ||
| Caffe2Config.cmake.in | ||
| Caffe2ConfigVersion.cmake.in | ||
| cmake_uninstall.cmake.in | ||
| Codegen.cmake | ||
| Dependencies.cmake | ||
| GoogleTestPatch.cmake | ||
| iOS.cmake | ||
| MiscCheck.cmake | ||
| ProtoBuf.cmake | ||
| ProtoBufPatch.cmake | ||
| Summary.cmake | ||
| TorchConfig.cmake.in | ||
| TorchConfigVersion.cmake.in | ||
| Utils.cmake | ||
| Whitelist.cmake | ||