Skip to content

Commit 8edc6f0

Browse files
SS-JIAssjia
andauthored
[ET-VK][ez] Fix vulkan_schema interface and link Vulkan to pybindings (#13327)
Summary: ## Changes First, small update to `vulkan_schema` interface in the `CMakeLists.txt`, which fixes a build error like: ``` CMake Error in backends/vulkan/CMakeLists.txt: Target "vulkan_schema" INTERFACE_INCLUDE_DIRECTORIES property contains path: "/pytorch/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out/schema/include" which is prefixed in the build directory. ``` Then, make the pybindings link against to the vulkan backend if it is built. This allows model testing through Python via `_load_for_executorch_from_buffer`. Test Plan: CI cc @manuelcandales @cbilgin --------- Co-authored-by: ssjia <[email protected]>
1 parent aa51149 commit 8edc6f0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,10 @@ if(EXECUTORCH_BUILD_PYBIND)
763763
list(APPEND _dep_libs xnnpack_backend XNNPACK xnnpack-microkernels-prod)
764764
endif()
765765

766+
if(EXECUTORCH_BUILD_VULKAN)
767+
list(APPEND _dep_libs vulkan_backend)
768+
endif()
769+
766770
# compile options for pybind
767771
set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
768772
-fexceptions

backends/vulkan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ set_target_properties(vulkan_schema PROPERTIES LINKER_LANGUAGE CXX)
101101
target_include_directories(
102102
vulkan_schema
103103
INTERFACE
104-
${SCHEMA_INCLUDE_DIR}
104+
$<BUILD_INTERFACE:${SCHEMA_INCLUDE_DIR}>
105105
$<BUILD_INTERFACE:${EXECUTORCH_ROOT}/third-party/flatbuffers/include>
106106
)
107107

backends/vulkan/runtime/gen_vulkan_spv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ def compile_spirv(shader_paths_pair) -> Tuple[str, str]:
10831083
for spv_out_path, glsl_out_path in pool.map(
10841084
compile_spirv, self.output_file_map.items()
10851085
):
1086-
print(spv_to_glsl_map)
10871086
spv_to_glsl_map[spv_out_path] = glsl_out_path
10881087

10891088
return spv_to_glsl_map

0 commit comments

Comments
 (0)