Add auto-dispatch specification to Intel packages (#11697)

This PR adds the ability to specify the auto-dispatch targets that can
be used by the Intel compilers. The `-ax` flag will be written to the
respective compiler configuration files. This ability is very handy when
wanting to build optimized builds for various architectures. This PR
does not set any optimization flags, however.
This commit is contained in:
Glenn Johnson
2019-07-15 13:37:54 -05:00
committed by Peter Scheibel
parent 5acbe449e5
commit 3f83a2a7d8
3 changed files with 59 additions and 1 deletions

View File

@@ -129,6 +129,13 @@ class IntelParallelStudio(IntelPackage):
multi=False
)
auto_dispatch_options = IntelPackage.auto_dispatch_options
variant(
'auto_dispatch',
values=any_combination_of(*auto_dispatch_options),
description='Enable generation of multiple auto-dispatch code paths'
)
# Components available in all editions
variant('daal', default=True,
description='Install the Intel DAAL libraries')
@@ -186,6 +193,12 @@ class IntelParallelStudio(IntelPackage):
conflicts('+daal', when='@cluster.0:cluster.2015.7')
conflicts('+daal', when='@composer.0:composer.2015.7')
# MacOS does not support some of the auto dispatch settings
conflicts('auto_dispatch=SSE2', 'platform=darwin',
msg='SSE2 is not supported on MacOS')
conflicts('auto_dispatch=SSE3', 'platform=darwin target=x86_64',
msg='SSE3 is not supported on MacOS x86_64')
def setup_dependent_environment(self, *args):
# Handle in callback, conveying client's compilers in additional arg.
# CAUTION - DUP code in:

View File

@@ -43,5 +43,18 @@ class Intel(IntelPackage):
variant('rpath', default=True, description='Add rpath to .cfg files')
auto_dispatch_options = IntelPackage.auto_dispatch_options
variant(
'auto_dispatch',
values=any_combination_of(*auto_dispatch_options),
description='Enable generation of multiple auto-dispatch code paths'
)
# MacOS does not support some of the auto dispatch settings
conflicts('auto_dispatch=SSE2', 'platform=darwin',
msg='SSE2 is not supported on MacOS')
conflicts('auto_dispatch=SSE3', 'platform=darwin target=x86_64',
msg='SSE3 is not supported on MacOS x86_64')
# Since the current package is a subset of 'intel-parallel-studio',
# all remaining Spack actions are handled in the package class.