Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] Use
__builtin_overflow_sub
when available (pytorch#117015)
Which is faster then ternary. Following script ```python import torch from timeit import default_timer global_setup = """ """ setup = """ c10::SymInt a = c10::SymInt(123); """ code = """ -a; """ from torch.utils.benchmark import Timer t = Timer(stmt=code, setup=setup, global_setup=global_setup, language="c++", timer=default_timer) print(t.blocked_autorange()) ``` reports 4.17 ns median type before and 3.61 ns after on x86_64 Linux and 2.02 ns before and 1.91 ns after on Apple M1 Pull Request resolved: pytorch#117015 Approved by: https://github.com/albanD
- Loading branch information