Skip to content

Commit 9f46bb8

Browse files
committed
[ET-VK] Allow clients to specify cache_data_path
Differential Revision: [D75918105](https://our.internmc.facebook.com/intern/diff/D75918105/) ghstack-source-id: 288025343 Pull Request resolved: #11350
1 parent d469d6b commit 9f46bb8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

backends/vulkan/runtime/vk_api/Runtime.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ uint32_t select_first(const std::vector<Runtime::DeviceMapping>& devices) {
258258
// Global runtime initialization
259259
//
260260

261-
std::unique_ptr<Runtime> init_global_vulkan_runtime() {
261+
std::unique_ptr<Runtime> init_global_vulkan_runtime(const std::string& cache_data_path) {
262262
// Load Vulkan drivers
263263
#if defined(USE_VULKAN_VOLK)
264264
if (VK_SUCCESS != volkInitialize()) {
@@ -278,7 +278,6 @@ std::unique_ptr<Runtime> init_global_vulkan_runtime() {
278278
#endif /* VULKAN_DEBUG */
279279
const bool init_default_device = true;
280280
const uint32_t num_requested_queues = 1; // TODO: raise this value
281-
const std::string cache_data_path = ""; // TODO: expose to client
282281

283282
const RuntimeConfig default_config{
284283
enable_validation_messages,
@@ -377,13 +376,13 @@ uint32_t Runtime::create_adapter(const Selector& selector) {
377376
return adapter_i;
378377
}
379378

380-
Runtime* runtime() {
379+
Runtime* runtime(const std::string& cache_data_path) {
381380
// The global vulkan runtime is declared as a static local variable within a
382381
// non-static function to ensure it has external linkage. If it were a global
383382
// static variable there would be one copy per translation unit that includes
384383
// Runtime.h as it would have internal linkage.
385384
static const std::unique_ptr<Runtime> p_runtime =
386-
init_global_vulkan_runtime();
385+
init_global_vulkan_runtime(cache_data_path);
387386

388387
VK_CHECK_COND(
389388
p_runtime,

backends/vulkan/runtime/vk_api/Runtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Runtime final {
102102

103103
// The global runtime is retrieved using this function, where it is declared as
104104
// a static local variable.
105-
Runtime* runtime();
105+
Runtime* runtime(const std::string& cache_data_path = "");
106106

107107
} // namespace vkapi
108108
} // namespace vkcompute

0 commit comments

Comments
 (0)