-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (26 loc) · 899 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (26 loc) · 899 Bytes
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
# Makefile for audiosam.cpp — wraps CMake (pattern from audiogen.cpp)
BUILD_DIR_CPU := build-cpu
BUILD_DIR_CUDA := build-cuda
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=Release
.PHONY: all
all: cpu
.PHONY: cpu
cpu:
cmake -B $(BUILD_DIR_CPU) -S . $(CMAKE_FLAGS) -DAUDIOSAM_CUDA=OFF
cmake --build $(BUILD_DIR_CPU) --parallel
@echo "CPU build complete: $(BUILD_DIR_CPU)/audiosam"
.PHONY: cuda
cuda:
cmake -B $(BUILD_DIR_CUDA) -S . $(CMAKE_FLAGS) -DAUDIOSAM_CUDA=ON
cmake --build $(BUILD_DIR_CUDA) --parallel
@echo "CUDA build complete: $(BUILD_DIR_CUDA)/audiosam"
.PHONY: test
test: cpu
ctest --test-dir $(BUILD_DIR_CPU) --output-on-failure
# GPU matmul kernels are not bit-identical to CPU; loosen parity tolerances
.PHONY: test-cuda
test-cuda: cuda
AUDIOSAM_TOL_SCALE=50 ctest --test-dir $(BUILD_DIR_CUDA) --output-on-failure
.PHONY: clean
clean:
rm -rf $(BUILD_DIR_CPU) $(BUILD_DIR_CUDA)