-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
39 lines (30 loc) · 1.13 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
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 *TEST_ARGS: (build "-DBUILD_TESTING=ON")
./{{build_dir}}/tests/tests $@
# Runs the application
@run *RUN_ARGS: (build)
./{{target}} $@
# Benchmarks the application using NVIDIA Nsight Systems, run with `sudo` for better results
@bench *RUN_ARGS: (build)
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 *RUN_ARGS: (build)
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