Browse Source

updated c++17 compiler flags (#4983)

pull/5017/head
アマデウス 1 year ago committed by GitHub
parent
commit
4e4a10c97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/community/roberta/preprocessing/Makefile
  2. 12
      op_builder/cpu_adam.py
  3. 2
      op_builder/gptq.py
  4. 1
      op_builder/multi_head_attn.py
  5. 1
      op_builder/scaled_masked_softmax.py

2
examples/community/roberta/preprocessing/Makefile

@ -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)

12
op_builder/cpu_adam.py

@ -21,12 +21,22 @@ class CPUAdamBuilder(Builder):
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__",

2
op_builder/gptq.py

@ -37,12 +37,12 @@ class GPTQBuilder(Builder):
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():

1
op_builder/multi_head_attn.py

@ -35,6 +35,7 @@ class MultiHeadAttnBuilder(Builder):
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__",

1
op_builder/scaled_masked_softmax.py

@ -25,6 +25,7 @@ class ScaledMaskedSoftmaxBuilder(Builder):
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__",

Loading…
Cancel
Save