updated c++17 compiler flags (#4983)

This commit is contained in:
アマデウス
2023-10-27 18:19:56 +08:00
committed by GitHub
parent 1db6727678
commit 4e4a10c97d
5 changed files with 15 additions and 3 deletions

View File

@@ -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__",

View File

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

View File

@@ -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__",

View File

@@ -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__",