Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Remove PyTaichi.compiled_functions #7867

Merged
merged 2 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions python/taichi/lang/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ class PyTaichi:
def __init__(self, kernels=None):
self.materialized = False
self.prog = None
self.compiled_functions = {}
self.src_info_stack = []
self.inside_kernel = False
self.compiling_callable = None # pointer to instance of lang::Kernel/Function
Expand All @@ -336,7 +335,8 @@ def initialize_fields_builder(self, builder):
self.unfinalized_fields_builder[builder] = get_traceback(2)

def clear_compiled_functions(self):
self.compiled_functions.clear()
for k in self.kernels:
k.compiled_kernels.clear()

def finalize_fields_builder(self, builder):
self.unfinalized_fields_builder.pop(builder)
Expand All @@ -351,7 +351,10 @@ def validate_fields_builder(self):
)

def get_num_compiled_functions(self):
return len(self.compiled_functions)
count = 0
for k in self.kernels:
count += len(k.compiled_kernels)
return count

def src_info_guard(self, info):
return SrcInfoGuard(self.src_info_stack, info)
Expand Down
Loading
Loading