-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
43 lines (34 loc) · 1.44 KB
/
justfile
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
37
38
39
40
41
42
43
set positional-arguments
export CMAKE_BUILD_TYPE := "Release"
build_dir := "build"
bench_dir := "bench"
target := build_dir / "apps/cuda_path_tracer"
# Lists all available targets
@default:
just --list
# Builds the application with the specified CMake arguments
@build *CMAKE_ARGS:
cmake -S . -B {{build_dir}} $@
cmake --build {{build_dir}}
# Builds the application with testing enabled
@test *CMAKE_ARGS: (build "-DBUILD_TESTING=ON" "-DCMAKE_BUILD_TYPE=Debug" CMAKE_ARGS)
# It would be better to have the target be
# 'test $CMAKE_BUILD_TYPE="Debug" *CMAKE_ARGS: ...' to overload the
# CMAKE_BUILD_TYPE environment variable, but
# https://github.com/casey/just/issues/1804 needs to be resolved first.
./{{build_dir}}/tests/tests
# Runs the application
@run *CMAKE_ARGS: (build CMAKE_ARGS)
./{{target}}
# Benchmarks the application using NVIDIA Nsight Systems, run with `sudo` for better results
@bench *CMAKE_ARGS: (build CMAKE_ARGS)
mkdir -p {{bench_dir}}
rm -rf {{bench_dir}}/*
nsys profile --stats=true -o {{bench_dir}}/bench ./{{target}}
nsys analyze {{bench_dir}}/bench.sqlite
# Uses the NVIDIA Compute Sanitizer to check for memory leaks
@memcheck *CMAKE_ARGS: (build CMAKE_ARGS)
compute-sanitizer --show-backtrace yes --tool memcheck --leak-check full ./{{target}}
# Cleans the build and benchmark directories, as well as any generated images
@clean:
rm -rf {{build_dir}} {{bench_dir}} *.ppm