Check if file exists using platform specific commands & Add *.o to gitignore

Signed-off-by: Jun Zhang <jun@junz.org>
This commit is contained in:
Jun Zhang 2024-05-20 00:00:21 +08:00
parent 2d43e5bc97
commit 9e645314e6
No known key found for this signature in database
GPG key ID: E19904830B621534
2 changed files with 8 additions and 1 deletions

1
.gitignore vendored
View file

@ -24,6 +24,7 @@ dev/cuda/matmul_backward_bias
dev/cuda/nccl_all_reduce
*.obj
*.exe
*.o
# log files
*.log

View file

@ -23,9 +23,15 @@ NVCC_CUDNN =
USE_CUDNN ?= 0
# Function to check if a file exists in the PATH
ifneq ($(OS), Windows_NT)
define file_exists_in_path
$(shell where $(1) 2>nul || which $(1) 2>/dev/null)
$(which $(1) 2>/dev/null)
endef
else
define file_exists_in_path
$(shell where $(1) 2>nul)
endef
endif
ifneq ($(CI),true) # if not in CI, then use the GPU query
ifndef GPU_COMPUTE_CAPABILITY # set to defaults if: make GPU_COMPUTE_CAPABILITY=