-
Notifications
You must be signed in to change notification settings - Fork 199
Expand file tree
/
Copy pathtest
More file actions
executable file
·36 lines (34 loc) · 1.24 KB
/
Copy pathtest
File metadata and controls
executable file
·36 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -euo pipefail
external_spirv=
if [[ ${1:-} == --web || ${1:-} == --build-web || \
${1:-} == --rebuild-web ]]; then
if [[ ${1:-} == --rebuild-web || \
! -f third_party/emdawnwebgpu/emdawnwebgpu.port.py ]]; then
tools/build_emdawn.sh
fi
export EMSDK_QUIET=1
source "${GPUCPP_EMSDK_ROOT:-../emsdk}/emsdk_env.sh" >/dev/null
emcmake cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build-web --target gpu_cpp_web web_binding_test
if [[ ${1:-} != --build-web ]]; then
emrun --browser chrome --timeout 60 build-web/web_binding_test.html
fi
exit
elif [[ ${1:-} == --rebuild-dawn ]]; then
tools/build_dawn.sh
elif [[ ${1:-} == --spirv && $# -eq 2 ]]; then
external_spirv=$2
elif [[ $# -ne 0 ]]; then
echo "usage: ./test [--rebuild-dawn|--web|--build-web|--rebuild-web|--spirv FILE]" >&2
exit 2
elif [[ ! -f third_party/dawn/include/dawn/webgpu_cpp.h &&
! -f third_party/local/dawn/build-latest/gen/include/dawn/webgpu_cpp.h ]]; then
tools/build_dawn.sh
fi
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure
if [[ -n $external_spirv ]]; then
build/gpu_test build/write42.spv "$external_spirv"
fi