Skip to content

[ET-VK] Support setting cache_data_path at build time #11359

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

Merged
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
5 changes: 5 additions & 0 deletions backends/vulkan/runtime/vk_api/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,12 @@ std::string& set_and_get_pipeline_cache_data_path(
const std::string& file_path) {
// The global cache data path is declared as a static local variable for the
// same reasons as the global runtime below.
#if defined(ETVK_DEFAULT_CACHE_PATH)
static std::string global_cache_data_path = ETVK_DEFAULT_CACHE_PATH;
#else
static std::string global_cache_data_path;
#endif /* ETVK_DEFAULT_CACHE_PATH */

if (file_path.size() > 0) {
global_cache_data_path = file_path;
}
Expand Down
4 changes: 4 additions & 0 deletions backends/vulkan/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ def define_common_targets(is_fbcode = False):
"ovr_config//os:macos": mac_flags,
})

etvk_default_cache_path = read_config("etvk", "default_cache_path", "")
if etvk_default_cache_path != "":
VK_API_PREPROCESSOR_FLAGS += ["-DETVK_DEFAULT_CACHE_PATH={}".format(etvk_default_cache_path)]

debug_mode = read_config("etvk", "debug", "0") == "1"
if debug_mode:
VK_API_PREPROCESSOR_FLAGS += ["-DVULKAN_DEBUG"]
Expand Down
Loading