-
Notifications
You must be signed in to change notification settings - Fork 117
[test] Add PrgEnv checks for HIP #1880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
30378ea
Add build HIP check
jjotero 22fdb38
Merge branch 'master' into test/hip
jjotero beddf69
Cleanup cmake setup
jjotero 33829a1
Add hello world test
jjotero b5dae05
Add copyright
jjotero bfb08ac
Set executable in the class body
jjotero 23afa3d
Add FIXME
jjotero f010823
Merge branch 'master' into test/hip
5cb7b3f
Update hip_platform variable
jjotero bf8005c
Merge branch 'test/hip' of github.com:jjotero/reframe into test/hip
jjotero a18eb2e
Set deps in post-init hook
jjotero b4326b7
Merge branch 'master' into test/hip
28a4ebb
Merge branch 'master' into test/hip
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich) | ||
| # ReFrame Project Developers. See the top-level LICENSE file for details. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| import os | ||
| import reframe as rfm | ||
| import reframe.utility.sanity as sn | ||
|
|
||
|
|
||
| @rfm.simple_test | ||
| class BuildHip(rfm.RegressionTest): | ||
| '''Download and install HIP around the nvcc compiler.''' | ||
|
|
||
| # HIP build variables | ||
| hip_path = variable(str, value='hip') | ||
| hip_full_path = variable(str) | ||
| hip_platform = variable(str, value='nvidia') | ||
|
|
||
| valid_systems = ['daint:gpu', 'dom:gpu'] | ||
| valid_prog_environs = ['PrgEnv-gnu'] | ||
| sourcesdir = 'https://github.com/ROCm-Developer-Tools/HIP.git' | ||
| build_system = 'CMake' | ||
| postbuild_cmds = ['make install'] | ||
| executable = f'{hip_path}/bin/hipcc' | ||
| executable_opts = ['--version'] | ||
| maintainers = ['JO'] | ||
| tags = {'production'} | ||
|
|
||
| @rfm.run_before('compile') | ||
| def set_compile_options(self): | ||
| self.hip_full_path = os.path.abspath( | ||
| os.path.join(self.stagedir, self.hip_path) | ||
| ) | ||
| self.build_system.builddir = 'build' | ||
| self.build_system.config_opts = [ | ||
| f'-DCMAKE_INSTALL_PREFIX={self.hip_full_path}', | ||
| f'-DHIP_PLATFORM={self.hip_platform}', | ||
| ] | ||
|
|
||
| @rfm.run_before('sanity') | ||
| def set_sanity_patterns(self): | ||
| self.sanity_patterns = sn.assert_found(r'nvcc:\s+NVIDIA', self.stdout) | ||
|
|
||
|
|
||
| @rfm.simple_test | ||
| class HelloHip(rfm.RegressionTest): | ||
| '''A Hello World test for HIP.''' | ||
|
|
||
| # Declare custom test variables | ||
| sample = variable(str, value='HelloWorld') | ||
| sample_dir = variable(str, value='HIP-Examples-Applications') | ||
| hip_path = variable(str) | ||
|
|
||
| valid_systems = ['daint:gpu', 'dom:gpu'] | ||
| valid_prog_environs = ['PrgEnv-gnu'] | ||
| modules = ['cdt-cuda'] | ||
| sourcesdir = 'https://github.com/ROCm-Developer-Tools/HIP-Examples.git' | ||
| prebuild_cmds = [f'cd {sample_dir}/{sample}'] | ||
| build_system = 'Make' | ||
| executable = f'{sample_dir}/{sample}/{sample}' | ||
| maintainers = ['JO'] | ||
| tags = {'production'} | ||
|
|
||
| @rfm.run_after('init') | ||
| def set_deps(self): | ||
| self.depends_on('BuildHip') | ||
|
|
||
| @rfm.require_deps | ||
| def get_hip_path(self, BuildHip): | ||
| self.hip_path = BuildHip().hip_full_path | ||
vkarak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @rfm.run_before('compile') | ||
| def set_env(self): | ||
| self.variables = {'HIP_PATH': f'{self.hip_path}'} | ||
| self.build_system.cxx = os.path.join(self.hip_path, 'bin', 'hipcc') | ||
|
|
||
| @rfm.run_before('sanity') | ||
| def set_sanity(self): | ||
| self.sanity_patterns = sn.assert_found(r'HelloWorld', self.stdout) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.