Skip to content

Commit

Permalink
Merge branch 'main' into xtensa-codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-johnson committed Dec 16, 2024
2 parents e995c89 + 5264706 commit d9420d3
Show file tree
Hide file tree
Showing 78 changed files with 26,556 additions and 7,038 deletions.
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# mini_webgpu.h is copied from upstream with some local mods
./src/runtime/mini_webgpu.h
./dependencies/spirv
./dependencies/vulkan
*.fbs.h
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (NOT DEFINED VCPKG_MANIFEST_FEATURES)
endif ()

project(Halide
VERSION 19.0.0
VERSION 20.0.0
DESCRIPTION "Halide compiler and libraries"
HOMEPAGE_URL "https://halide-lang.org")

Expand Down Expand Up @@ -242,6 +242,7 @@ Halide_feature(WITH_TESTS "Halide's unit test suite" TOP_LEVEL)
Halide_feature(WITH_TUTORIALS "Halide's tutorial code" TOP_LEVEL)
Halide_feature(WITH_UTILS "Optional utility programs for Halide, including HalideTraceViz" TOP_LEVEL)


##
# Add source directories

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ IN THE MATERIALS.

----

src/mini_vulkan.h is Copyright (c) 2014-2017 The Khronos Group Inc.
dependencies/vulkan is Copyright (c) 2014-2017 The Khronos Group Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ HEXAGON_LLVM_CONFIG_LIB=$(if $(WITH_HEXAGON), hexagon, )
SPIRV_CXX_FLAGS=$(if $(WITH_SPIRV), -DWITH_SPIRV -isystem $(ROOT_DIR)/dependencies/spirv/include, )
SPIRV_LLVM_CONFIG_LIB=$(if $(WITH_SPIRV), , )

VULKAN_CXX_FLAGS=$(if $(WITH_VULKAN), -DWITH_VULKAN, )
VULKAN_CXX_FLAGS=$(if $(WITH_VULKAN), -DWITH_VULKAN -isystem $(ROOT_DIR)/dependencies/vulkan/include, )
VULKAN_LLVM_CONFIG_LIB=$(if $(WITH_VULKAN), , )

WEBASSEMBLY_CXX_FLAGS=$(if $(WITH_WEBASSEMBLY), -DWITH_WEBASSEMBLY, )
Expand Down Expand Up @@ -1097,7 +1097,8 @@ RUNTIME_CXX_FLAGS = \
-Wno-unused-function \
-Wvla \
-Wsign-compare \
-Wno-sync-alignment
-Wno-sync-alignment \
-isystem $(ROOT_DIR)/dependencies/vulkan/include

$(BUILD_DIR)/initmod.windows_%_x86_32.ll: $(SRC_DIR)/runtime/windows_%_x86.cpp $(BUILD_DIR)/clang_ok
@mkdir -p $(@D)
Expand Down
16 changes: 16 additions & 0 deletions dependencies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ build it, and extract the necessary files. It takes a single argument, the
name of the branch to clone.

[SPIR-V]: https://www.khronos.org/registry/spir-v

## Vulkan

This folder contains a copy of the officially released v1.3.296 SDK headers
for [Vulkan], obtained from the `vulkan-sdk-v1.3.296` branch
of https://github.com/KhronosGroup/Vulkan-Headers.

The directory structure within this folder matches that of the official
version's install tree, plus the upstream `LICENSE.md` notice, minus files
that Halide doesn't need.

The `update-vulkan.sh` script will automatically acquire the upstream repo,
build it, and extract the necessary files. It takes a single argument, the
name of the branch to clone.

[Vulkan]: https://www.vulkan.org/
41 changes: 41 additions & 0 deletions dependencies/update-vulkan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -eo pipefail

cd -- "$(dirname -- "$0")" || exit 1

GIT_BRANCH="$1"
if [ -z "$GIT_BRANCH" ]; then
echo "error: usage: $0 <git-branch>"
echo "remark: the current <git-branch> is vulkan-sdk-1.3.296"
exit 1
fi

mkdir -p vulkan

cleanup () {
rm -rf Vulkan-Headers
}

trap cleanup SIGINT SIGTERM EXIT

git clone https://github.com/KhronosGroup/Vulkan-Headers.git --branch "$GIT_BRANCH"
cmake -S Vulkan-Headers -B Vulkan-Headers/build -DCMAKE_BUILD_TYPE=Release "-DCMAKE_INSTALL_PREFIX=$PWD/Vulkan-Headers/_local"
cmake --build Vulkan-Headers/build --target install

# Copy license information
cp Vulkan-Headers/LICENSE.md vulkan/

# Copy headers we care about (only the ANSI-C core interfaces!)
mkdir -p vulkan/include/vulkan
cp Vulkan-Headers/_local/include/vulkan/*.h vulkan/include/vulkan/
mkdir -p vulkan/include/vk_video
cp Vulkan-Headers/_local/include/vk_video/*.h vulkan/include/vk_video/

# Copy CMake config
mkdir -p vulkan/share/
cp -R Vulkan-Headers/_local/share/cmake vulkan/share/

git add -f vulkan/

echo "Updated Vulkan-Headers to branch $GIT_BRANCH!"
18 changes: 18 additions & 0 deletions dependencies/vulkan/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright 2015-2023 The Khronos Group Inc.

Files in this repository fall under one of these licenses:

- `Apache-2.0`
- `MIT`

Note: With the exception of `parse_dependency.py` the files using `MIT` license
also fall under `Apache-2.0`. Example:

```
SPDX-License-Identifier: Apache-2.0 OR MIT
```

Full license text of these licenses is available at:

* Apache-2.0: https://opensource.org/licenses/Apache-2.0
* MIT: https://opensource.org/licenses/MIT
Loading

0 comments on commit d9420d3

Please sign in to comment.