From 9e645314e65fc44c8d15c81258bddb620cf5f3ca Mon Sep 17 00:00:00 2001 From: Jun Zhang Date: Mon, 20 May 2024 00:00:21 +0800 Subject: [PATCH] Check if file exists using platform specific commands & Add *.o to gitignore Signed-off-by: Jun Zhang --- .gitignore | 1 + Makefile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5e88e4285..f60885e23 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ dev/cuda/matmul_backward_bias dev/cuda/nccl_all_reduce *.obj *.exe +*.o # log files *.log diff --git a/Makefile b/Makefile index 46abdc9a5..c8b555ac2 100644 --- a/Makefile +++ b/Makefile @@ -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=