Skip to content

Commit 021ea97

Browse files
committed
Add pre-commit check for duplicate CUDA files
For reasons of CUDA being CUDA, we currently cannot reliable compile the project in debug mode if there are multiple CUDA files with the same base name. This causes a race condition during compilation. In order to relieve this issue, this commit adds a pre-commit check that verifies that all CUDA file base names are unique.
1 parent c3f883f commit 021ea97

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
! [[ $(find device tests -name "*\.cu" | xargs -I {} basename {} | sort | uniq -d) ]]
4+
exit $?

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ repos:
2929
name: Check taboo code patterns
3030
language: system
3131
entry: .github/check_taboos.sh
32+
33+
- repo: local
34+
hooks:
35+
- id: check_duplicate_cu_files
36+
name: Check duplicate .cu file names
37+
language: system
38+
entry: .github/check_duplicate_cu_files.sh
39+
pass_filenames: false

0 commit comments

Comments
 (0)