Skip to content

Commit

Permalink
updated c++17 compiler flags (#4983)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurisusnowdeng authored Oct 27, 2023
1 parent 1db6727 commit 4e4a10c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/community/roberta/preprocessing/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CXXFLAGS += -O3 -Wall -shared -std=c++14 -fPIC -fdiagnostics-color
CXXFLAGS += -O3 -Wall -shared -std=c++14 -std=c++17 -fPIC -fdiagnostics-color
CPPFLAGS += $(shell python3 -m pybind11 --includes)
LIBNAME = mask
LIBEXT = $(shell python3-config --extension-suffix)
Expand Down
12 changes: 11 additions & 1 deletion op_builder/cpu_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,22 @@ def include_dirs(self):
return [self.csrc_abs_path("includes"), self.get_cuda_home_include()]

def cxx_flags(self):
extra_cxx_flags = ["-std=c++14", "-lcudart", "-lcublas", "-g", "-Wno-reorder", "-fopenmp", "-march=native"]
extra_cxx_flags = [
"-std=c++14",
"-std=c++17",
"-lcudart",
"-lcublas",
"-g",
"-Wno-reorder",
"-fopenmp",
"-march=native",
]
return ["-O3"] + self.version_dependent_macros + extra_cxx_flags

def nvcc_flags(self):
extra_cuda_flags = [
"-std=c++14",
"-std=c++17",
"-U__CUDA_NO_HALF_OPERATORS__",
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-U__CUDA_NO_HALF2_OPERATORS__",
Expand Down
2 changes: 1 addition & 1 deletion op_builder/gptq.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def nvcc_flags(self):
extra_cuda_flags = [
"-v",
"-std=c++14",
"-std=c++17",
"-U__CUDA_NO_HALF_OPERATORS__",
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-U__CUDA_NO_HALF2_OPERATORS__",
"-DTHRUST_IGNORE_CUB_VERSION_CHECK",
"-lcublas",
"-std=c++17",
]

for arch in torch.cuda.get_arch_list():
Expand Down
1 change: 1 addition & 0 deletions op_builder/multi_head_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def cxx_flags(self):
def nvcc_flags(self):
extra_cuda_flags = [
"-std=c++14",
"-std=c++17",
"-U__CUDA_NO_HALF_OPERATORS__",
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-U__CUDA_NO_HALF2_OPERATORS__",
Expand Down
1 change: 1 addition & 0 deletions op_builder/scaled_masked_softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def cxx_flags(self):
def nvcc_flags(self):
extra_cuda_flags = [
"-std=c++14",
"-std=c++17",
"-U__CUDA_NO_HALF_OPERATORS__",
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-U__CUDA_NO_HALF2_OPERATORS__",
Expand Down

0 comments on commit 4e4a10c

Please sign in to comment.