Skip to content

Commit

Permalink
Removing old NVCC versions
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriiPerets committed Oct 17, 2024
1 parent 89327ba commit 681e7e4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 83 deletions.
14 changes: 1 addition & 13 deletions src/bashi/filter_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
NVCC_CLANG_MAX_VERSION,
CLANG_CUDA_MAX_CUDA_VERSION,
NVCC_CXX_SUPPORT,
NVCC_GCC_CXX_SUPPORT,
)

from bashi.utils import reason
Expand Down Expand Up @@ -149,17 +148,6 @@ def backend_filter(
return False
break

if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version <= NVCC_GCC_CXX_SUPPORT[0].nvcc:
# check the maximum supported nvcc version for the given cxx version
for nvcc_gcc_comb in NVCC_GCC_CXX_SUPPORT:
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version >= nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
break

if HOST_COMPILER in row and row[HOST_COMPILER].name == CLANG:
# Rule: b11
# related to rule c8
Expand Down Expand Up @@ -228,7 +216,7 @@ def backend_filter(
if CXX_STANDARD in row:
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version <= NVCC_CXX_SUPPORT[0].nvcc:
for cuda_cxx_comb in NVCC_CXX_SUPPORT:
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version >= cuda_cxx_comb.nvcc:
if row[ALPAKA_ACC_GPU_CUDA_ENABLE].version < cuda_cxx_comb.nvcc:
if row[CXX_STANDARD].version >= cuda_cxx_comb.cxx:
reason(
output,
Expand Down
13 changes: 1 addition & 12 deletions src/bashi/filter_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,7 @@ def compiler_filter(
# Rule: c21
# related to rule:
# remove all unsupported nvcc gcc version combinations with cxx
"""
if row[DEVICE_COMPILER].version <= NVCC_GCC_CXX_SUPPORT[0].nvcc:
# check the maximum supported nvcc version for the given cxx version
for nvcc_gcc_comb in NVCC_GCC_CXX_SUPPORT:
if row[DEVICE_COMPILER].version < nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
if row[DEVICE_COMPILER].version >= nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
break
"""

if HOST_COMPILER in row and row[HOST_COMPILER].name == CLANG:
# Rule: c7
# related to rule b11
Expand Down
34 changes: 2 additions & 32 deletions src/bashi/filter_software_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
get_oldest_supporting_clang_version_for_cuda,
GCC_CXX_SUPPORT,
NVCC_CXX_SUPPORT,
NVCC_GCC_CXX_SUPPORT,
CLANG_CXX_SUPPORT,
)

Expand Down Expand Up @@ -210,6 +209,7 @@ def software_dependency_filter(
# check the maximum supported nvcc version for the given cxx version
for nvcc_cxx_comb in NVCC_CXX_SUPPORT:
if row[DEVICE_COMPILER].version < nvcc_cxx_comb.nvcc:
print(nvcc_cxx_comb.nvcc)
if row[CXX_STANDARD].version >= nvcc_cxx_comb.cxx:
reason(
output,
Expand All @@ -228,35 +228,5 @@ def software_dependency_filter(
)
return False
break

if HOST_COMPILER in row and row[HOST_COMPILER].name == GCC:
if row[DEVICE_COMPILER].version <= NVCC_GCC_CXX_SUPPORT[0].nvcc:
# check the maximum supported nvcc version for the given cxx version
for nvcc_gcc_comb in NVCC_GCC_CXX_SUPPORT:
if row[DEVICE_COMPILER].version < nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
if row[DEVICE_COMPILER].version >= nvcc_gcc_comb.nvcc:
if row[HOST_COMPILER].version >= nvcc_gcc_comb.gcc:
return False
break

"""
for compiler_type in (HOST_COMPILER, DEVICE_COMPILER):
if compiler_type in row and row[compiler_type].name == GCC:
if CXX_STANDARD in row:
if row[compiler_type].version <= GCC_CXX_SUPPORT[0].gcc_version:
# check the maximum supported gcc version for the given cxx version
for gcc_cxx_comb in GCC_CXX_SUPPORT:
if row[compiler_type].version >= gcc_cxx_comb.gcc_version:
if row[CXX_STANDARD].version >= gcc_cxx_comb.cxx_version:
reason(
output,
f"{__pretty_name_compiler(compiler_type)}"
f" gcc {row[compiler_type].version} "
f"does not support cxx {row[CXX_STANDARD].version}",
)
return False
break
"""
print("passed")
return True
27 changes: 1 addition & 26 deletions src/bashi/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ def __str__(self) -> str:
return f"NVCC {str(self.nvcc_version)} + CXX {self.cxx_version}"


class NvccGccCxxSupport(VersionSupportBase):
def __init__(self, nvcc_version: str, gcc_version: str):
VersionSupportBase.__init__(self, nvcc_version, gcc_version)
self.nvcc: packaging.version.Version = self.version1
self.gcc: packaging.version.Version = self.version2

def __str__(self) -> str:
return f"NVCC {str(self.gcc_version)} + GCC {self.cxx_version}"


class ClangCxxSupport(VersionSupportBase):
def __init__(self, clang_version: str, cxx_version: str):
VersionSupportBase.__init__(self, clang_version, cxx_version)
Expand All @@ -122,9 +112,6 @@ def __str__(self) -> str:
GCC: [6, 7, 8, 9, 10, 11, 12, 13],
CLANG: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
NVCC: [
10.0,
10.1,
10.2,
11.0,
11.1,
11.2,
Expand Down Expand Up @@ -172,8 +159,6 @@ def __str__(self) -> str:
NvccHostSupport("11.4", "11"),
NvccHostSupport("11.1", "10"),
NvccHostSupport("11.0", "9"),
NvccHostSupport("10.1", "8"),
NvccHostSupport("10.0", "7"),
]
NVCC_GCC_MAX_VERSION.sort(reverse=True)

Expand All @@ -187,21 +172,13 @@ def __str__(self) -> str:


# define the maximum supported cxx version for a specific nvcc version
NVCC_CXX_SUPPORT: List[GccCxxSupport] = [
NVCC_CXX_SUPPORT: List[NvccCxxSupport] = [
NvccCxxSupport("11.0", "17"), # NVCC versions older than 11.0 does not support C++ 17
NvccCxxSupport("12.0", "20"), # NVCC versions older than 12.0 does not support C++ 20
]
NVCC_CXX_SUPPORT.sort(reverse=True)


# define the maximum supported cxx version for a specific nvcc gcc combination
NVCC_GCC_CXX_SUPPORT: List[NvccGccCxxSupport] = [
NvccGccCxxSupport("10.1", "8"),
NvccGccCxxSupport("11.1", "10"),
]
NVCC_CXX_SUPPORT.sort(reverse=True)


CLANG_CXX_SUPPORT: List[ClangCxxSupport] = [
ClangCxxSupport("9", "17"),
ClangCxxSupport("14", "20"),
Expand All @@ -225,8 +202,6 @@ def __str__(self) -> str:
NvccHostSupport("11.2", "11"),
NvccHostSupport("11.1", "10"),
NvccHostSupport("11.0", "9"),
NvccHostSupport("10.1", "8"),
NvccHostSupport("10.0", "6"),
]
NVCC_CLANG_MAX_VERSION.sort(reverse=True)

Expand Down

0 comments on commit 681e7e4

Please sign in to comment.