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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] Remove useless Kernel::from_cache_ #7132

Merged
merged 1 commit into from
Jan 12, 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
2 changes: 0 additions & 2 deletions taichi/cache/gfx/cache_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ std::optional<CompiledKernelData> CacheManager::try_load_cached_kernel(
if (params_opt.has_value()) {
TI_DEBUG("Create kernel '{}' from in-memory cache (key='{}')",
kernel->get_name(), key);
kernel->mark_as_from_cache();
// TODO: Support multiple SNodeTrees in AOT.
params_opt->num_snode_trees = compiled_structs_.size();
return params_opt;
Expand All @@ -262,7 +261,6 @@ std::optional<CompiledKernelData> CacheManager::try_load_cached_kernel(
if (auto *aot_kernel = cached_module_->get_kernel(key)) {
TI_DEBUG("Create kernel '{}' from cache (key='{}')", kernel->get_name(),
key);
kernel->mark_as_from_cache();
auto *aot_kernel_impl = static_cast<gfx::KernelImpl *>(aot_kernel);
auto compiled = aot_kernel_impl->params();
// TODO: Support multiple SNodeTrees in AOT.
Expand Down
1 change: 0 additions & 1 deletion taichi/codegen/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ KernelCodeGen::maybe_read_compilation_from_cache(
if (!reader->get_kernel_cache(cache_data, kernel_key, llvm_ctx)) {
return std::nullopt;
}
kernel->mark_as_from_cache();
return {std::move(cache_data.compiled_data)};
}

Expand Down
5 changes: 0 additions & 5 deletions taichi/program/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ class TI_DLL_EXPORT Kernel : public Callable {
return task_counter_++;
}

void mark_as_from_cache() {
from_cache_ = true;
}

[[nodiscard]] std::string get_name() const override;

void set_kernel_key_for_cache(const std::string &kernel_key) {
Expand Down Expand Up @@ -145,7 +141,6 @@ class TI_DLL_EXPORT Kernel : public Callable {
bool lowered_{false};
std::atomic<uint64> task_counter_{0};
std::string kernel_key_;
bool from_cache_{false};
};

} // namespace taichi::lang