mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-04-29 04:05:35 +00:00
updated c++17 compiler flags (#4983)
This commit is contained in:
parent
1db6727678
commit
4e4a10c97d
@ -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)
|
CPPFLAGS += $(shell python3 -m pybind11 --includes)
|
||||||
LIBNAME = mask
|
LIBNAME = mask
|
||||||
LIBEXT = $(shell python3-config --extension-suffix)
|
LIBEXT = $(shell python3-config --extension-suffix)
|
||||||
|
@ -21,12 +21,22 @@ class CPUAdamBuilder(Builder):
|
|||||||
return [self.csrc_abs_path("includes"), self.get_cuda_home_include()]
|
return [self.csrc_abs_path("includes"), self.get_cuda_home_include()]
|
||||||
|
|
||||||
def cxx_flags(self):
|
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
|
return ["-O3"] + self.version_dependent_macros + extra_cxx_flags
|
||||||
|
|
||||||
def nvcc_flags(self):
|
def nvcc_flags(self):
|
||||||
extra_cuda_flags = [
|
extra_cuda_flags = [
|
||||||
"-std=c++14",
|
"-std=c++14",
|
||||||
|
"-std=c++17",
|
||||||
"-U__CUDA_NO_HALF_OPERATORS__",
|
"-U__CUDA_NO_HALF_OPERATORS__",
|
||||||
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
||||||
"-U__CUDA_NO_HALF2_OPERATORS__",
|
"-U__CUDA_NO_HALF2_OPERATORS__",
|
||||||
|
@ -37,12 +37,12 @@ class GPTQBuilder(Builder):
|
|||||||
extra_cuda_flags = [
|
extra_cuda_flags = [
|
||||||
"-v",
|
"-v",
|
||||||
"-std=c++14",
|
"-std=c++14",
|
||||||
|
"-std=c++17",
|
||||||
"-U__CUDA_NO_HALF_OPERATORS__",
|
"-U__CUDA_NO_HALF_OPERATORS__",
|
||||||
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
||||||
"-U__CUDA_NO_HALF2_OPERATORS__",
|
"-U__CUDA_NO_HALF2_OPERATORS__",
|
||||||
"-DTHRUST_IGNORE_CUB_VERSION_CHECK",
|
"-DTHRUST_IGNORE_CUB_VERSION_CHECK",
|
||||||
"-lcublas",
|
"-lcublas",
|
||||||
"-std=c++17",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for arch in torch.cuda.get_arch_list():
|
for arch in torch.cuda.get_arch_list():
|
||||||
|
@ -35,6 +35,7 @@ class MultiHeadAttnBuilder(Builder):
|
|||||||
def nvcc_flags(self):
|
def nvcc_flags(self):
|
||||||
extra_cuda_flags = [
|
extra_cuda_flags = [
|
||||||
"-std=c++14",
|
"-std=c++14",
|
||||||
|
"-std=c++17",
|
||||||
"-U__CUDA_NO_HALF_OPERATORS__",
|
"-U__CUDA_NO_HALF_OPERATORS__",
|
||||||
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
||||||
"-U__CUDA_NO_HALF2_OPERATORS__",
|
"-U__CUDA_NO_HALF2_OPERATORS__",
|
||||||
|
@ -25,6 +25,7 @@ class ScaledMaskedSoftmaxBuilder(Builder):
|
|||||||
def nvcc_flags(self):
|
def nvcc_flags(self):
|
||||||
extra_cuda_flags = [
|
extra_cuda_flags = [
|
||||||
"-std=c++14",
|
"-std=c++14",
|
||||||
|
"-std=c++17",
|
||||||
"-U__CUDA_NO_HALF_OPERATORS__",
|
"-U__CUDA_NO_HALF_OPERATORS__",
|
||||||
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
"-U__CUDA_NO_HALF_CONVERSIONS__",
|
||||||
"-U__CUDA_NO_HALF2_OPERATORS__",
|
"-U__CUDA_NO_HALF2_OPERATORS__",
|
||||||
|
Loading…
Reference in New Issue
Block a user