Skip to content

Commit

Permalink
[RFC] Generate generated_unboxing_wrappers_everything.cpp for unboxin…
Browse files Browse the repository at this point in the history
…g wrappers codegen to aid debugging (#45872)

Summary:
Pull Request resolved: #45872

`VariableType_N.cpp` is generated in a sharded manner to speed up compilationt time. Same for `generated_unboxing_wrappers_N.cpp`. However, `VariableTypeEverything.cpp` exists, but `generated_unboxing_wrappers_everything.cpp` does not. These files have all the registration/implementation code in them for easier debugging of codegen logic.

This diff adds `generated_unboxing_wrappers_everything.cpp`.

ghstack-source-id: 113606771

Test Plan: Build + CI

Reviewed By: iseeyuan

Differential Revision: D24124405

fbshipit-source-id: 1f6c938105e17cd4b14502978483a1b178c777dd
  • Loading branch information
dhruvbird authored and facebook-github-bot committed Oct 13, 2020
1 parent 5c67cc7 commit 6ef4195
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/jit/gen_unboxing_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import argparse
import re
from itertools import groupby
from functools import reduce
from ..autograd.gen_autograd import load_aten_declarations
from ..autograd.gen_autograd import RETURNS_VIEWS_OF_INPUT
from ..autograd.utils import CodeTemplate, write, is_out_variant, op_name_without_overload
Expand Down Expand Up @@ -496,6 +497,15 @@ def expand_options(decl, i, arg):
}
write(out, 'generated_unboxing_wrappers_%d.cpp' % i, GENERATED_UNBOXING_WRAPPERS_CPP, env)

all_shards = reduce(
lambda lhs, rhs: lhs + rhs,
shards,
)
env = {
'constructors': all_shards,
}
write(out, 'generated_unboxing_wrappers_everything.cpp', GENERATED_UNBOXING_WRAPPERS_CPP, env)


default_map = {'{}': 'None', 'nullptr': 'None', 'c10::nullopt': 'None'}

Expand Down

0 comments on commit 6ef4195

Please sign in to comment.