Skip to content

Commit 22692e2

Browse files
authored
Merge pull request #81 from junjihashimoto/fix/dev-ci
Add dev branch to CI
2 parents 9042771 + 4a50052 commit 22692e2

File tree

25 files changed

+2751
-1817
lines changed

25 files changed

+2751
-1817
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ on:
44
push:
55
branches:
66
- main
7+
- dev
78
pull_request:
89
types: [opened, reopened, labeled, unlabeled, synchronize]
910
branches:
1011
- main
12+
- dev
1113
workflow_dispatch:
1214

1315
jobs:

.github/workflows/cmake-ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CMake CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
types: [opened, reopened, labeled, unlabeled, synchronize]
10+
branches:
11+
- main
12+
- dev
13+
workflow_dispatch:
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest]
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
29+
- name: Install dependencies (Ubuntu)
30+
if: matrix.os == 'ubuntu-latest'
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y cmake
34+
sudo apt-get install -y libvulkan1 mesa-vulkan-drivers vulkan-tools
35+
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl-dev libx11-xcb-dev
36+
37+
- name: Build with CMake
38+
run: CMAKE_VERBOSE_MAKEFILE=1 make all-cmake
39+
40+
- name: Test
41+
run: make test-cmake
42+
43+
- name: Upload WebGPU artifacts (macOS)
44+
if: matrix.os == 'macos-latest'
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: webgpu-macos-arm64
48+
path: |
49+
external/dawn/build_mac_arm64/src/dawn/native/libwebgpu_dawn.dylib
50+
external/dawn/build_mac_arm64/gen/include/dawn/webgpu.h
51+
retention-days: 7
52+
53+
- name: Upload WebGPU artifacts (Linux)
54+
if: matrix.os == 'ubuntu-latest'
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: webgpu-linux-x86_64
58+
path: |
59+
external/dawn/build_unix_x86_64/src/dawn/native/libwebgpu_dawn.so
60+
external/dawn/build_unix_x86_64/gen/include/dawn/webgpu.h
61+
retention-days: 7

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717
option(DEBUG "Option to enable debug flags" OFF)
1818
if(DEBUG)
1919
set(CMAKE_BUILD_TYPE Debug)
20-
set(CMAKE_CXX_FLAGS "-O0 -g")
20+
set(CMAKE_CXX_FLAGS "-O0 -g -fsanitize=address -fno-omit-frame-pointer")
2121
endif()
2222

2323
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/dawn.cmake")

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
ifeq ($(shell uname),Darwin)
2+
NUM_JOBS=$(shell sysctl -n hw.ncpu)
3+
else
14
NUM_JOBS=$(shell nproc)
5+
endif
26
CXX=clang++
37

48
.PHONY: default examples/hello_world/build/hello_world tests libgpu debug build check-clang clean-build clean all watch-tests docs
59

610
GPUCPP ?= $(PWD)
711
LIBDIR ?= $(GPUCPP)/third_party/lib
812
LIBSPEC ?= . $(GPUCPP)/source
9-
INCLUDES ?= -I$(GPUCPP) -I$(GPUCPP)/third_party/headers
13+
INCLUDES ?= -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I$(GPUCPP)/third_party/headers/webgpu
1014
ifeq ($(shell $(CXX) -std=c++17 -x c++ -E -include array - < /dev/null > /dev/null 2>&1 ; echo $$?),0)
1115
STDLIB :=
1216
else
@@ -69,6 +73,9 @@ all: dawnlib check-clang check-linux-vulkan lib pch
6973
cd examples/shadertui && make build/shadertui
7074
cd examples/transpose && make build/transpose
7175

76+
test-gpu: dawnlib check-clang
77+
$(LIBSPEC) && clang++ -std=c++17 -g -fsanitize=address -fno-omit-frame-pointer -Wall $(INCLUDES) test/test_gpu.cpp numeric_types/half.cpp -L$(LIBDIR) -lwebgpu_dawn -Wl,-rpath,$(GPUCPP)/third_party/lib -ldl -o build/test_gpu && ./build/test_gpu
78+
7279
# Test 16-bit floating point type
7380
test-half: dawnlib check-clang
7481
$(LIBSPEC) && clang++ -std=c++17 $(INCLUDES) numeric_types/half.cpp -L$(LIBDIR) -lwebgpu_dawn -ldl -o build/half && ./build/half
@@ -97,6 +104,9 @@ debug-cmake: check-clang check-cmake
97104
all-cmake: check-clang check-cmake
98105
$(CMAKE_CMD) $(RELEASE_FLAGS) && make -j$(NUM_JOBS) $(TARGET_ALL)
99106

107+
test-cmake: check-clang check-cmake
108+
./build/test_gpu
109+
100110
################################################################################
101111
# Cleanup
102112
################################################################################

bindings/python/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else
1010
STDLIB := -stdlib=libc++
1111
endif
1212

13-
FLAGS=-shared -fPIC -std=c++17 $(STDLIB) -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -L$(GPUCPP)/third_party/lib -lwebgpu_dawn \
13+
FLAGS=-shared -fPIC -std=c++17 $(STDLIB) -I$(GPUCPP) -I$(GPUCPP)/third_party/headers -I$(GPUCPP)/third_party/headers/webgpu -L$(GPUCPP)/third_party/lib -lwebgpu_dawn \
1414
`python3 -m pybind11 --includes` \
1515
`python3-config --includes --ldflags`
1616

0 commit comments

Comments
 (0)