You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

cache_parse.h 1.2 kB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * \file src/parse_info/cache_parse.h
  3. * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
  4. *
  5. * Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
  6. *
  7. * Unless required by applicable law or agreed to in writing,
  8. * software distributed under the License is distributed on an
  9. * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. */
  11. #pragma once
  12. #include "lite/global.h"
  13. #if LITE_BUILD_WITH_MGE
  14. #include "megbrain/utils/infile_persistent_cache.h"
  15. #endif
  16. namespace lite {
  17. //! The LITE_parse_cache parse info function
  18. bool parse_info_cache(
  19. const uint8_t* cache, size_t cache_length, bool is_fast_run_cache = true,
  20. const uint8_t* binary_cache = nullptr, size_t binary_cache_length = 0) {
  21. LITE_MARK_USED_VAR(binary_cache);
  22. LITE_MARK_USED_VAR(binary_cache_length);
  23. #if LITE_BUILD_WITH_MGE
  24. if (is_fast_run_cache) {
  25. mgb::PersistentCache::set_impl(
  26. std::make_shared<mgb::InFilePersistentCache>(cache, cache_length));
  27. }
  28. #endif
  29. return true;
  30. }
  31. } // namespace lite
  32. // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}