1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Umpire(CMakePackage, CudaPackage):
"""An application-focused API for memory management on NUMA & GPU
architectures"""
homepage = 'https://github.com/LLNL/Umpire'
git = 'https://github.com/LLNL/Umpire.git'
version('develop', branch='develop', submodules='True')
version('main', branch='main', submodules='True')
version('2.1.0', tag='v2.1.0', submodules='True')
version('2.0.0', tag='v2.0.0', submodules='True')
version('1.1.0', tag='v1.1.0', submodules='True')
version('1.0.1', tag='v1.0.1', submodules='True')
version('1.0.0', tag='v1.0.0', submodules='True')
version('0.3.5', tag='v0.3.5', submodules='True')
version('0.3.4', tag='v0.3.4', submodules='True')
version('0.3.3', tag='v0.3.3', submodules='True')
version('0.3.2', tag='v0.3.2', submodules='True')
version('0.3.1', tag='v0.3.1', submodules='True')
version('0.3.0', tag='v0.3.0', submodules='True')
version('0.2.4', tag='v0.2.4', submodules='True')
version('0.2.3', tag='v0.2.3', submodules='True')
version('0.2.2', tag='v0.2.2', submodules='True')
version('0.2.1', tag='v0.2.1', submodules='True')
version('0.2.0', tag='v0.2.0', submodules='True')
version('0.1.4', tag='v0.1.4', submodules='True')
version('0.1.3', tag='v0.1.3', submodules='True')
variant('fortran', default=False, description='Build C/Fortran API')
variant('c', default=True, description='Build C API')
variant('numa', default=False, description='Enable NUMA support')
variant('openmp', default=False, description='Build with OpenMP support')
variant('deviceconst', default=False,
description='Enables support for constant device memory')
depends_on('cmake@3.8:', type='build')
depends_on('cmake@3.9:', when='+cuda', type='build')
conflicts('+numa', when='@:0.3.2')
conflicts('~c', when='+fortran', msg='Fortran API requires C API')
def cmake_args(self):
spec = self.spec
options = []
if '+cuda' in spec:
options.extend([
'-DENABLE_CUDA=On',
'-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)])
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))
if '+deviceconst' in spec:
options.append('-DENABLE_DEVICE_CONST=On')
else:
options.append('-DENABLE_CUDA=Off')
options.append('-DENABLE_C={0}'.format(
'On' if '+c' in spec else 'Off'))
options.append('-DENABLE_FORTRAN={0}'.format(
'On' if '+fortran' in spec else 'Off'))
options.append('-DENABLE_NUMA={0}'.format(
'On' if '+numa' in spec else 'Off'))
options.append('-DENABLE_OPENMP={0}'.format(
'On' if '+openmp' in spec else 'Off'))
options.append('-DENABLE_TESTS={0}'.format(
'On' if self.run_tests else 'Off'))
return options
|