SIGN IN SIGN UP

Set up CMake build for Vulkan Delegate (#2179)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/2179

## Context

This PR sets up the CMake build for the Vulkan delegate. It adds the following files:

* `executorch/backends/vulkan/cmake/ATenVulkan.cmake`, which defines the following libraries that uses source files from the `pytorch` third party repository:
    * `vulkan_api_lib`: compiles everything under `pytorch/aten/src/ATen/native/vulkan/api`
    * `vulkan_shader_lib`: contains compiled SPIR-V binaries as well as everything under `pytorch/aten/src/ATen/native/vulkan/impl`
* `executorch/backends/vulkan/cmake/ATenVulkan.cmake`, which defines the following libraries:
  * `vulkan_graph_runtime`: compiles everything under `executorch/backends/vulkan/runtime/graph`
  * `vulkan_schema`: compiles the generated headers from `executorch/backends/vulkan/runtime/serialization/schema.fbs`
  * `vulkan_backend`: compiles C++ files under `executorch/backends/vulkan/runtime`
  * (Optional) `vulkan_compute_api_test`: executable compiled from `executorch/backends/vulkan/test/vulkan_compute_api_test.cpp`

The following options have been added to the root `CMakeLists.txt` to support building the Vulkan delegate:

* `EXECUTORCH_BUILD_VULKAN`: triggers building of all aforementioned targets
* `EXECUTORCH_BUILD_VULKAN_TESTS`: triggers building of `vulkan_compute_api_test`

I verified that the added targets can build on a linux machine as well as using the Android toolchain (NDK r20). `vulkan_compute_api_test` was able to run and pass tests successfully on both linux and Android.

imported-using-ghimport

Test Plan: Imported from OSS

Reviewed By: larryliu0820

Differential Revision: D54390748

Pulled By: SS-JIA

fbshipit-source-id: b7f6b97fe3d442127e87b117dbcc94ee8148f8f1
S
Stephen Jia committed
8958294f7c94ccaaa4a3915376fdd2600337ecf4
Parent: 81b3232
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 3/1/2024, 8:27:16 AM