pytorch
a7ddd15d - fix static dispatch linker error (#53859)

Commit
3 years ago
fix static dispatch linker error (#53859) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/53859 The redispatch API wasn't linking properly when static dispatch is enabled. I'm still not sure why this wasn't caught by the static dispatch test in CI- maybe, as swolchok pointed out, we have a flag set somewhere that defers undefined symbols until runtime. Before, building with static dispatch enabled locally + running `import torch` gave me this error: ``` >>> import torch Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/raid/hirsheybar/pytorch/torch/__init__.py", line 197, in <module> from torch._C import * ImportError: /raid/hirsheybar/pytorch/torch/lib/libtorch_cpu.so: undefined symbol: _ZN2at10redispatch11logical_or_EN3c1014DispatchKeySetERNS_6TensorERKS3_ >>> ``` Printing the symbol: ``` (pytorch) hirsheybar@devfair017:/scratch/hirsheybar/pytorch$ c++filt _ZN2at10redispatch11logical_or_EN3c1014DispatchKeySetERNS_6TensorERKS3_ at::redispatch::logical_or_(c10::DispatchKeySet, at::Tensor&, at::Tensor const&) ``` Sure enough, the functions defined in `RedispatchFunctions.cpp` don't have the DispatchKeySet argument included. Adding them in this PR. Test Plan: Imported from OSS Reviewed By: ljk53 Differential Revision: D26998735 Pulled By: bdhirsh fbshipit-source-id: c6c1104e42d13b7ec9d964b7e08d2adc8b344b78
Author
Parents
Loading