Skip to content

Commit

Permalink
[refactor] Remove useless Kernel::from_cache_ (taichi-dev#7132)
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB authored and quadpixels committed May 13, 2023
1 parent 574a809 commit 6827ec0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
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

0 comments on commit 6827ec0

Please sign in to comment.