gromacs: simplified use of targets (#19646)
This commit is contained in:
		 Massimiliano Culpo
					Massimiliano Culpo
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							77fc458d29
						
					
				
				
					commit
					e4a5a06e87
				
			| @@ -2,9 +2,6 @@ | ||||
| # Spack Project Developers. See the top-level COPYRIGHT file for details. | ||||
| # | ||||
| # SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||||
| import archspec.cpu | ||||
| 
 | ||||
| 
 | ||||
| class Gromacs(CMakePackage): | ||||
|     """GROMACS (GROningen MAchine for Chemical Simulations) is a molecular | ||||
|     dynamics package primarily designed for simulations of proteins, lipids | ||||
| @@ -158,25 +155,25 @@ def cmake_args(self): | ||||
| 
 | ||||
|         # Activate SIMD based on properties of the target | ||||
|         target = self.spec.target | ||||
|         if target >= archspec.cpu.TARGETS['zen2']: | ||||
|         if target >= 'zen2': | ||||
|             # AMD Family 17h (EPYC Rome) | ||||
|             options.append('-DGMX_SIMD=AVX2_256') | ||||
|         elif target >= archspec.cpu.TARGETS['zen']: | ||||
|         elif target >= 'zen': | ||||
|             # AMD Family 17h (EPYC Naples) | ||||
|             options.append('-DGMX_SIMD=AVX2_128') | ||||
|         elif target >= archspec.cpu.TARGETS['bulldozer']: | ||||
|         elif target >= 'bulldozer': | ||||
|             # AMD Family 15h | ||||
|             options.append('-DGMX_SIMD=AVX_128_FMA') | ||||
|         elif 'vsx' in target: | ||||
|             # IBM Power 7 and beyond | ||||
|             options.append('-DGMX_SIMD=IBM_VSX') | ||||
|         elif target.family == archspec.cpu.TARGETS['aarch64']: | ||||
|         elif target.family == 'aarch64': | ||||
|             # ARMv8 | ||||
|             if self.spec.satisfies('%nvhpc'): | ||||
|                 options.append('-DGMX_SIMD=None') | ||||
|             else: | ||||
|                 options.append('-DGMX_SIMD=ARM_NEON_ASIMD') | ||||
|         elif target == archspec.cpu.TARGETS['mic_knl']: | ||||
|         elif target == 'mic_knl': | ||||
|             # Intel KNL | ||||
|             options.append('-DGMX_SIMD=AVX_512_KNL') | ||||
|         elif target.vendor == 'GenuineIntel': | ||||
|   | ||||
		Reference in New Issue
	
	Block a user