Skip to content

Commit

Permalink
Merge pull request #120 from NVIDIA/hotfix/cuda12
Browse files Browse the repository at this point in the history
Hotfix/cuda12
  • Loading branch information
maddyscientist committed May 26, 2023
2 parents 8946d3b + 28d90bb commit 57de649
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ endif
EMBED_BEGIN = -rdynamic -Wl,-b,binary,
EMBED_END = ,-b,default

NVCC ?= $(CUDA_DIR)/bin/nvcc
NVCC_EMBED_BEGIN = -rdynamic -Wl\,-b\,binary\,
NVCC_EMBED_END = \,-b\,default

Expand Down Expand Up @@ -63,14 +64,14 @@ get-deps:
.PHONY: get-deps

GTEST_DIR = googletest
GTEST_STATIC_LIB = $(GTEST_DIR)/build/googlemock/gtest/libgtest.a
GTEST_STATIC_LIB = $(GTEST_DIR)/build/lib/libgtest.a
$(GTEST_STATIC_LIB):
rm -rf $(GTEST_DIR)
git clone https://github.com/google/googletest.git $(GTEST_DIR)
cd $(GTEST_DIR) && git checkout release-1.12.1 && rm -rf build && mkdir build && cd build && cmake .. && make -j8

GTEST_INC = -I$(GTEST_DIR)/googletest/include
GTEST_LIB = -L$(GTEST_DIR)/build/googlemock/gtest -lgtest -lgtest_main
GTEST_LIB = -L$(GTEST_DIR)/build/lib -lgtest -lgtest_main

CUB_DIR ?= /tmp/cub
CUB_HEADER = $(CUB_DIR)/cub/cub.cuh
Expand All @@ -86,7 +87,7 @@ jitify_test: jitify_test.cu $(HEADERS) $(GTEST_STATIC_LIB) $(CUB_HEADER) Makefil
# Link a 2nd compilation unit to ensure no multiple definition errors.
echo "#include \"jitify.hpp\"\n#include \"example_headers/my_header1.cuh.jit\"" \
> jitify_2nd_compilation_unit.cpp
nvcc -o $@ $< jitify_2nd_compilation_unit.cpp -rdc=true -std=c++11 -O3 \
$(NVCC) -o $@ $< jitify_2nd_compilation_unit.cpp -rdc=true -std=c++11 -O3 \
-Xcompiler "$(CXXFLAGS) $(NVCC_EMBED) -pthread" \
$(JITIFY_TEST_DEFINES) $(INC) $(GTEST_INC) $(CUB_INC) $(LIB) $(GTEST_LIB)

Expand Down
2 changes: 1 addition & 1 deletion jitify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ inline bool load_source(
source += line + "\n";
}
// HACK TESTING (WAR for cub)
// source = "#define cudaDeviceSynchronize() cudaSuccess\n" + source;
source = "#define cudaDeviceSynchronize() cudaSuccess\n" + source;
////source = "cudaError_t cudaDeviceSynchronize() { return cudaSuccess; }\n" +
/// source;

Expand Down

0 comments on commit 57de649

Please sign in to comment.