Skip to content

Commit faab497

Browse files
committed
Update on "[ET-VK] Introduce no_volk buck targets"
TSIA. Introduce variants of the vulkan backend buck targets that do not use volk. Differential Revision: [D65827152](https://our.internmc.facebook.com/intern/diff/D65827152/) [ghstack-poisoned]
2 parents 4561852 + 00ba011 commit faab497

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

backends/vulkan/runtime/vk_api/Device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct PhysicalDevice final {
2727
VkPhysicalDeviceMemoryProperties memory_properties;
2828

2929
// Head of the linked list of extensions to be requested
30-
void* extension_features{nullptr};
30+
void* extension_features;
3131

3232
// Additional features available from extensions
3333
#ifdef VK_KHR_16bit_storage

backends/vulkan/targets.bzl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
load("@fbcode//target_determinator/macros:ci.bzl", "ci")
12
load("@fbcode_macros//build_defs:native_rules.bzl", "buck_genrule")
23
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
4+
load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "CXX", "FBCODE")
5+
36

47
def get_vulkan_compiler_flags():
58
return ["-Wno-missing-prototypes", "-Wno-global-constructors"]
@@ -43,12 +46,21 @@ def vulkan_spv_shader_lib(name, spv_filegroups, is_fbcode = False, no_volk = Fal
4346
)
4447

4548
suffix = "_no_volk" if no_volk else ""
49+
platforms = [ANDROID, CXX]
50+
labels = []
51+
if no_volk:
52+
platforms = [ANDROID]
53+
labels = ci.labels(ci.linux(ci.mode("fbsource//arvr/mode/android/mac/dbg")))
54+
55+
4656
runtime.cxx_library(
4757
name = name,
4858
srcs = [
4959
":{}[{}.cpp]".format(genrule_name, name),
5060
],
5161
compiler_flags = get_vulkan_compiler_flags(),
62+
labels = labels,
63+
platforms = platforms,
5264
define_static_target = False,
5365
# Static initialization is used to register shaders to the global shader registry,
5466
# therefore link_whole must be True to make sure unused symbols are not discarded.
@@ -91,8 +103,18 @@ def define_common_targets(is_fbcode = False):
91103
)
92104

93105
for no_volk in [True, False]:
106+
# No volk not available for FBCode
107+
if no_volk and is_fbcode:
108+
continue
109+
94110
suffix = "_no_volk" if no_volk else ""
95111

112+
platforms = [ANDROID, CXX]
113+
labels = []
114+
if no_volk:
115+
platforms = [ANDROID]
116+
labels = ci.labels(ci.linux(ci.mode("fbsource//arvr/mode/android/mac/dbg")))
117+
96118
VK_API_PREPROCESSOR_FLAGS = []
97119
VK_API_DEPS = [
98120
"fbsource//third-party/VulkanMemoryAllocator/3.0.1:VulkanMemoryAllocator_xplat",
@@ -148,6 +170,8 @@ def define_common_targets(is_fbcode = False):
148170
"runtime/utils/**/*.h",
149171
"runtime/vk_api/**/*.h",
150172
]),
173+
labels = labels,
174+
platforms = platforms,
151175
visibility = [
152176
"//executorch/backends/vulkan/...",
153177
"@EXECUTORCH_CLIENTS",
@@ -165,6 +189,8 @@ def define_common_targets(is_fbcode = False):
165189
exported_headers = native.glob([
166190
"runtime/graph/**/*.h",
167191
]),
192+
labels = labels,
193+
platforms = platforms,
168194
visibility = [
169195
"//executorch/backends/...",
170196
"//executorch/extension/pybindings/...",
@@ -202,6 +228,8 @@ def define_common_targets(is_fbcode = False):
202228
headers = native.glob([
203229
"runtime/*.h",
204230
]),
231+
labels = labels,
232+
platforms = platforms,
205233
visibility = [
206234
"//executorch/backends/...",
207235
"//executorch/extension/pybindings/...",

backends/vulkan/test/compute_api_tests.bzl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
load("@fbcode//target_determinator/macros:ci.bzl", "ci")
12
load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary")
23
load("@fbsource//tools/build_defs:fb_xplat_cxx_test.bzl", "fb_xplat_cxx_test")
3-
load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "MACOSX")
4+
load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "MACOSX", "CXX")
45
load(
56
"@fbsource//xplat/executorch/backends/vulkan:targets.bzl",
67
"vulkan_spv_shader_lib",
@@ -9,6 +10,12 @@ load(
910
def define_compute_api_test_targets():
1011
for no_volk in [True, False]:
1112
suffix = "_no_volk" if no_volk else ""
13+
platforms = [ANDROID, CXX]
14+
labels = []
15+
if no_volk:
16+
platforms = [ANDROID]
17+
labels = ci.labels(ci.linux(ci.mode("fbsource//arvr/mode/android/mac/dbg")))
18+
1219
vulkan_spv_shader_lib(
1320
name = "test_shader_lib{}".format(suffix),
1421
spv_filegroups = {
@@ -27,6 +34,8 @@ def define_compute_api_test_targets():
2734
"utils/test_utils.h",
2835
],
2936
apple_sdks = MACOSX,
37+
labels = labels,
38+
platforms = platforms,
3039
visibility = ["PUBLIC"],
3140
deps = [
3241
":test_shader_lib{}".format(suffix),

0 commit comments

Comments
 (0)