rocm: make amdgpu_target sticky (#34591)
The sticky property will prevent clingo from changing the amdgpu_target
to work around conflicts. This is the same behaviour as was adopted for
cuda_arch in 055c9d125d.
			
			
This commit is contained in:
		@@ -132,6 +132,7 @@ class ROCmPackage(PackageBase):
 | 
				
			|||||||
        "amdgpu_target",
 | 
					        "amdgpu_target",
 | 
				
			||||||
        description="AMD GPU architecture",
 | 
					        description="AMD GPU architecture",
 | 
				
			||||||
        values=spack.variant.any_combination_of(*amdgpu_targets),
 | 
					        values=spack.variant.any_combination_of(*amdgpu_targets),
 | 
				
			||||||
 | 
					        sticky=True,
 | 
				
			||||||
        when="+rocm",
 | 
					        when="+rocm",
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,7 @@ class Rccl(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -103,7 +103,7 @@ class Rocalution(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,7 @@ class Rocblas(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant("tensile", default=True, description="Use Tensile as a backend")
 | 
					    variant("tensile", default=True, description="Use Tensile as a backend")
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -104,8 +104,10 @@ class Rocfft(CMakePackage):
 | 
				
			|||||||
        values=("Release", "Debug", "RelWithDebInfo"),
 | 
					        values=("Release", "Debug", "RelWithDebInfo"),
 | 
				
			||||||
        description="CMake build type",
 | 
					        description="CMake build type",
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant("amdgpu_target_sram_ecc", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant(
 | 
				
			||||||
 | 
					        "amdgpu_target_sram_ecc", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    depends_on("cmake@3.16:", type="build", when="@4.5.0:")
 | 
					    depends_on("cmake@3.16:", type="build", when="@4.5.0:")
 | 
				
			||||||
    depends_on("cmake@3.5:", type="build")
 | 
					    depends_on("cmake@3.5:", type="build")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,7 +95,7 @@ class Rocprim(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,7 +101,7 @@ class Rocrand(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ class Rocsolver(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "optimal",
 | 
					        "optimal",
 | 
				
			||||||
        default=True,
 | 
					        default=True,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -25,7 +25,7 @@ class Rocsparse(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
					    amdgpu_targets = ROCmPackage.amdgpu_targets
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -100,7 +100,7 @@ class Rocthrust(CMakePackage):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # the rocthrust library itself is header-only, but the build_type and amdgpu_target
 | 
					    # the rocthrust library itself is header-only, but the build_type and amdgpu_target
 | 
				
			||||||
    # are relevant to the test client
 | 
					    # are relevant to the test client
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@ class Rocwmma(CMakePackage):
 | 
				
			|||||||
    # releases
 | 
					    # releases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    amdgpu_targets = ("gfx908:xnack-", "gfx90a", "gfx90a:xnack-", "gfx90a:xnack+")
 | 
					    amdgpu_targets = ("gfx908:xnack-", "gfx90a", "gfx90a:xnack-", "gfx90a:xnack+")
 | 
				
			||||||
    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
 | 
					    variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets), sticky=True)
 | 
				
			||||||
    variant(
 | 
					    variant(
 | 
				
			||||||
        "build_type",
 | 
					        "build_type",
 | 
				
			||||||
        default="Release",
 | 
					        default="Release",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user