From 6827ec0630116496ab786f551cfa738f0ee240e2 Mon Sep 17 00:00:00 2001 From: PGZXB Date: Thu, 12 Jan 2023 11:10:11 +0800 Subject: [PATCH] [refactor] Remove useless Kernel::from_cache_ (#7132) Issue: #7002 --- taichi/cache/gfx/cache_manager.cpp | 2 -- taichi/codegen/codegen.cpp | 1 - taichi/program/kernel.h | 5 ----- 3 files changed, 8 deletions(-) diff --git a/taichi/cache/gfx/cache_manager.cpp b/taichi/cache/gfx/cache_manager.cpp index a06bb5d43974d..bdb5fca6ab2b4 100644 --- a/taichi/cache/gfx/cache_manager.cpp +++ b/taichi/cache/gfx/cache_manager.cpp @@ -252,7 +252,6 @@ std::optional 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; @@ -262,7 +261,6 @@ std::optional 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(aot_kernel); auto compiled = aot_kernel_impl->params(); // TODO: Support multiple SNodeTrees in AOT. diff --git a/taichi/codegen/codegen.cpp b/taichi/codegen/codegen.cpp index f73e825576932..817d0eed75a50 100644 --- a/taichi/codegen/codegen.cpp +++ b/taichi/codegen/codegen.cpp @@ -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)}; } diff --git a/taichi/program/kernel.h b/taichi/program/kernel.h index 26386eb35fa56..874af7034e2c7 100644 --- a/taichi/program/kernel.h +++ b/taichi/program/kernel.h @@ -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) { @@ -145,7 +141,6 @@ class TI_DLL_EXPORT Kernel : public Callable { bool lowered_{false}; std::atomic task_counter_{0}; std::string kernel_key_; - bool from_cache_{false}; }; } // namespace taichi::lang