Feature/raja chai umpire update (#17665)

* Changing raja, chai, and umpire packages so all will compile with each other.

* Need a CUDA version of CHAI when compiling with raja+cuda+chai

* Updating checks for commit.

* Adding comments explaining why chai+umpire tests were disabled

* Reactivating tests for CHAI and Umpire

* reordering versions

* Unified handling of Cuda Arch

* Adding latest versions

* Unused/Untested: removed

* Aesthetic and test mode in Chai

* Unified handling of Cuda Arch

* Using 'ON' consistently, instead of 'On'

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Fix, suggestion and patch:

Chai depends on RAJA, not the other way.
Apply suggested master-main version mapping.
Add Umpire version 3.0.0 and patch.

Co-authored-by: Robert Blake <blake14@llnl.gov>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Adrien Bernede 2020-08-07 15:42:07 -07:00 committed by GitHub
parent ceed9c4bc0
commit 3978db91dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 102 additions and 8 deletions

View file

@ -0,0 +1,61 @@
# Copyright 2013-2019 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 Chai(CMakePackage, CudaPackage):
"""
Copy-hiding array interface for data migration between memory spaces
"""
homepage = "https://github.com/LLNL/CHAI"
git = "https://github.com/LLNL/CHAI.git"
version('develop', branch='develop', submodules='True')
version('master', branch='main', submodules='True')
version('2.1.1', tag='v2.1.1', submodules='True')
version('2.1.0', tag='v2.1.0', submodules='True')
version('2.0.0', tag='v2.0.0', submodules='True')
version('1.2.0', tag='v1.2.0', submodules='True')
version('1.1.0', tag='v1.1.0', submodules='True')
version('1.0', tag='v1.0', submodules='True')
variant('shared', default=True, description='Build Shared Libs')
variant('raja', default=False, description='Build plugin for RAJA')
depends_on('cmake@3.8:', type='build')
depends_on('umpire')
depends_on('raja', when="+raja")
depends_on('cmake@3.9:', type='build', when="+cuda")
depends_on('umpire+cuda', when="+cuda")
depends_on('raja+cuda', when="+raja+cuda")
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
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))
else:
options.append('-DENABLE_CUDA=OFF')
options.append('-Dumpire_DIR:PATH='
+ spec['umpire'].prefix.share.umpire.cmake)
options.append('-DENABLE_TESTS={0}'.format(
'ON' if self.run_tests else 'OFF'))
return options

View file

@ -13,7 +13,7 @@ class Raja(CMakePackage, CudaPackage):
git = "https://github.com/LLNL/RAJA.git"
version('develop', branch='develop', submodules='True')
version('main', branch='main', submodules='True')
version('master', branch='main', submodules='True')
version('0.11.0', tag='v0.11.0', submodules="True")
version('0.10.1', tag='v0.10.1', submodules="True")
version('0.10.0', tag='v0.10.0', submodules="True")
@ -39,20 +39,27 @@ def cmake_args(self):
options = []
options.append('-DENABLE_OPENMP={0}'.format(
'On' if '+openmp' in spec else 'Off'))
'ON' if '+openmp' in spec else 'Off'))
if '+cuda' in spec:
options.extend([
'-DENABLE_CUDA=On',
'-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
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
# shared vs static libs
if "+shared" in spec:
options.append('-DBUILD_SHARED_LIBS=ON')
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))
else:
options.append('-DBUILD_SHARED_LIBS=OFF')
options.append('-DENABLE_CUDA=OFF')
options.append('-DBUILD_SHARED_LIBS={0}'.format(
'ON' if '+shared' in spec else 'OFF'))
options.append('-DENABLE_CHAI={0}'.format(
'ON' if '+chai' in spec else 'OFF'))
# Work around spack adding -march=ppc64le to SPACK_TARGET_ARGS which
# is used by the spack compiler wrapper. This can go away when BLT
# removes -Werror from GTest flags
@ -61,4 +68,8 @@ def cmake_args(self):
else:
options.append('-DENABLE_TESTS=ON')
if '+chai' in spec:
options.extend([
'-DENABLE_CHAI=ON'])
return options

View file

@ -0,0 +1,18 @@
diff --git a/umpire-config.cmake.in b/umpire-config.cmake.in
index a98ad5fe..4e54e173 100644
--- a/umpire-config.cmake.in
+++ b/umpire-config.cmake.in
@@ -7,6 +7,13 @@
get_filename_component(UMPIRE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(UMPIRE_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include")
+if (NOT TARGET camp)
+ if (NOT DEFINED camp_DIR)
+ set(camp_DIR @CMAKE_INSTALL_PREFIX@/lib/cmake/camp)
+ endif ()
+ find_package(camp REQUIRED)
+endif ()
+
set(Umpire_VERSION_MAJOR @Umpire_VERSION_MAJOR@)
set(Umpire_VERSION_MINOR @Umpire_VERSION_MINOR@)
set(Umpire_VERSION_PATCH @Umpire_VERSION_PATCH@)

View file

@ -15,7 +15,8 @@ class Umpire(CMakePackage, CudaPackage):
git = 'https://github.com/LLNL/Umpire.git'
version('develop', branch='develop', submodules='True')
version('main', branch='main', submodules='True')
version('master', branch='main', submodules='True')
version('3.0.0', tag='v3.0.0', 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')
@ -35,6 +36,8 @@ class Umpire(CMakePackage, CudaPackage):
version('0.1.4', tag='v0.1.4', submodules='True')
version('0.1.3', tag='v0.1.3', submodules='True')
patch('camp_target_umpire_3.0.0.patch', when='@3.0.0')
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')
@ -61,6 +64,7 @@ def cmake_args(self):
if not spec.satisfies('cuda_arch=none'):
cuda_arch = spec.variants['cuda_arch'].value
options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
flag = '-arch sm_{0}'.format(cuda_arch[0])
options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag))