Skip to content

Commit

Permalink
Merge branch 'next' into dev-xir
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Oct 29, 2024
2 parents 62a0f7f + 4df551d commit a27d104
Show file tree
Hide file tree
Showing 21 changed files with 524 additions and 341 deletions.
261 changes: 130 additions & 131 deletions .github/workflows/build-cmake.yml
Original file line number Diff line number Diff line change
@@ -1,131 +1,130 @@
name: build-cmake

on: [ push, pull_request ]

jobs:
build-linux:
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
compiler:
- { name: gcc, version: 13 }
- { name: clang, version: 17 }
config: [ Release, Debug ]
name: ${{ matrix.os }} / ${{ matrix.config }} / ${{ matrix.compiler.name }}-${{ matrix.compiler.version }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install Dependencies"
run: |
if [ "${{ matrix.compiler.name }}" = "gcc" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y install gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }}
else
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.compiler.version }} main"
sudo apt-get -y remove "libc++1-*" "libc++abi1-*" "libunwind-*"
sudo apt-get update
sudo apt-get -y install clang-${{ matrix.compiler.version }} lld-${{ matrix.compiler.version }}
sudo apt-get -y install libc++-${{ matrix.compiler.version }}-dev libc++abi-${{ matrix.compiler.version }}-dev
fi
sudo apt-get update
sudo apt-get -y install build-essential cmake ninja-build uuid-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: "Setup CUDA"
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda
- name: "Setup Vulkan SDK"
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: "Configure and Build"
run: |
if [ "${{ matrix.compiler.name }}" = "gcc" ]; then
export LUISA_CC=gcc-${{ matrix.compiler.version }}
export LUISA_CXX=g++-${{ matrix.compiler.version }}
export LUISA_FLAGS=""
else
export LUISA_CC=clang-${{ matrix.compiler.version }}
export LUISA_CXX=clang++-${{ matrix.compiler.version }}
export LUISA_FLAGS="-stdlib=libc++"
fi
cmake -S . -B build -G Ninja -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D CMAKE_C_COMPILER=${LUISA_CC} -D CMAKE_CXX_COMPILER=${LUISA_CXX} -D CMAKE_CXX_FLAGS="${LUISA_FLAGS}"
cmake --build build -j 16
- name: "Install"
run: |
if [ "${{ matrix.config }}" = "Release" ]; then
cmake --install build --prefix dist -v
fi
build-macos:
strategy:
fail-fast: false
matrix:
os: [ macos ]
compiler: [ homebrew-clang ] # , system-clang
config: [ Release, Debug ]
name: ${{ matrix.os }} / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: [ self-hosted, macos, arm64 ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Configure and Build"
run: |
if [ "${{ matrix.compiler }}" = "homebrew-clang" ]; then
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
fi
cmake -S . -B build -G Ninja -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D LUISA_COMPUTE_ENABLE_UNITY_BUILD=OFF
cmake --build build -v
- name: "Install"
run: |
if [ "${{ matrix.config }}" = "Release" ]; then
cmake --install build --prefix dist -v
fi
build-windows:
strategy:
fail-fast: false
matrix:
os: [ 2022 ]
config: [ Release, Debug ]
compiler: [ cl, clang, clang-cl ]
name: windows / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: [ self-hosted, windows, x64 ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Setup Ninja"
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.1
- name: "Configure and Build"
shell: cmd
run: |
cmake -D COMPONENTS="dx" -D OUTPUT_DIR="../../luisa_compute_sdks/windows-cmake" -P scripts/download_sdks.cmake
call "C:\Program Files\Microsoft Visual Studio\${{ matrix.os }}\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake --version
ninja --version
IF "${{ matrix.compiler }}" == "clang" (
set CC=clang
set CXX=clang++
) ELSE (
set CC=${{ matrix.compiler }}
set CXX=${{ matrix.compiler }}
)
cmake -S . -G Ninja -B build -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }}
cmake --build build -v
- name: "Install"
run: |
cmake --install build --prefix dist -v
name: build-cmake

on: [ push, pull_request ]

jobs:
build-linux:
strategy:
fail-fast: false
matrix:
compiler: [ gcc, clang ]
config: [ Release, Debug ]
name: Ubuntu / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install Dependencies"
run: |
sudo apt-get update
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18 all
sudo apt-get -y install build-essential wget cmake ninja-build uuid-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: "Setup CUDA"
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install cuda-toolkit
- name: "Setup Vulkan"
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: "Configure and Build"
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export LUISA_CC=gcc
export LUISA_CXX=g++
export LUISA_FLAGS=""
else
export LUISA_CC=clang-18
export LUISA_CXX=clang++-18
export LUISA_FLAGS="-stdlib=libc++"
fi
cmake -S . -B build -G Ninja -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D CMAKE_C_COMPILER=${LUISA_CC} -D CMAKE_CXX_COMPILER=${LUISA_CXX} -D CMAKE_CXX_FLAGS="${LUISA_FLAGS}"
cmake --build build -j 16
- name: "Install"
run: |
if [ "${{ matrix.config }}" = "Release" ]; then
cmake --install build --prefix dist -v
fi
build-macos:
strategy:
fail-fast: false
matrix:
compiler: [ homebrew-clang, system-clang ]
config: [ Release, Debug ]
name: macOS / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install Dependencies"
run: |
brew install llvm molten-vk ninja cmake
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: "Configure and Build"
run: |
if [ "${{ matrix.compiler }}" = "homebrew-clang" ]; then
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
fi
cmake -S . -B build -G Ninja -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }} -D LUISA_COMPUTE_ENABLE_UNITY_BUILD=OFF
cmake --build build -v
- name: "Install"
run: |
if [ "${{ matrix.config }}" = "Release" ]; then
cmake --install build --prefix dist -v
fi
build-windows:
strategy:
fail-fast: false
matrix:
config: [ Release, Debug ]
compiler: [ cl, clang, clang-cl ]
name: Windows / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Setup Ninja"
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.1
- name: "Setup CUDA"
uses: Jimver/cuda-toolkit@v0.2.18
- name: "Setup Rust"
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
- name: "Setup Vulkan"
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: "Configure and Build"
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cmake --version
ninja --version
IF "${{ matrix.compiler }}" == "clang" (
set CC=clang
set CXX=clang++
) ELSE (
set CC=${{ matrix.compiler }}
set CXX=${{ matrix.compiler }}
)
cmake -S . -G Ninja -B build -D LUISA_COMPUTE_ENABLE_RUST=OFF -D LUISA_COMPUTE_ENABLE_REMOTE=OFF -D LUISA_COMPUTE_ENABLE_CPU=OFF -D CMAKE_BUILD_TYPE=${{ matrix.config }}
cmake --build build -v
- name: "Install"
run: |
cmake --install build --prefix dist -v
98 changes: 69 additions & 29 deletions .github/workflows/build-xmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,67 @@ name: build-xmake
on: [ push, pull_request ]

jobs:
build-linux:
strategy:
fail-fast: false
matrix:
os: [ ubuntu ]
toolchain:
- { name: gcc, version: 13 }
- { name: clang, version: 17 }
config: [ release, debug ]
name: ${{ matrix.os }} / ${{ matrix.config }} / ${{ matrix.toolchain.name }}-${{ matrix.toolchain.version }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Configure and Build"
run: |
xmake lua setup.lua
xmake f -p linux -a x86_64 --toolchain=${{ matrix.toolchain.name }}-${{ matrix.toolchain.version }} -m ${{ matrix.config }} --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --enable_mimalloc=false --check -c
xmake --jobs=16
# build-linux:
# strategy:
# fail-fast: false
# matrix:
# toolchain: [gcc, clang]
# config: [ release, debug ]
# name: Ubuntu / ${{ matrix.config }} / ${{ matrix.toolchain }}
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: "Install Dependencies"
# run: |
# sudo apt-get update
# wget https://apt.llvm.org/llvm.sh
# chmod +x llvm.sh
# sudo ./llvm.sh 18 all
# sudo apt-get -y install build-essential wget xmake cmake ninja-build uuid-dev libxinerama-dev libxcursor-dev libxi-dev libvulkan-dev
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# - name: "Setup CUDA"
# run: |
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
# sudo dpkg -i cuda-keyring_1.1-1_all.deb
# sudo apt-get update
# sudo apt-get -y install cuda-toolkit
# - name: "Setup Vulkan"
# uses: humbletim/setup-vulkan-sdk@v1.2.0
# with:
# vulkan-query-version: 1.3.204.0
# vulkan-components: Vulkan-Headers, Vulkan-Loader
# vulkan-use-cache: true
# - name: "Configure and Build"
# run: |
# xmake lua setup.lua
# xmake f -p linux -a x86_64 --toolchain=${{ matrix.toolchain }} -m ${{ matrix.config }} --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --enable_mimalloc=false --check -c -y
# xmake --jobs=16

build-macos:
strategy:
fail-fast: false
matrix:
os: [ macos ]
compiler: [ homebrew-clang ] # , system-clang
compiler: [ homebrew-clang, system-clang ]
config: [ release, debug ]
name: ${{ matrix.os }} / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: [ self-hosted, macos, arm64 ]
name: macOS / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install Dependencies"
run: |
brew install llvm molten-vk ninja cmake xmake
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: "Configure and Build"
run: |
if [ "${{ matrix.compiler }}" = "homebrew-clang" ]; then
export PATH=/usr/local/opt/llvm/bin:$PATH
fi
xmake lua setup.lua
xmake f -p macosx --toolchain=llvm -m ${{ matrix.config }} --mm=clang --mxx=clang++ --metal_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --enable_mimalloc=false --check -c
xmake f -p macosx --toolchain=llvm -m ${{ matrix.config }} --mm=clang --mxx=clang++ --metal_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --enable_mimalloc=false --check -c -y
xmake -v
build-windows:
Expand All @@ -52,19 +72,39 @@ jobs:
matrix:
config: [ release, debug ]
compiler: [ msvc, clang-cl, llvm ]
name: windows / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: [ self-hosted, windows, x64 ]
name: Windows / ${{ matrix.config }} / ${{ matrix.compiler }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Setup Ninja"
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.11.1
- name: "Setup CUDA"
uses: Jimver/cuda-toolkit@v0.2.18
- name: "Setup Rust"
uses: actions-rust-lang/setup-rust-toolchain@v1.10.1
- name: "Setup Vulkan"
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: "Setup LLVM"
uses: ZhongRuoyu/setup-llvm@v0
with:
llvm-version: 18
- name: "Setup XMake"
uses: xmake-io/github-action-setup-xmake@v1
- name: "Configure and Build"
shell: cmd
run: |
xmake lua setup.lua ../luisa_compute_sdks
if "${{ matrix.compiler }}" == "llvm" (
xmake f -p windows -a x64 --toolchain=llvm --sdk="C:/Program Files/LLVM" -m ${{ matrix.config }} --dx_backend=true --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --sdk_dir=../luisa_compute_sdks --check -c
xmake f -p windows -a x64 --toolchain=llvm --sdk="C:/Program Files/LLVM" -m ${{ matrix.config }} --dx_backend=true --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --sdk_dir=../luisa_compute_sdks --check -c -y
) else (
xmake f -p windows -a x64 --toolchain=${{ matrix.compiler }} -m ${{ matrix.config }} --dx_backend=true --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --sdk_dir=../luisa_compute_sdks --check -c
xmake f -p windows -a x64 --toolchain=${{ matrix.compiler }} -m ${{ matrix.config }} --dx_backend=true --cuda_backend=true --enable_dsl=true --enable_gui=true --enable_unity_build=false --enable_tests=true --sdk_dir=../luisa_compute_sdks --check -c -y
)
xmake
Loading

0 comments on commit a27d104

Please sign in to comment.