Skip to content

Commit 4e4a10c

Browse files
updated c++17 compiler flags (#4983)
1 parent 1db6727 commit 4e4a10c

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

examples/community/roberta/preprocessing/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CXXFLAGS += -O3 -Wall -shared -std=c++14 -fPIC -fdiagnostics-color
1+
CXXFLAGS += -O3 -Wall -shared -std=c++14 -std=c++17 -fPIC -fdiagnostics-color
22
CPPFLAGS += $(shell python3 -m pybind11 --includes)
33
LIBNAME = mask
44
LIBEXT = $(shell python3-config --extension-suffix)

op_builder/cpu_adam.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,22 @@ def include_dirs(self):
2121
return [self.csrc_abs_path("includes"), self.get_cuda_home_include()]
2222

2323
def cxx_flags(self):
24-
extra_cxx_flags = ["-std=c++14", "-lcudart", "-lcublas", "-g", "-Wno-reorder", "-fopenmp", "-march=native"]
24+
extra_cxx_flags = [
25+
"-std=c++14",
26+
"-std=c++17",
27+
"-lcudart",
28+
"-lcublas",
29+
"-g",
30+
"-Wno-reorder",
31+
"-fopenmp",
32+
"-march=native",
33+
]
2534
return ["-O3"] + self.version_dependent_macros + extra_cxx_flags
2635

2736
def nvcc_flags(self):
2837
extra_cuda_flags = [
2938
"-std=c++14",
39+
"-std=c++17",
3040
"-U__CUDA_NO_HALF_OPERATORS__",
3141
"-U__CUDA_NO_HALF_CONVERSIONS__",
3242
"-U__CUDA_NO_HALF2_OPERATORS__",

op_builder/gptq.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def nvcc_flags(self):
3737
extra_cuda_flags = [
3838
"-v",
3939
"-std=c++14",
40+
"-std=c++17",
4041
"-U__CUDA_NO_HALF_OPERATORS__",
4142
"-U__CUDA_NO_HALF_CONVERSIONS__",
4243
"-U__CUDA_NO_HALF2_OPERATORS__",
4344
"-DTHRUST_IGNORE_CUB_VERSION_CHECK",
4445
"-lcublas",
45-
"-std=c++17",
4646
]
4747

4848
for arch in torch.cuda.get_arch_list():

op_builder/multi_head_attn.py

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def cxx_flags(self):
3535
def nvcc_flags(self):
3636
extra_cuda_flags = [
3737
"-std=c++14",
38+
"-std=c++17",
3839
"-U__CUDA_NO_HALF_OPERATORS__",
3940
"-U__CUDA_NO_HALF_CONVERSIONS__",
4041
"-U__CUDA_NO_HALF2_OPERATORS__",

op_builder/scaled_masked_softmax.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def cxx_flags(self):
2525
def nvcc_flags(self):
2626
extra_cuda_flags = [
2727
"-std=c++14",
28+
"-std=c++17",
2829
"-U__CUDA_NO_HALF_OPERATORS__",
2930
"-U__CUDA_NO_HALF_CONVERSIONS__",
3031
"-U__CUDA_NO_HALF2_OPERATORS__",

0 commit comments

Comments
 (0)