summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hip/package.py3
-rw-r--r--var/spack/repos/builtin/packages/rocprofiler-dev/package.py76
-rw-r--r--var/spack/repos/builtin/packages/roctracer-dev-api/package.py39
3 files changed, 50 insertions, 68 deletions
diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py
index 0f0568bdca..2343c4d602 100644
--- a/var/spack/repos/builtin/packages/hip/package.py
+++ b/var/spack/repos/builtin/packages/hip/package.py
@@ -41,6 +41,7 @@ class Hip(CMakePackage):
depends_on('comgr@' + ver, when='@' + ver)
depends_on('llvm-amdgpu@{0} +rocm-device-libs'.format(ver), when='@' + ver)
depends_on('rocminfo@' + ver, when='@' + ver)
+ depends_on('roctracer-dev-api@' + ver, when='@' + ver)
# hipcc likes to add `-lnuma` by default :(
# ref https://github.com/ROCm-Developer-Tools/HIP/pull/2202
@@ -234,6 +235,8 @@ class Hip(CMakePackage):
def cmake_args(self):
args = [
+ self.define('PROF_API_HEADER_PATH', join_path(
+ self.spec['roctracer-dev-api'].prefix, 'roctracer', 'inc', 'ext')),
self.define('HIP_COMPILER', 'clang'),
self.define('HSA_PATH', self.spec['hsa-rocr-dev'].prefix)
]
diff --git a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py
index 2437cb4d9c..c7e6cd5962 100644
--- a/var/spack/repos/builtin/packages/rocprofiler-dev/package.py
+++ b/var/spack/repos/builtin/packages/rocprofiler-dev/package.py
@@ -31,81 +31,21 @@ class RocprofilerDev(CMakePackage):
depends_on('hsakmt-roct@' + ver, when='@' + ver)
depends_on('hsa-rocr-dev@' + ver, when='@' + ver)
depends_on('rocminfo@' + ver, when='@' + ver)
+ depends_on('roctracer-dev-api@' + ver, when='@' + ver)
# See https://github.com/ROCm-Developer-Tools/rocprofiler/pull/50
patch('fix-includes.patch')
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.5.0.tar.gz',
- sha256='7af5326c9ca695642b4265232ec12864a61fd6b6056aa7c4ecd9e19c817f209e',
- expand=True,
- destination='',
- placement='roctracer',
- when='@3.5.0')
-
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.7.0.tar.gz',
- sha256='6fa5b771e990f09c242237ab334b9f01039ec7d54ccde993e719c5d6577d1518',
- expand=True,
- destination='',
- placement='roctracer',
- when='@3.7.0')
-
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.8.0.tar.gz',
- sha256='5154a84ce7568cd5dba756e9508c34ae9fc62f4b0b5731f93c2ad68b21537ed1',
- expand=True,
- destination='',
- placement='roctracer',
- when='@3.8.0')
-
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.9.0.tar.gz',
- sha256='0678f9faf45058b16923948c66d77ba2c072283c975d167899caef969169b292',
- expand=True,
- destination='',
- placement='roctracer',
- when='@3.9.0')
-
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-3.10.0.tar.gz',
- sha256='ac4a1d059fc34377e906071fd0e56f5434a7e0e4ded9db8faf9217a115239dec',
- expand=True,
- destination='',
- placement='roctracer',
- when='@3.10.0')
-
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.0.0.tar.gz',
- sha256='f47859a46173228b597c463eda850b870e810534af5efd5f2a746067ef04edee',
- expand=True,
- destination='',
- placement='roctracer',
- when='@4.0.0')
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.1.0.tar.gz',
- sha256='5d93de4e92895b6eb5f9d098f5dbd182d33923bd9b2ab69cf5a1abbf91d70695',
- expand=True,
- destination='',
- placement='roctracer',
- when='@4.1.0')
- resource(name='roctracer-dev',
- url='https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.2.0.tar.gz',
- sha256='62a9c0cb1ba50b1c39a0636c886ac86e75a1a71cbf5fec05801517ceb0e67a37',
- expand=True,
- destination='',
- placement='roctracer',
- when='@4.2.0')
-
def patch(self):
filter_file('${HSA_RUNTIME_LIB_PATH}/../include',
'${HSA_RUNTIME_LIB_PATH}/../include ${HSA_KMT_LIB_PATH}/..\
/include', 'test/CMakeLists.txt', string=True)
def cmake_args(self):
- args = ['-DPROF_API_HEADER_PATH={0}/roctracer/inc/ext'.format(
- self.stage.source_path),
- '-DROCM_ROOT_DIR:STRING={0}/include'.format(
- self.spec['hsakmt-roct'].prefix)
- ]
- return args
+ return [
+ self.define(
+ 'PROF_API_HEADER_PATH',
+ self.spec['roctracer-dev-api'].prefix.roctracer.inc.ext
+ ),
+ self.define('ROCM_ROOT_DIR', self.spec['hsakmt-roct'].prefix.include)
+ ]
diff --git a/var/spack/repos/builtin/packages/roctracer-dev-api/package.py b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py
new file mode 100644
index 0000000000..eb23b4f152
--- /dev/null
+++ b/var/spack/repos/builtin/packages/roctracer-dev-api/package.py
@@ -0,0 +1,39 @@
+# Copyright 2013-2021 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 RoctracerDevApi(Package):
+ """ROC-tracer API. Installs the API header files of the roctracer-dev
+ package, mainly to avoid circular dependencies in the ROCm ecosystem.
+ For the ROC-tracer library, please check out roctracer-dev."""
+
+ homepage = "https://github.com/ROCm-Developer-Tools/roctracer"
+ git = "https://github.com/ROCm-Developer-Tools/roctracer.git"
+ url = "https://github.com/ROCm-Developer-Tools/roctracer/archive/rocm-4.2.0.tar.gz"
+
+ maintainers = ['srekolam', 'arjun-raj-kuppala']
+
+ version('4.2.0', sha256='62a9c0cb1ba50b1c39a0636c886ac86e75a1a71cbf5fec05801517ceb0e67a37')
+ version('4.1.0', sha256='5d93de4e92895b6eb5f9d098f5dbd182d33923bd9b2ab69cf5a1abbf91d70695')
+ version('4.0.0', sha256='f47859a46173228b597c463eda850b870e810534af5efd5f2a746067ef04edee')
+ version('3.10.0', sha256='ac4a1d059fc34377e906071fd0e56f5434a7e0e4ded9db8faf9217a115239dec')
+ version('3.9.0', sha256='0678f9faf45058b16923948c66d77ba2c072283c975d167899caef969169b292')
+ version('3.8.0', sha256='5154a84ce7568cd5dba756e9508c34ae9fc62f4b0b5731f93c2ad68b21537ed1')
+ version('3.7.0', sha256='6fa5b771e990f09c242237ab334b9f01039ec7d54ccde993e719c5d6577d1518')
+ version('3.5.0', sha256='7af5326c9ca695642b4265232ec12864a61fd6b6056aa7c4ecd9e19c817f209e')
+
+ def install(self, spec, prefix):
+ source_directory = self.stage.source_path
+ include = join_path(source_directory, 'inc')
+
+ def only_headers(p):
+ return (p.endswith('CMakeLists.txt') or
+ p.endswith('RPM') or
+ p.endswith('DEBIAN'))
+
+ mkdirp(prefix.roctracer.inc)
+ install_tree(include, prefix.roctracer.inc, ignore=only_headers)