-
Notifications
You must be signed in to change notification settings - Fork 979
Expand file tree
/
Copy pathGraphConfig.h
More file actions
47 lines (34 loc) · 1.43 KB
/
GraphConfig.h
File metadata and controls
47 lines (34 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <executorch/backends/vulkan/runtime/api/api.h>
namespace vkcompute {
struct GraphConfig final {
api::ContextConfig context_config;
// Creating a descriptor pool with exactly the number of descriptors tallied
// by iterating through the shader layouts of shaders used in the graph risks
// the descriptor pool running out of memory, therefore apply a safety factor
// to descriptor counts when creating the descriptor pool to mitigate this
// risk.
float descriptor_pool_safety_factor;
bool enable_storage_type_override;
utils::StorageType storage_type_override;
bool enable_memory_layout_override;
utils::GPUMemoryLayout memory_layout_override;
bool enable_querypool;
bool enable_local_wg_size_override;
utils::uvec3 local_wg_size_override;
// Whether or not the ComputeGraph should expect input shapes to be dynamic
bool expect_dynamic_shapes;
// Generate a default graph config with pre-configured settings
explicit GraphConfig();
void set_storage_type_override(utils::StorageType storage_type);
void set_memory_layout_override(utils::GPUMemoryLayout memory_layout);
void set_local_wg_size_override(const utils::uvec3& local_wg_size);
};
} // namespace vkcompute