pax_global_header 0000666 0000000 0000000 00000000064 15015373404 0014514 g ustar 00root root 0000000 0000000 52 comment=39982887e9dc77e1057a8fc2485bdee05e5aa87d
hipFFT-rocm-6.4.3/ 0000775 0000000 0000000 00000000000 15015373404 0013604 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/.azuredevops/ 0000775 0000000 0000000 00000000000 15015373404 0016231 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/.azuredevops/rocm-ci.yml 0000664 0000000 0000000 00000001240 15015373404 0020302 0 ustar 00root root 0000000 0000000 resources:
repositories:
- repository: pipelines_repo
type: github
endpoint: ROCm
name: ROCm/ROCm
variables:
- group: common
- template: /.azuredevops/variables-global.yml@pipelines_repo
trigger:
batch: true
branches:
include:
- develop
- mainline
paths:
exclude:
- .githooks
- .github
- .jenkins
- docs
- '.*.y*ml'
- '*.md'
pr:
autoCancel: true
branches:
include:
- develop
- mainline
paths:
exclude:
- .githooks
- .github
- .jenkins
- docs
- '.*.y*ml'
- '*.md'
drafts: false
jobs:
- template: ${{ variables.CI_COMPONENT_PATH }}/hipFFT.yml@pipelines_repo
hipFFT-rocm-6.4.3/.clang-format 0000664 0000000 0000000 00000006542 15015373404 0016166 0 ustar 00root root 0000000 0000000 # Style file for MLSE Libraries based on the modified rocBLAS style
# Common settings
BasedOnStyle: WebKit
TabWidth: 4
IndentWidth: 4
UseTab: Never
ColumnLimit: 100
# Other languages JavaScript, Proto
---
Language: Cpp
# http://releases.llvm.org/6.0.1/tools/clang/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code
# int formatted_code;
# // clang-format off
# void unformatted_code ;
# // clang-format on
# void formatted_code_again;
DisableFormat: false
Standard: Cpp11
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom
# Control of individual brace wrapping cases
BraceWrapping: {
AfterCaseLabel: 'true'
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
# AfterExternBlock : 'true'
}
#BreakAfterJavaFieldAnnotations: true
#BreakBeforeInheritanceComma: false
#BreakBeforeBinaryOperators: None
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializersBeforeComma: true
#BreakStringLiterals: true
CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: false
DerivePointerAlignment: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
IndentPPDirectives: None
#FixNamespaceComments: true
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
#JavaScriptQuotes: Double
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBlockIndentWidth: 4
#ObjCSpaceAfterProperty: true
#ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#SpaceAfterTemplateKeyword: true
#SpaceBeforeInheritanceColon: true
#SortUsingDeclarations: true
SortIncludes: true
# Comments are for developers, they should arrange them
ReflowComments: false
#IncludeBlocks: Preserve
---
hipFFT-rocm-6.4.3/.githooks/ 0000775 0000000 0000000 00000000000 15015373404 0015511 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/.githooks/install 0000775 0000000 0000000 00000000222 15015373404 0017101 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
cd $(git rev-parse --git-dir)
cd hooks
echo "Installing hooks..."
ln -s ../../.githooks/pre-commit pre-commit
echo "Done!"
hipFFT-rocm-6.4.3/.githooks/pre-commit 0000775 0000000 0000000 00000001766 15015373404 0017525 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# This pre-commit hook checks if any versions of clang-format
# are installed, and if so, uses the installed version to format
# the staged changes.
base=/opt/rocm/hcc/bin/clang-format
format=""
# Redirect output to stderr.
exec 1>&2
# check if clang-format is installed
type "$base" >/dev/null 2>&1 && format="$base"
# no versions of clang-format are installed
if [ -z "$format" ]
then
echo "$base is not installed. Pre-commit hook will not be executed."
exit 0
fi
# Do everything from top - level
cd $(git rev-parse --show-toplevel)
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
# do the formatting
for file in $(git diff-index --cached --name-only $against | grep -E '\.h$|\.hpp$|\.cpp$|\.cl$|\.h\.in$|\.hpp\.in$|\.cpp\.in$')
do
if [ -e "$file" ]
then
echo "$format $file"
"$format" -i -style=file "$file"
fi
done
hipFFT-rocm-6.4.3/.github/ 0000775 0000000 0000000 00000000000 15015373404 0015144 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/.github/CODEOWNERS 0000775 0000000 0000000 00000000576 15015373404 0016552 0 ustar 00root root 0000000 0000000 * @af-ayala @eng-flavio-teixeira @evetsso @feizheng10 @malcolmroberts
# Documentation files
docs/ @ROCm/rocm-documentation
*.md @ROCm/rocm-documentation
*.rst @ROCm/rocm-documentation
.readthedocs.yaml @ROCm/rocm-documentation
# Header directory for Doxygen documentation
library/include/ @ROCm/rocm-documentation @af-ayala @eng-flavio-teixeira @evetsso @feizheng10 @malcolmroberts
hipFFT-rocm-6.4.3/.github/CONTRIBUTING.md 0000664 0000000 0000000 00000015170 15015373404 0017401 0 ustar 00root root 0000000 0000000
# Contributing to hipFFT #
We welcome contributions to hipFFT. Please follow these details to help ensure your contributions will be successfully accepted.
## Issue Discussion ##
Please use the GitHub Issues tab to notify us of issues.
* Use your best judgment for issue creation. If your issue is already listed, upvote the issue and
comment or post to provide additional details, such as how you reproduced this issue.
* If you're not sure if your issue is the same, err on the side of caution and file your issue.
You can add a comment to include the issue number (and link) for the similar issue. If we evaluate
your issue as being the same as the existing issue, we'll close the duplicate.
* If your issue doesn't exist, use the issue template to file a new issue.
* When filing an issue, be sure to provide as much information as possible, including script output so
we can collect information about your configuration. This helps reduce the time required to
reproduce your issue.
* Check your issue regularly, as we may require additional information to successfully reproduce the
issue.
* You may also open an issue to ask questions to the maintainers about whether a proposed change
meets the acceptance criteria, or to discuss an idea pertaining to the library.
## Acceptance Criteria ##
When a contribution is submitted via a pull request, a number of automated checks are run in order to verify compilation correctness and prevent performance regressions.
These checks include:
* Building and testing the change on various OS platforms (Ubuntu, RHEL, etc.)
* Running on different AMD GPU architectures (MI-series, Radeon series cards, etc.)
* Running on different NVIDIA GPU architectures (V100, A100, etc)
* Running benchmarks to check for performance degradation
In order for a submission to be accepted:
* It must pass all of the automated checks
* It must undergo a code review
Users can visualize our continuous integration infrastructure in: `hipFFT/.jenkins`.
The GitHub "Issues" tab may also be used to discuss ideas surrounding particular features or changes before raising pull requests.
## Code Structure ##
In a broad view, hipFFT library is structured as follows:
├── docs/: contains hipFFT documentation
├── library/: contains main source code and headers
│ ├── src/amd_detail/ : for porting to AMD devices
│ ├── src/nvidia_detail/ : for porting to NVIDIA devices
├── clients/:
│ ├── bench/ : contains benchmarking code
│ ├── samples/ : contains examples
│ ├── tests/ : contains our test infrastructure
├── shared/: contains important global headers and those for linking to other applications
## Coding Style ##
* All public APIs are C89 compatible; all other library code should use c++17.
* Our minimum supported compiler is clang 3.6.
* Avoid CamelCase: rule applies specifically to publicly visible APIs, but is encouraged (not mandated) for internal code.
* C and C++ code should be formatted using `clang-format`. You can use the clang-format version available in `hipFFT/.clang-format`.
To format a C/C++ file, use:
```
clang-format -style=file -i
```
* Python code should use:
```
yapf --style pep8
```
## Pull Request Guidelines ##
Our code contribution guidelines closely follow the model of [GitHub pull-requests](https://help.github.com/articles/using-pull-requests/).
This repository follows the [git flow](http://nvie.com/posts/a-successful-git-branching-model/) workflow, which dictates a /master branch where releases are cut, and a /develop branch which serves as an integration branch for new code.
Note that a [git extension](https://github.com/nvie/gitflow) has been developed to ease the use of the 'git flow' methodology, but requires manual installation by the user.
The following guidelines apply:
* When you create a pull request, you should target the default branch. Our current default branch is the **develop** branch.
* Note that releases are cut to release/rocm-rel-x.y, where x and y refer to the release major and minor numbers.
* Ensure code builds successfully.
* Do not break existing test cases
* Code must also have benchmark tests, and performance must approach the compute bound limit or memory bound limit.
### Deliverables ###
New changes should include test coverage. Our testing infrastructure is located in `clients/tests/`, and can be used as a reference.
The following guidelines apply:
* New functionality will only be merged with new unit tests.
* New unit tests should integrate within the existing [googletest framework](https://github.com/google/googletest/blob/master/googletest/docs/Primer.md).
* Tests must have good code coverage.
### Process ###
All pull requests must pass through the checks and the code review described in the [Acceptance Criteria](#acceptance-criteria) section before they can be merged.
Once a contribution is ready to be submitted, consider the following:
* Before you create a PR, ensure that all files have been gone through the clang formatting: clang-format -i
* While creating a PR, you can take a look at a `diff` of the changes you made using the PR's "Files" tab, and verify that no unintentional changes are being submitted.
* Checks may take some time to complete. You can view their progress in the table near the bottom of the pull request page. You may also be able to use the links in the table to view logs associated with a check if it fails.
* During code reviews, another developer will take a look through your proposed change. If any modifications are requested (or further discussion about anything is needed), they may leave a comment. You can follow up and respond to the comment, and/or create comments of your own if you have questions or ideas.
* When a modification request has been completed, the conversation thread about it will be marked as resolved.
* To update the code in your PR (eg. in response to a code review discussion), you can simply push another commit to the branch used in your pull request.
* Once your contribution is approved, we will use the *squash merge* option from GitHub to integrate it to the corresponding branch.
## Code License ##
All code contributed to this project will be licensed under the license identified in the [LICENSE.md](https://github.com/ROCm/hipFFT/blob/develop/LICENSE.md). Your contribution will be accepted under the same license.
hipFFT-rocm-6.4.3/.github/ISSUE_TEMPLATE.md 0000664 0000000 0000000 00000000461 15015373404 0017652 0 ustar 00root root 0000000 0000000 ### What is the expected behavior
-
### What actually happens
-
### How to reproduce
-
### Environment
| Hardware | description |
|-----|-----|
| GPU | device string |
| CPU | device string |
| Software | version |
|-----|-----|
| ROCK | v0.0 |
| ROCR | v0.0 |
| HCC | v0.0 |
| Library | v0.0 |
hipFFT-rocm-6.4.3/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000000070 15015373404 0020742 0 ustar 00root root 0000000 0000000 resolves #___
Summary of proposed changes:
-
-
-
hipFFT-rocm-6.4.3/.github/dependabot.yml 0000664 0000000 0000000 00000001300 15015373404 0017766 0 ustar 00root root 0000000 0000000 # To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/sphinx" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "monthly"
labels:
- "documentation"
- "dependencies"
- "ci:docs-only"
reviewers:
- "samjwu"
- "malcolmroberts"
- "evetsso"
hipFFT-rocm-6.4.3/.gitignore 0000664 0000000 0000000 00000000646 15015373404 0015602 0 ustar 00root root 0000000 0000000 # Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# vim tags
tags
.tags
.*.swp
# Visual Studio Code
.vscode
# documentation artifacts
build/
_build/
_images/
_static/
_templates/
_toc.yml
docBin/
# python bytecode
__pycache__
hipFFT-rocm-6.4.3/.jenkins/ 0000775 0000000 0000000 00000000000 15015373404 0015323 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/.jenkins/common.groovy 0000664 0000000 0000000 00000007151 15015373404 0020066 0 ustar 00root root 0000000 0000000 import static groovy.io.FileType.FILES
def runCompileCommand(platform, project, jobName, boolean sameOrg = false)
{
project.paths.construct_build_prefix()
def getDependenciesCommand = ""
if (project.installLibraryDependenciesFromCI)
{
project.libraryDependencies.each
{ libraryName ->
getDependenciesCommand += auxiliary.getLibrary(libraryName, platform.jenkinsLabel, null, sameOrg)
}
}
String cmake = platform.jenkinsLabel.contains('centos') ? "cmake3" : "cmake"
String warningArgs = platform.jenkinsLabel.contains('cuda') ? '':'-DWERROR=ON'
String hipClang = platform.jenkinsLabel.contains('hipClang') ? "HIP_COMPILER=clang" : ""
String path = platform.jenkinsLabel.contains('centos7') ? "export PATH=/opt/rh/devtoolset-7/root/usr/bin:$PATH" : ":"
String dir = jobName.contains('Debug') ? "debug" : "release"
// hipcc with CUDA backend needs HIP_PLATFORM set accordingly in the environment
String hipPlatformCommand = platform.jenkinsLabel.contains("cuda") ? "export HIP_PLATFORM=nvidia" : ""
def command = """#!/usr/bin/env bash
set -x
ls /fftw/lib
export FFTW_ROOT=/fftw
export FFTW_INCLUDE_PATH=\${FFTW_ROOT}/include
export FFTW_LIB_PATH=\${FFTW_ROOT}/lib
export LD_LIBRARY_PATH=\${FFTW_LIB_PATH}:/opt/rocm/lib:/opt/rocm/hip/lib
export CPLUS_INCLUDE_PATH=\${FFTW_INCLUDE_PATH}:\${CPLUS_INCLUDE_PATH}
export CMAKE_PREFIX_PATH=\${FFTW_LIB_PATH}/cmake/fftw3:\${CMAKE_PREFIX_PATH}
export CMAKE_PREFIX_PATH=\${FFTW_LIB_PATH}/cmake/fftw3f:\${CMAKE_PREFIX_PATH}
# default container flags cause problems for CUDA backend, and aren't useful for ROCm
unset HIPCC_COMPILE_FLAGS_APPEND
unset HIPCC_LINK_FLAGS_APPEND
${hipPlatformCommand}
cd ${project.paths.project_build_prefix}
mkdir -p build/${dir} && cd build/${dir}
${getDependenciesCommand}
${path}
${hipClang} ${cmake} ${warningArgs} ${project.paths.build_command}
make -j\$(nproc)
"""
platform.runCommand(this, command)
}
def runTestCommand (platform, project, gfilter)
{
String cudaArgs = platform.jenkinsLabel.contains('cuda') ? '--double_epsilon=5e-11'
: '--precompile=rocfft-test-precompile.db'
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/release/clients/staging
GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./hipfft-test ${cudaArgs} --gtest_output=xml --gtest_color=yes --gtest_filter=${gfilter}
"""
platform.runCommand(this, command)
//junit "${project.paths.project_build_prefix}/build/release/clients/staging/*.xml"
}
def runPackageCommand(platform, project, jobName, label='')
{
def command
label = label != '' ? '-' + label.toLowerCase() : ''
String ext = platform.jenkinsLabel.contains('ubuntu') ? "deb" : "rpm"
String dir = jobName.contains('Debug') ? "debug" : "release"
command = """
set -x
cd ${project.paths.project_build_prefix}/build/${dir}
make package
mkdir -p package
for f in hipfft*.$ext
do
mv "\$f" "hipfft${label}-\${f#*-}"
done
mv *.${ext} package/
"""
platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/${dir}/package/*.${ext}""")
}
return this
hipFFT-rocm-6.4.3/.jenkins/debug.groovy 0000664 0000000 0000000 00000005253 15015373404 0017665 0 ustar 00root root 0000000 0000000 #!/usr/bin/env groovy
@Library('rocJenkins@pong') _
import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path
def runCI =
{
nodeDetails, jobName, buildCommand ->
def prj = new rocProject('hipFFT', 'Debug')
// customize for project
prj.paths.build_command = buildCommand
prj.libraryDependencies = ['rocRAND', 'rocFFT', 'hipRAND']
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
def commonGroovy
boolean formatCheck = false
def compileCommand =
{
platform, project->
project.paths.construct_build_prefix()
commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName)
}
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, null, null)
}
def setupCI(urlJobName, jobNameList, buildCommand, runCI, label)
{
jobNameList = auxiliary.appendJobNameList(jobNameList)
jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(label + ' ' + jobName) {
runCI(nodeDetails, jobName, buildCommand, label)
}
}
// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
if(!jobNameList.keySet().contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
stage(label + ' ' + urlJobName) {
runCI([ubuntu18:['gfx906']], urlJobName, buildCommand, label)
}
}
}
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])]]
propertyList = auxiliary.appendPropertyList(propertyList)
propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}
def hostJobNameList = ["compute-rocm-dkms-no-npi":([ubuntu18:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx906']])]
def hipClangJobNameList = ["compute-rocm-dkms-no-npi":([ubuntu18:['gfx900'],centos7:['gfx906'],sles15sp1:['gfx906']])]
String hostBuildCommand = '-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -L ../..'
String hipClangBuildCommand = '-DCMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++ -DCMAKE_BUILD_TYPE=Debug -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_SAMPLES=ON -DBUILD_CLIENTS_SAMPLES=ON -L ../..'
setupCI(urlJobName, hostJobNameList, hostBuildCommand, runCI, 'g++')
setupCI(urlJobName, hipClangJobNameList, hipClangBuildCommand, runCI, 'hip-clang')
}
hipFFT-rocm-6.4.3/.jenkins/multigpu.groovy 0000664 0000000 0000000 00000005371 15015373404 0020446 0 ustar 00root root 0000000 0000000 #!/usr/bin/env groovy
@Library('rocJenkins@pong') _
import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path
def runCI =
{
nodeDetails, jobName, buildCommand, label, runTest ->
def prj = new rocProject('hipFFT', 'multigpu')
// customize for project
prj.paths.build_command = buildCommand
prj.libraryDependencies = ['rocRAND', 'rocFFT', 'hipRAND']
prj.timeout.test = 360
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
def commonGroovy
boolean formatCheck = false
def compileCommand =
{
platform, project->
project.paths.construct_build_prefix()
commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project,jobName)
}
def testCommand =
{
platform, project->
def gfilter = "*multi_gpu*"
commonGroovy.runTestCommand(platform, project, gfilter)
}
def packageCommand =
{
platform, project->
commonGroovy.runPackageCommand(platform, project, jobName, label)
}
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, runTest ? testCommand : null, packageCommand)
}
def setupCI(urlJobName, jobNameList, buildCommand, runCI, label, runTest)
{
jobNameList = auxiliary.appendJobNameList(jobNameList)
jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(label + ' ' + jobName) {
runCI(nodeDetails, jobName, buildCommand, label, runTest)
}
}
// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
if(!jobNameList.keySet().contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
stage(label + ' ' + urlJobName) {
runCI([ubuntu18:['gfx906']], urlJobName, buildCommand, label)
}
}
}
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
def propertyList = ["main":[pipelineTriggers([cron('0 6 * * 0')])]]
propertyList = auxiliary.appendPropertyList(propertyList)
def jobNameList = ["main":([ubuntu20:['8gfx90a']])]
jobNameList = auxiliary.appendJobNameList(jobNameList)
propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}
String hipClangBuildCommand = '-DCMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_SAMPLES=ON -L ../..'
setupCI(urlJobName, jobNameList, hipClangBuildCommand, runCI, 'hip-clang', true)
}
hipFFT-rocm-6.4.3/.jenkins/staticanalysis.groovy 0000664 0000000 0000000 00000001516 15015373404 0021630 0 ustar 00root root 0000000 0000000 #!/usr/bin/env groovy
@Library('rocJenkins@pong') _
import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path
def runCI =
{
nodeDetails, jobName ->
def prj = new rocProject('hipFFT-internal', 'PreCheckin')
// customize for project
prj.libraryDependencies = ['rocRAND','rocFFT']
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
boolean formatCheck = true
boolean staticAnalysis = true
buildProject(prj, formatCheck, nodes.dockerArray, null, null, null, staticAnalysis)
}
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * 7')])]))
stage(urlJobName) {
runCI([ubuntu22:['any']], urlJobName)
}
}
hipFFT-rocm-6.4.3/.jenkins/staticlibrary.groovy 0000664 0000000 0000000 00000005736 15015373404 0021461 0 ustar 00root root 0000000 0000000 #!/usr/bin/env groovy
@Library('rocJenkins@pong') _
import com.amd.project.*
import com.amd.docker.*
import java.nio.file.Path
def runCI =
{
nodeDetails, jobName, buildCommand, label ->
def prj = new rocProject('hipFFT-internal', 'StaticLibrary')
// customize for project
prj.paths.build_command = buildCommand
prj.libraryDependencies = ['rocRAND','rocFFT']
// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(nodeDetails, jobName, prj)
def commonGroovy
boolean formatCheck = false
def compileCommand =
{
platform, project->
project.paths.construct_build_prefix()
commonGroovy = load "${project.paths.project_src_prefix}/.jenkins/common.groovy"
commonGroovy.runCompileCommand(platform, project, jobName, true)
}
def testCommand =
{
platform, project->
def gfilter = "*"
commonGroovy.runTestCommand(platform, project, gfilter)
}
def packageCommand =
{
platform, project->
commonGroovy.runPackageCommand(platform, project, jobName, label)
}
buildProject(prj, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)
}
def setupCI(urlJobName, jobNameList, buildCommand, runCI, label)
{
jobNameList = auxiliary.appendJobNameList(jobNameList)
jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(label + ' ' + jobName) {
runCI(nodeDetails, jobName, buildCommand, label)
}
}
// For url job names that are not listed by the jobNameList i.e. compute-rocm-dkms-no-npi-1901
if(!jobNameList.keySet().contains(urlJobName))
{
properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * *')])]))
stage(label + ' ' + urlJobName) {
runCI([ubuntu16:['gfx906']], urlJobName, buildCommand, label)
}
}
}
ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)
def propertyList = ["compute-rocm-dkms-no-npi":[pipelineTriggers([cron('0 1 * * 0')])]]
propertyList = auxiliary.appendPropertyList(propertyList)
propertyList.each
{
jobName, property->
if (urlJobName == jobName)
properties(auxiliary.addCommonProperties(property))
}
def hostJobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900']])]
def hipClangJobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx900']])]
String hostBuildCommand = '-DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -L ../..'
String hipClangBuildCommand = '-DCMAKE_CXX_COMPILER=/opt/rocm/bin/amdclang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_SAMPLES=ON -DBUILD_SHARED_LIBS=OFF -L ../..'
setupCI(urlJobName, hostJobNameList, hostBuildCommand, runCI, 'g++')
setupCI(urlJobName, hipClangJobNameList, hipClangBuildCommand, runCI, 'hip-clang')
}
hipFFT-rocm-6.4.3/.readthedocs.yaml 0000664 0000000 0000000 00000000502 15015373404 0017030 0 ustar 00root root 0000000 0000000 # Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
sphinx:
configuration: docs/conf.py
formats: [htmlzip, pdf, epub]
python:
install:
- requirements: docs/sphinx/requirements.txt
build:
os: ubuntu-22.04
tools:
python: "3.10"
hipFFT-rocm-6.4.3/CHANGELOG.md 0000664 0000000 0000000 00000013242 15015373404 0015417 0 ustar 00root root 0000000 0000000 # Changelog for hipFFT
Documentation for hipFFT is available at
[https://rocm.docs.amd.com/projects/hipFFT/en/latest/](https://rocm.docs.amd.com/projects/hipFFT/en/latest/).
## hipFFT 1.0.18 for ROCm 6.4.0
### Added
* Implemented the `hipfftMpAttachComm`, `hipfftXtSetDistribution`, and `hipfftXtSetSubformatDefault` APIs to allow
computing FFTs that are distributed between multiple MPI (Message Passing Interface) processes. These APIs can be enabled
with the `HIPFFT_MPI_ENABLE` CMake option, which defaults to `OFF`.
The backend FFT library called by hipFFT must support MPI for these APIs to work.
### Changed
* Building with the address sanitizer option sets xnack+ for the relevant GPU
architectures.
* Use find_package CUDAToolkit instead of CUDA in cmake for modern-cmake compatibility.
* The `AMDGPU_TARGETS` build variable should be replaced with `GPU_TARGETS`. `AMDGPU_TARGETS` is deprecated.
### Resolved issues
* Fixed client packages to depend on hipRAND instead of rocRAND.
## hipFFT 1.0.17 for ROCm 6.3.0
### Added
* Support for the gfx1151, gfx1200, and gfx1201 architectures
* hipfft-test now includes a --smoketest option.
### Changed
* The AMD backend is now compiled using amdclang++ instead of hipcc. The NVIDIA CUDA backend still uses hipcc-nvcc.
* CLI11 replaces Boost Program Options as the command line parser for clients.
## hipFFT 1.0.16 for ROCm 6.2.4
### Changed
* Support gfx1151 architecture.
## hipFFT 1.0.15 for ROCm 6.2.0
### Fixes
* Added hip::host as a public link library, as hipfft.h includes HIP runtime headers.
* Prevent C++ exceptions leaking from public API functions.
* Make output of hipfftXt match cufftXt in geometry and alignment for 2D and 3D FFTs.
## hipFFT 1.0.14 for ROCm 6.1.0
### Changes
* When building hipFFT from source, rocFFT code no longer needs to be initialized as a git submodule.
### Fixes
* Fixed error when creating length-1 plans.
## hipFFT 1.0.13 for ROCm 6.0.0
### Changes
* `hipfft-rider` has been renamed to `hipfft-bench`; it is controlled by the `BUILD_CLIENTS_BENCH`
CMake option (note that a link for the old file name is installed, and the old `BUILD_CLIENTS_RIDER`
CMake option is accepted for backwards compatibility, but both will be removed in a future release)
* Binaries in debug builds no longer have a `-d` suffix
* The minimum rocFFT required version has been updated to 1.0.21
### Additions
* `hipfftXtSetGPUs`, `hipfftXtMalloc, hipfftXtMemcpy`, `hipfftXtFree`, and `hipfftXtExecDescriptor` APIs
have been implemented to allow FFT computing on multiple devices in a single process
## hipFFT 1.0.12 for ROCm 5.6.0
### Additions
* `hipfftXtMakePlanMany`, `hipfftXtGetSizeMany`, and `hipfftXtExec` APIs have been implemented to
allow half-precision transform requests
### Changes
* Added the `--precision` argument to benchmark and test clients (`--double` is still accepted, but has
been deprecated as a method to request a double-precision transform)
## hipFFT 1.0.11 for ROCm 5.5.0
### Fixes
* Fixed old version ROCm include and lib folders that were not removed during upgrades
## hipFFT 1.0.10 for ROCm 5.4.0
### Additions
* Added the `hipfftExtPlanScaleFactor` API to efficiently multiply each output element of an FFT by a
given scaling factor (result scaling must be supported in the backend FFT library)
### Changes
* rocFFT 1.0.19 or higher is now required for hipFFT builds on the rocFFT backend
* Data are initialized directly on GPUs using hipRAND
* Updated build files now use standard C++17
## hipFFT 1.0.9 for ROCm 5.3.0
### Changes
* Cleaned up build warnings
* GNUInstallDirs enhancements
* GoogleTest 1.11 is required
## hipFFT 1.0.8 for ROCm 5.2.0
### Additions
* Added file and folder reorganization changes with backward compatibility support when using
rocm-cmake wrapper functions
* New packages for test and benchmark executables on all supported operating systems that use
CPack
* Implemented `hipfftMakePlanMany64` and `hipfftGetSizeMany64`
## hipFFT 1.0.7 for ROCm 5.1.0
### Changes
* Use `fft_params` struct for accuracy and benchmark clients
## hipFFT 1.0.6 for ROCm 5.0.0
### Fixes
* Incorrect reporting of rocFFT version
### Changes
* Unconditionally enabled callback functionality: On the CUDA backend, callbacks only run
correctly when hipFFT is built as a static library, and linked against the static cuFFT library
## hipFFT 1.0.5 for ROCm 4.5.0
### Additions
* Added support for Windows 10 as a build target
### Changes
* Packaging has been split into a runtime package (`hipfft`) and a development package
(`hipfft-devel`):
The development package depends on the runtime package. When installing the runtime package,
the package manager will suggest the installation of the development package to aid users
transitioning from the previous version's combined package. This suggestion by package manager is
for all supported operating systems (except CentOS 7) to aid in the transition. The `suggestion`
feature in the runtime package is introduced as a deprecated feature and will be removed in a future
ROCm release.
## hipFFT 1.0.4 for ROCm 4.4.0
### Fixes
* Add calls to rocFFT setup and cleanup
* CMake fixes for clients and backend support
### Additions
* Added support for Windows 10 as a build target
## hipFFT 1.0.3 for ROCm 4.3.0
### Fixes
* CMake updates
### Additions
* New callback API in `hipfftXt.h` header
## hipFFT 1.0.2 for ROCm 4.2.0
* No changes
## hipFFT 1.0.1 for ROCm 4.1.0
### Fixes
* Batch support for `hipfftMakePlanMany`
* Work area handling during plan creation and `hipfftSetWorkArea`
* Honour `autoAllocate` flag
### Changes
* Testing infrastructure reuses code from [rocFFT](https://github.com/ROCmSoftwarePlatform/rocFFT)
hipFFT-rocm-6.4.3/CMakeLists.txt 0000664 0000000 0000000 00000025212 15015373404 0016346 0 ustar 00root root 0000000 0000000 # #############################################################################
# Copyright (C) 2020 - 2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# ############################################################################
# CMake version according to latest ROCm platform requirements
cmake_minimum_required( VERSION 3.17 )
# We use C++17 features, this will add compile option: -std=c++17
set( CMAKE_CXX_STANDARD 17 )
set(CMAKE_CXX_EXTENSIONS OFF)
# Consider removing this in the future
# This should appear before the project command, because it does not use FORCE
if( WIN32 )
set( CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/package" CACHE PATH
"Install path prefix, prepended onto install directories" )
else()
set( CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH
"Install path prefix, prepended onto install directories" )
endif()
# Workarounds..
list( APPEND CMAKE_PREFIX_PATH /opt/rocm/llvm /opt/rocm )
list( APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/lib/cmake/hip /opt/rocm/lib/cmake/hip /opt/rocm/hip/cmake )
# This has to be initialized before the project() command appears
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D.
# MSVC_IDE does not use CMAKE_BUILD_TYPE
if( NOT DEFINED CMAKE_CONFIGURATION_TYPES AND NOT DEFINED CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." )
endif()
set( HIPFFT_BUILD_SCOPE ON )
project( hipfft LANGUAGES CXX )
# Build options
option( BUILD_SHARED_LIBS "Build ${PROJECT_NAME} as a shared library" ON )
option( BUILD_VERBOSE "Output additional build information" OFF )
option( HIPFFT_MPI_ENABLE "Build with MPI support for distributed transforms" OFF )
set( BUILD_WITH_COMPILER "HOST-default" CACHE INTERNAL
"Build ${PROJECT_NAME} with compiler HIP-clang, HIP-nvcc, or just the host default compiler, eg g++")
set( BUILD_WITH_LIB "ROCM" CACHE STRING "Build ${PROJECT_NAME} with ROCM or CUDA libraries" )
option( BUILD_CLIENTS "Build all clients" OFF)
option( BUILD_CLIENTS_BENCH "Build benchmark client" OFF )
option( BUILD_CLIENTS_TESTS "Build ${PROJECT_NAME} tests (requires 3rd dependencies)" OFF )
option( BUILD_CLIENTS_SAMPLES "Build examples" OFF )
option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)
# Provide ability to disable hipRAND dependency
option(USE_HIPRAND "Build using hipRAND for test input generation instead of host-side generation" ON)
if( USE_HIPRAND )
add_compile_definitions(USE_HIPRAND)
endif( )
option( WERROR "Treat warnings as errors" OFF )
set(DEFAULT_GPUS
gfx803
gfx900
gfx906
gfx908
gfx90a
gfx940
gfx941
gfx942
gfx1030
gfx1100
gfx1101
gfx1102
gfx1151
gfx1200
gfx1201)
if(BUILD_ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
add_link_options(-shared-libasan)
SET(DEFAULT_GPUS
gfx908:xnack+
gfx90a:xnack+
gfx940:xnack+
gfx941:xnack+
gfx942:xnack+)
add_link_options(-fuse-ld=lld)
add_compile_definitions(ADDRESS_SANITIZER)
endif()
# Set internal BUILD_WITH_COMPILER.
if(NOT (CMAKE_CXX_COMPILER MATCHES ".*hipcc$" OR CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+"))
set( BUILD_WITH_COMPILER "HOST-default" )
else()
if( $ENV{HIP_PLATFORM} MATCHES "nvidia" )
set( BUILD_WITH_COMPILER "HIP-nvcc" )
else()
set( BUILD_WITH_COMPILER "HIP-clang" )
if( NOT BUILD_WITH_LIB STREQUAL "ROCM" )
message( FATAL_ERROR "Detected HIP_COMPILER=clang, but BUILD_WITH_LIB is not ROCM!" )
endif()
endif()
endif()
string( TOUPPER "${BUILD_WITH_COMPILER}" BUILD_WITH_COMPILER )
string( TOUPPER "${BUILD_WITH_LIB}" BUILD_WITH_LIB )
# nvc++ doesn't understand warning flags
if( NOT CMAKE_CXX_COMPILER MATCHES ".*nvc\\+\\+" )
set( WARNING_FLAGS -Wall -Wno-unused-function -Wimplicit-fallthrough -Wunreachable-code -Wno-unknown-pragmas)
if( WERROR )
set( WARNING_FLAGS ${WARNING_FLAGS} -Werror )
endif()
endif()
# Dependencies
include(cmake/dependencies.cmake)
if (BUILD_WITH_COMPILER STREQUAL "HIP-NVCC" )
set (BUILD_WITH_LIB "CUDA")
set( HIP_PLATFORM "nvidia" )
set( CMAKE_CXX_EXTENSIONS OFF )
set( CMAKE_CXX_COMPILE_OPTIONS_PIC "-Xcompiler=${CMAKE_CXX_COMPILE_OPTIONS_PIC}" )
set( CMAKE_SHARED_LIBRARY_C_FLAGS "-Xlinker=${CMAKE_SHARED_LIBRARY_C_FLAGS}" )
set( CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Xlinker=${CMAKE_SHARED_LIBRARY_CXX_FLAGS}" )
set( CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Xlinker=-soname," )
set( CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Xlinker=-soname," )
set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Xlinker=-rpath," )
set( CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Xlinker=-rpath," )
set( CMAKE_EXECUTABLE_RUNTIME_C_FLAG "-Xlinker=-rpath," )
set( CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG "-Xlinker=-rpath," )
set( CMAKE_C_COMPILE_OPTIONS_VISIBILITY "-Xcompiler='${CMAKE_C_COMPILE_OPTIONS_VISIBILITY}'" )
set( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY "-Xcompiler='${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY}'" )
set( CMAKE_C_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN
"-Xcompiler='${CMAKE_C_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}'" )
set( CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN
"-Xcompiler='${CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}'" )
foreach( FLAG IN ITEMS ${WARNING_FLAGS} )
set( NVCC_WARNING_FLAGS ${NVCC_WARNING_FLAGS} "-Xcompiler=${FLAG}" )
endforeach()
set( WARNING_FLAGS ${NVCC_WARNING_FLAGS} )
else()
# Define GPU targets
if(AMDGPU_TARGETS AND NOT GPU_TARGETS)
message( DEPRECATION "AMDGPU_TARGETS use is deprecated. Use GPU_TARGETS." )
endif()
set(AMDGPU_TARGETS "${DEFAULT_GPUS}" CACHE STRING "Target default GPUs if AMDGPU_TARGETS is not defined. (Deprecated, prefer GPU_TARGETS)")
rocm_check_target_ids(AMDGPU_TARGETS TARGETS "${AMDGPU_TARGETS}")
# Don't force, users should be able to override GPU_TARGETS at the command line if desired
set(GPU_TARGETS "${AMDGPU_TARGETS}" CACHE STRING "GPU architectures to build for")
if( BUILD_WITH_COMPILER STREQUAL "HIP-CLANG" )
set( HIP_PLATFORM "amd" )
set( HIP_COMPILER "clang" )
endif()
endif()
# Show the actual compiler(internal option)
message(STATUS "BUILD_WITH_COMPILER = " ${BUILD_WITH_COMPILER})
# FOR HANDLING ENABLE/DISABLE OPTIONAL BACKWARD COMPATIBILITY for FILE/FOLDER REORG
option(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY "Build with file/folder reorg with backward compatibility enabled" OFF)
if(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY AND NOT WIN32)
rocm_wrap_header_dir(
${CMAKE_SOURCE_DIR}/library/include
PATTERNS "*.h"
GUARDS SYMLINK WRAPPER
WRAPPER_LOCATIONS ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
# Version
set( VERSION_STRING "1.0.18" )
set( hipfft_SOVERSION 0.1 )
if( ROCM_FOUND )
rocm_setup_version( VERSION ${VERSION_STRING} )
endif()
add_subdirectory( library )
# Build clients of the library
if( BUILD_CLIENTS )
set( BUILD_CLIENTS_BENCH ON )
set( BUILD_CLIENTS_SAMPLES ON )
set( BUILD_CLIENTS_TESTS ON )
endif()
# old name for BUILD_CLIENTS_BENCH
if( BUILD_CLIENTS_RIDER )
set( BUILD_CLIENTS_BENCH ${BUILD_CLIENTS_RIDER} )
endif()
# Build clients of the library
if( BUILD_CLIENTS_BENCH OR BUILD_CLIENTS_SAMPLES OR BUILD_CLIENTS_TESTS )
include( clients/cmake/build-options.cmake )
rocm_package_setup_component(clients)
if(NOT CLIENTS_OS)
rocm_set_os_id(CLIENTS_OS)
string(TOLOWER "${CLIENTS_OS}" CLIENTS_OS)
rocm_read_os_release(CLIENTS_OS_VERSION VERSION_ID)
endif()
message(STATUS "OS: ${CLIENTS_OS} ${CLIENTS_OS_VERSION}")
set(FFTW_DEB "libfftw3-bin")
if(CLIENTS_OS STREQUAL "sles")
set(FFTW_RPM "libfftw3-3")
elseif(CLIENTS_OS STREQUAL "mariner")
set(BOOST_RPM RPM "boost = ${Boost_VERSION_MAJOR}_${Boost_VERSION_MINOR}_${Boost_VERSION_PATCH}")
set(FFTW_RPM "fftw-libs")
else()
set(FFTW_RPM "fftw-libs")
endif()
if( USE_HIPRAND )
set( HIPRAND_DEP hiprand )
endif()
if(BUILD_CLIENTS_TESTS)
rocm_package_setup_client_component(
tests
DEPENDS
DEB ${FFTW_DEB} ${HIPRAND_DEP}
RPM ${FFTW_RPM} ${HIPRAND_DEP}
)
endif()
if(BUILD_CLIENTS_BENCH)
rocm_package_setup_client_component(
benchmarks
DEPENDS
DEB ${HIPRAND_DEP}
RPM ${HIPRAND_DEP}
)
endif()
add_subdirectory( clients )
endif()
# Packaging...
if(WIN32)
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_GENERATOR "ZIP")
set(CMAKE_INSTALL_PREFIX "C:/hipSDK" CACHE PATH "Install path" FORCE)
set(INSTALL_PREFIX "C:/hipSDK")
set(CPACK_SET_DESTDIR OFF)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "C:/hipSDK")
set(CPACK_PACKAGING_INSTALL_PREFIX "")
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
endif()
if( ROCM_FOUND )
# Package specific CPACK vars
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
rocm_package_add_dependencies(DEPENDS "rocfft >= 1.0.21")
else()
if( NVHPC_FOUND )
string( REPLACE "." "-" NVHPC_PKG_VERSION ${NVHPC_VERSION} )
rocm_package_add_dependencies(DEPENDS "nvhpc-${NVHPC_PKG_VERSION}")
else()
rocm_package_add_dependencies(DEPENDS "cufft >= 10.0.0")
endif()
endif()
set( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md" )
set( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "\${CPACK_PACKAGING_INSTALL_PREFIX}" )
# Give hipfft compiled for CUDA backend a different name
if( BUILD_WITH_LIB STREQUAL "ROCM" )
set( package_name hipfft )
else()
set( package_name hipfft-alt )
endif()
set( HIPFFT_CONFIG_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Path placed into ldconfig file" )
rocm_create_package(
NAME ${package_name}
DESCRIPTION "ROCm FFT marshalling library"
MAINTAINER "hipfft-maintainer@amd.com"
LDCONFIG
LDCONFIG_DIR ${HIPFFT_CONFIG_DIR}
)
endif()
hipFFT-rocm-6.4.3/CppCheckSuppressions.txt 0000664 0000000 0000000 00000000153 15015373404 0020462 0 ustar 00root root 0000000 0000000 // has some false positives and isn't hard to run manually for periodic
// dead code sweeps
unusedFunction
hipFFT-rocm-6.4.3/LICENSE.md 0000664 0000000 0000000 00000005413 15015373404 0015213 0 ustar 00root root 0000000 0000000 MIT License
Copyright (C) 2016 - 2025 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This product includes software from copyright holders as shown below, and distributed under their license terms as specified.
CLI11 2.2 Copyright (c) 2017-2024 University of Cincinnati, developed by Henry
Schreiner under NSF AWARD 1414736. All rights reserved.
Redistribution and use in source and binary forms of CLI11, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hipFFT-rocm-6.4.3/README.md 0000664 0000000 0000000 00000007157 15015373404 0015075 0 ustar 00root root 0000000 0000000 # hipFFT
hipFFT is an FFT marshalling library that supports
[rocFFT](https://github.com/ROCmSoftwarePlatform/rocFFT) and
[cuFFT](https://developer.nvidia.com/cufft) backends.
hipFFT exports an interface that doesn't require the client to change, regardless of the chosen backend.
It sits between your application and the backend FFT library, where it marshals inputs to the backend
and marshals results back to your application.
## Documentation
> [!NOTE]
> The published hipFFT documentation is available at [hipFFT](https://rocm.docs.amd.com/projects/hipFFT/en/latest/index.html) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the hipFFT/docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html).
To build our documentation locally, run the following code:
```bash
cd docs
pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```
## Build and install
You can download pre-built packages from the
[ROCm package servers](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html).
If you're using Ubuntu, you can run: `sudo apt update && sudo apt install hipfft`.
### Building from source
To build hipFFT from source, follow these steps:
1. Install the library build dependencies:
* On AMD platforms, you must install [rocFFT](https://github.com/ROCmSoftwarePlatform/rocFFT).
* On NVIDIA platforms, you must install [cuFFT](https://developer.nvidia.com/cufft).
2. Install the client build dependencies:
* The clients (samples, tests, etc) included with the hipFFT source depend on hipRAND, FFTW and GoogleTest.
3. Build hipFFT:
To show all build options:
```bash
mkdir build && cd build
cmake -LH ..
```
Here are some CMake build examples:
* AMD GPU
* Case: Build a project using HIP language APIs + hipFFT with standard host compiler
* Code: `cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -L ..`
* Case: Build a project using HIP language APIs + hipFFT + device kernels with HIP-Clang
* Code: `cmake -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_BUILD_TYPE=Release -DBUILD_CLIENTS=ON -L ..`
* NVIDIA GPU
* Case: Build a project using HIP language APIs + hipFFT with standard host compiler
* Code: `cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_LIB=CUDA -L ..`
* Case: Build a project using HIP language APIs + hipFFT + device kernels with HIP-NVCC
* Code: `HIP_PLATFORM=nvidia cmake -DCMAKE_CXX_COMPILER=hipcc -DCMAKE_BUILD_TYPE=Release -DBUILD_CLIENTS=ON -L ..`
```note
The `-DBUILD_CLIENTS=ON` option is only allowed with the amdclang++ or HIPCC compilers.
```
## Porting from CUDA
If you have existing CUDA code and want to transition to HIP, follow these steps:
1. [HIPIFY](https://github.com/ROCm-Developer-Tools/HIPIFY) your code and fix all unsupported CUDA
features and user-defined macros
2. Build with HIP-NVCC to run on an NVIDIA device
3. Build with HIP-Clang to run on an AMD device
More information about porting to HIP is available in the
[HIP porting guide](https://rocm.docs.amd.com/projects/HIP/en/develop/user_guide/hip_porting_guide.html).
## Support
You can report bugs and feature requests through the GitHub
[issue tracker](https://github.com/ROCm/hipFFT/issues).
## Contribute
If you want to contribute to hipFFT, you must follow our [contribution guidelines](https://github.com/ROCm/hipFFT/blob/develop/.github/CONTRIBUTING.md).
hipFFT-rocm-6.4.3/clients/ 0000775 0000000 0000000 00000000000 15015373404 0015245 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/clients/CMakeLists.txt 0000664 0000000 0000000 00000011006 15015373404 0020003 0 ustar 00root root 0000000 0000000 # #############################################################################
# Copyright (C) 2020 - 2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# #############################################################################
# CMake version according to latest ROCm platform requirements
cmake_minimum_required( VERSION 3.16 )
# We use C++17 features, this will add compile option: -std=c++17
set( CMAKE_CXX_STANDARD 17 )
set(CMAKE_CXX_EXTENSIONS OFF)
# Consider removing this in the future
# This should appear before the project command, because it does not use FORCE
if( WIN32 )
set( CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}/package"
CACHE
PATH
"Install path prefix, prepended onto install directories" )
else( )
set( CMAKE_INSTALL_PREFIX
"/opt/rocm"
CACHE
PATH
"Install path prefix, prepended onto install directories" )
endif( )
# This has to be initialized before the project() command appears
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does
# not use CMAKE_BUILD_TYPE
if( NOT DEFINED CMAKE_CONFIGURATION_TYPES AND NOT DEFINED CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." )
endif()
set( HIPFFT_CLIENTS_BUILD_SCOPE ON )
# This project may compile dependencies for clients
project( hipfft-clients LANGUAGES CXX )
list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
include( build-options )
if(NOT (CMAKE_CXX_COMPILER MATCHES ".*hipcc$" OR
CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+" OR
CMAKE_CXX_COMPILER MATCHES ".*nvcc" OR
CMAKE_CXX_COMPILER MATCHES ".*nvc\\+\\+"
)
)
if(BUILD_CLIENTS)
message( FATAL_ERROR "Using BUILD_CLIENTS=ON requires a compiler capable of building device code (hipcc, clang, nvcc, nvc++)." )
endif()
endif()
# This option only works for make/nmake and the ninja generators, but no reason it shouldn't be on
# all the time
# This tells cmake to create a compile_commands.json file that can be used with clang tooling or vim
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
# if hipfft is not a target, then we know clients are built separately from the library and we must
# search for the hipfft package
if( NOT TARGET hipfft )
find_package( hipfft REQUIRED CONFIG PATHS )
endif( )
if( BUILD_CLIENTS_SAMPLES )
add_subdirectory( samples )
endif( )
if( BUILD_CLIENTS_TESTS )
find_package( GTest 1.11.0 )
include( ExternalProject )
if( NOT GTEST_FOUND )
set( GTEST_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/src/gtest/googletest/include
)
set( GTEST_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/src/gtest-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
${CMAKE_CURRENT_BINARY_DIR}/src/gtest-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}
)
ExternalProject_Add( gtest
URL https://github.com/google/googletest/archive/release-1.11.0.tar.gz
URL_HASH SHA256=b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
CMAKE_ARGS -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} -DBUILD_SHARED_LIBS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND ""
BUILD_BYPRODUCTS ${GTEST_LIBRARIES}
)
ExternalProject_Get_Property( gtest source_dir binary_dir )
endif()
add_subdirectory( tests )
endif( )
if( BUILD_CLIENTS_BENCH )
add_subdirectory( bench )
endif( )
hipFFT-rocm-6.4.3/clients/bench/ 0000775 0000000 0000000 00000000000 15015373404 0016324 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/clients/bench/CMakeLists.txt 0000664 0000000 0000000 00000010714 15015373404 0021067 0 ustar 00root root 0000000 0000000 # #############################################################################
# Copyright (C) 2020 - 2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# #############################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
project( hipfft-clients-bench LANGUAGES CXX )
set( hipfft_bench_source bench.cpp ../../shared/array_validator.cpp )
set( hipfft_bench_includes bench.h ../../shared/array_validator.h )
add_executable( hipfft-bench ${hipfft_bench_source} ${hipfft_bench_includes} )
target_compile_options( hipfft-bench PRIVATE ${WARNING_FLAGS} )
set_target_properties( hipfft-bench PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON )
target_include_directories( hipfft-bench
PRIVATE
$
$
$
$
)
if((NOT CMAKE_CXX_COMPILER MATCHES ".*/hipcc$") OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if( NOT BUILD_WITH_LIB STREQUAL "CUDA" )
if( WIN32 )
find_package( HIP CONFIG REQUIRED )
else()
find_package( HIP MODULE REQUIRED )
endif()
target_link_libraries( hipfft-bench PRIVATE hip::host hip::device )
else()
target_compile_definitions( hipfft-bench PRIVATE __HIP_PLATFORM_NVIDIA__)
target_include_directories( hipfft-bench PRIVATE ${HIP_INCLUDE_DIRS})
endif()
endif()
if ( BUILD_WITH_LIB STREQUAL "CUDA" )
if( CMAKE_CXX_COMPILER MATCHES ".*nvc\\+\\+$" )
target_compile_options( hipfft-bench PRIVATE -cuda -Xptxas=-w)
target_link_options( hipfft-bench PRIVATE -cuda)
else()
target_compile_options( hipfft-bench PRIVATE -arch sm_53 -gencode=arch=compute_53,code=sm_53 -Xptxas=-w)
endif()
target_link_libraries( hipfft-bench PRIVATE ${CUDA_LIBRARIES} )
else()
if( USE_HIPRAND AND NOT hiprand_FOUND )
find_package( hiprand REQUIRED )
endif()
if( USE_HIPRAND )
target_link_libraries( hipfft-bench PRIVATE hip::hiprand )
endif()
endif()
target_link_libraries( hipfft-bench PRIVATE hip::hipfft )
set_target_properties( hipfft-bench PROPERTIES CXX_EXTENSIONS NO )
set_target_properties( hipfft-bench PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging" )
if( HIPFFT_BUILD_SCOPE )
set( BENCH_OUT_DIR "/../staging" )
elseif( HIPFFT_CLIENTS_BUILD_SCOPE )
set( BENCH_OUT_DIR "/../bin" )
else()
set( BENCH_OUT_DIR "/bin")
endif()
string( CONCAT BENCH_OUT_DIR "${PROJECT_BINARY_DIR}" ${BENCH_OUT_DIR} )
set_target_properties( hipfft-bench
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY
${BENCH_OUT_DIR} )
rocm_install(TARGETS hipfft-bench COMPONENT benchmarks)
# install compatibility for old name of bench program - symlink on
# unix, hardlink on windows (since privilege is required to create
# symlinks there)
if( WIN32 )
set( BENCH_LINK_COMMAND create_hardlink )
set( BENCH_NEW_NAME ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/hipfft-bench${CMAKE_EXECUTABLE_SUFFIX} )
set( BENCH_OLD_NAME ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/hipfft-rider${CMAKE_EXECUTABLE_SUFFIX} )
else()
set( BENCH_LINK_COMMAND create_symlink )
set( BENCH_NEW_NAME hipfft-bench )
set( BENCH_OLD_NAME ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/hipfft-rider )
endif()
install(
CODE "execute_process( COMMAND \"${CMAKE_COMMAND}\" -E ${BENCH_LINK_COMMAND} \"${BENCH_NEW_NAME}\" \"${BENCH_OLD_NAME}\" )"
)
hipFFT-rocm-6.4.3/clients/bench/bench.cpp 0000664 0000000 0000000 00000035652 15015373404 0020122 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include
#include
#include
#include
#include
#include
#include "bench.h"
#include "../../shared/CLI11.hpp"
#include "../../shared/client_except.h"
#include "../../shared/gpubuf.h"
int main(int argc, char* argv[])
{
// This helps with mixing output of both wide and narrow characters to the screen
std::ios::sync_with_stdio(false);
// Control output verbosity:
int verbose{};
// hip Device number for running tests:
int deviceId{};
// Number of performance trial samples
int ntrial{};
// FFT parameters:
hipfft_params params;
// Token string to fully specify fft params.
std::string token;
// Declare the supported options.
CLI::App app{"hipfft-bench command line options"};
// Declare the supported options. Some option pointers are declared to track passed opts.
app.add_flag("-v, --version", "Print queryable version information from the rocfft library")
// ->each([](const std::string&) {
// char v[256];
// rocfft_get_version_string(v, 256);
// std::cout << "version " << v << std::endl;
// std::exit(EXIT_SUCCESS);
// })
;
CLI::Option* opt_token
= app.add_option("--token", token, "Token to read FFT params from")->default_val("");
// Group together options that conflict with --token
auto* non_token = app.add_option_group("Token Conflict", "Options excluded by --token");
non_token
->add_flag("--double", "Double precision transform (deprecated: use --precision double)")
->each([&](const std::string&) { params.precision = fft_precision_double; });
non_token->excludes(opt_token);
non_token
->add_option("-t, --transformType",
params.transform_type,
"Type of transform:\n0) complex forward\n1) complex inverse\n2) real "
"forward\n3) real inverse")
->default_val(fft_transform_type_complex_forward);
non_token
->add_option(
"--precision", params.precision, "Transform precision: single (default), double, half")
->excludes("--double");
CLI::Option* opt_not_in_place
= non_token->add_flag("-o, --notInPlace", "Not in-place FFT transform (default: in-place)")
->each([&](const std::string&) { params.placement = fft_placement_notinplace; });
non_token
->add_option("--itype",
params.itype,
"Array type of input data:\n0) interleaved\n1) planar\n2) real\n3) "
"hermitian interleaved\n4) hermitian planar")
->default_val(fft_array_type_unset);
non_token
->add_option("--otype",
params.otype,
"Array type of output data:\n0) interleaved\n1) planar\n2) real\n3) "
"hermitian interleaved\n4) hermitian planar")
->default_val(fft_array_type_unset);
CLI::Option* opt_length
= non_token->add_option("--length", params.length, "Lengths")->required()->expected(1, 3);
non_token
->add_option("-b, --batchSize",
params.nbatch,
"If this value is greater than one, arrays will be used")
->default_val(1);
CLI::Option* opt_istride = non_token->add_option("--istride", params.istride, "Input strides");
CLI::Option* opt_ostride = non_token->add_option("--ostride", params.ostride, "Output strides");
non_token->add_option("--idist", params.idist, "Logical distance between input batches")
->default_val(0)
->each([&](const std::string& val) { std::cout << "idist: " << val << "\n"; });
non_token->add_option("--odist", params.odist, "Logical distance between output batches")
->default_val(0)
->each([&](const std::string& val) { std::cout << "odist: " << val << "\n"; });
CLI::Option* opt_ioffset = non_token->add_option("--ioffset", params.ioffset, "Input offset");
CLI::Option* opt_ooffset = non_token->add_option("--ooffset", params.ooffset, "Output offset");
app.add_option("--device", deviceId, "Select a specific device id")->default_val(0);
app.add_option("--verbose", verbose, "Control output verbosity")->default_val(0);
app.add_option("-N, --ntrial", ntrial, "Trial size for the problem")
->default_val(1)
->each([&](const std::string& val) {
std::cout << "Running profile with " << val << " samples\n";
});
// Default value is set in fft_params.h based on if device-side PRNG was enabled.
app.add_option("-g, --inputGen",
params.igen,
"Input data generation:\n0) PRNG sequence (device)\n"
"1) PRNG sequence (host)\n"
"2) linearly-spaced sequence (device)\n"
"3) linearly-spaced sequence (host)");
app.add_option("--isize", params.isize, "Logical size of input buffer");
app.add_option("--osize", params.osize, "Logical size of output buffer");
app.add_option("--scalefactor", params.scale_factor, "Scale factor to apply to output");
// Parse args and catch any errors here
try
{
app.parse(argc, argv);
}
catch(const CLI::ParseError& e)
{
return app.exit(e);
}
if(!token.empty())
{
std::cout << "Reading fft params from token:\n" << token << std::endl;
try
{
params.from_token(token);
}
catch(...)
{
std::cout << "Unable to parse token." << std::endl;
return EXIT_FAILURE;
}
}
else
{
if(*opt_not_in_place)
{
std::cout << "out-of-place\n";
}
else
{
std::cout << "in-place\n";
}
if(*opt_length)
{
std::cout << "length:";
for(auto& i : params.length)
std::cout << " " << i;
std::cout << "\n";
}
if(*opt_istride)
{
std::cout << "istride:";
for(auto& i : params.istride)
std::cout << " " << i;
std::cout << "\n";
}
if(*opt_ostride)
{
std::cout << "ostride:";
for(auto& i : params.ostride)
std::cout << " " << i;
std::cout << "\n";
}
if(*opt_ioffset)
{
std::cout << "ioffset:";
for(auto& i : params.ioffset)
std::cout << " " << i;
std::cout << "\n";
}
if(*opt_ooffset)
{
std::cout << "ooffset:";
for(auto& i : params.ooffset)
std::cout << " " << i;
std::cout << "\n";
}
}
std::cout << std::flush;
// Fixme: set the device id properly after the IDs are synced
// bewteen hip runtime and rocm-smi.
// HIP_V_THROW(hipSetDevice(deviceId), "set device failed!");
params.validate();
if(!params.valid(verbose))
{
throw std::runtime_error("Invalid parameters, add --verbose=1 for detail");
}
std::cout << "Token: " << params.token() << std::endl;
if(verbose)
{
std::cout << params.str() << std::endl;
std::cout << "Token: " << params.token() << std::endl;
}
// Check free and total available memory:
size_t free = 0;
size_t total = 0;
if(hipMemGetInfo(&free, &total) != hipSuccess)
throw std::runtime_error("hipMemGetInfo failed");
const auto raw_vram_footprint
= params.fft_params_vram_footprint() + twiddle_table_vram_footprint(params);
if(!vram_fits_problem(raw_vram_footprint, free))
{
std::cout << "SKIPPED: Problem size (" << raw_vram_footprint
<< ") raw data too large for device.\n";
return EXIT_SUCCESS;
}
size_t vram_footprint = 0;
try
{
vram_footprint = params.vram_footprint();
}
catch(ROCFFT_SKIP& e)
{
std::cout << "SKIPPED: " << e.msg << "\n";
return EXIT_SUCCESS;
}
if(!vram_fits_problem(vram_footprint, free))
{
std::cout << "SKIPPED: Problem size (" << vram_footprint
<< ") raw data too large for device.\n";
return EXIT_SUCCESS;
}
// Create plans:
auto ret = params.create_plan();
if(ret != fft_status_success)
throw std::runtime_error("Plan creation failed");
hipError_t hip_rt;
// GPU input buffer:
auto ibuffer_sizes = params.ibuffer_sizes();
std::vector ibuffer(ibuffer_sizes.size());
std::vector pibuffer(ibuffer_sizes.size());
for(unsigned int i = 0; i < ibuffer.size(); ++i)
{
hip_rt = ibuffer[i].alloc(ibuffer_sizes[i]);
if(hip_rt != hipSuccess)
throw std::runtime_error("Creating input Buffer failed");
pibuffer[i] = ibuffer[i].data();
}
// CPU-side input buffer
std::vector ibuffer_cpu;
auto is_host_gen = (params.igen == fft_input_generator_host
|| params.igen == fft_input_random_generator_host);
#ifdef USE_HIPRAND
if(!is_host_gen)
{
// Input data:
params.compute_input(ibuffer);
if(verbose > 1)
{
// Copy input to CPU
ibuffer_cpu = allocate_host_buffer(params.precision, params.itype, params.isize);
for(unsigned int idx = 0; idx < ibuffer.size(); ++idx)
{
HIP_V_THROW(hipMemcpy(ibuffer_cpu.at(idx).data(),
ibuffer[idx].data(),
ibuffer_sizes[idx],
hipMemcpyDeviceToHost),
"hipMemcpy failed");
}
std::cout << "GPU input:\n";
params.print_ibuffer(ibuffer_cpu);
}
}
#endif
if(is_host_gen)
{
// Input data:
ibuffer_cpu = allocate_host_buffer(params.precision, params.itype, params.isize);
params.compute_input(ibuffer_cpu);
if(verbose > 1)
{
std::cout << "GPU input:\n";
params.print_ibuffer(ibuffer_cpu);
}
for(unsigned int idx = 0; idx < ibuffer_cpu.size(); ++idx)
{
HIP_V_THROW(hipMemcpy(pibuffer[idx],
ibuffer_cpu[idx].data(),
ibuffer_cpu[idx].size(),
hipMemcpyHostToDevice),
"hipMemcpy failed");
}
}
// GPU output buffer:
std::vector obuffer_data;
std::vector* obuffer = &obuffer_data;
if(params.placement == fft_placement_inplace)
{
obuffer = &ibuffer;
}
else
{
auto obuffer_sizes = params.obuffer_sizes();
obuffer_data.resize(obuffer_sizes.size());
for(unsigned int i = 0; i < obuffer_data.size(); ++i)
{
hip_rt = obuffer_data[i].alloc(obuffer_sizes[i]);
if(hip_rt != hipSuccess)
throw std::runtime_error("Creating output Buffer failed");
}
}
std::vector pobuffer(obuffer->size());
for(unsigned int i = 0; i < obuffer->size(); ++i)
{
pobuffer[i] = obuffer->at(i).data();
}
auto res = params.execute(pibuffer.data(), pobuffer.data());
if(res != fft_status_success)
throw std::runtime_error("Execution failed");
// Run the transform several times and record the execution time:
std::vector gpu_time(ntrial);
hipEvent_t start, stop;
hip_rt = hipEventCreate(&start);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventCreate failed");
hip_rt = hipEventCreate(&stop);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventCreate failed");
for(size_t itrial = 0; itrial < gpu_time.size(); ++itrial)
{
#ifdef USE_HIPRAND
// Compute input on default device
if(!is_host_gen)
params.compute_input(ibuffer);
#endif
if(is_host_gen)
{
for(unsigned int idx = 0; idx < ibuffer_cpu.size(); ++idx)
{
HIP_V_THROW(hipMemcpy(pibuffer[idx],
ibuffer_cpu[idx].data(),
ibuffer_cpu[idx].size(),
hipMemcpyHostToDevice),
"hipMemcpy failed");
}
}
hip_rt = hipEventRecord(start);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventRecord failed");
res = params.execute(pibuffer.data(), pobuffer.data());
hip_rt = hipEventRecord(stop);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventRecord failed");
hip_rt = hipEventSynchronize(stop);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventSynchronize failed");
if(res != fft_status_success)
throw std::runtime_error("Execution failed");
float time;
hip_rt = hipEventElapsedTime(&time, start, stop);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipEventElapsedTime failed");
gpu_time[itrial] = time;
if(verbose > 2)
{
auto output = allocate_host_buffer(params.precision, params.otype, params.osize);
for(unsigned int idx = 0; idx < output.size(); ++idx)
{
hip_rt = hipMemcpy(
output[idx].data(), pobuffer[idx], output[idx].size(), hipMemcpyDeviceToHost);
if(hip_rt != hipSuccess)
throw std::runtime_error("hipMemcpy failed");
}
std::cout << "GPU output:\n";
params.print_obuffer(output);
}
}
std::cout << "\nExecution gpu time:";
for(const auto& i : gpu_time)
{
std::cout << " " << i;
}
std::cout << " ms" << std::endl;
}
hipFFT-rocm-6.4.3/clients/bench/bench.h 0000664 0000000 0000000 00000005415 15015373404 0017561 0 ustar 00root root 0000000 0000000 // Copyright (C) 2016 - 2022 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef HIPFFT_BENCH_H
#define HIPFFT_BENCH_H
#include "../hipfft_params.h"
#include "hipfft/hipfft.h"
#include
// This is used to either wrap a HIP function call, or to explicitly check a variable
// for an error condition. If an error occurs, we throw.
// Note: std::runtime_error does not take unicode strings as input, so only strings
// supported
inline void
hip_V_Throw(hipError_t res, const std::string& msg, size_t lineno, const std::string& fileName)
{
if(res != hipSuccess)
{
std::stringstream tmp;
tmp << "HIP_V_THROWERROR< ";
tmp << res;
tmp << " > (";
tmp << fileName;
tmp << " Line: ";
tmp << lineno;
tmp << "): ";
tmp << msg;
std::string errorm(tmp.str());
std::cout << errorm << std::endl;
throw std::runtime_error(errorm);
}
}
inline void lib_V_Throw(hipfftResult res,
const std::string& msg,
size_t lineno,
const std::string& fileName)
{
if(res != HIPFFT_SUCCESS)
{
std::stringstream tmp;
tmp << "LIB_V_THROWERROR< ";
tmp << res;
tmp << " > (";
tmp << fileName;
tmp << " Line: ";
tmp << lineno;
tmp << "): ";
tmp << msg;
std::string errorm(tmp.str());
std::cout << errorm << std::endl;
throw std::runtime_error(errorm);
}
}
#define HIP_V_THROW(_status, _message) hip_V_Throw(_status, _message, __LINE__, __FILE__)
#define LIB_V_THROW(_status, _message) lib_V_Throw(_status, _message, __LINE__, __FILE__)
#endif // HIPFFT_BENCH_H
hipFFT-rocm-6.4.3/clients/cmake/ 0000775 0000000 0000000 00000000000 15015373404 0016325 5 ustar 00root root 0000000 0000000 hipFFT-rocm-6.4.3/clients/cmake/FindFFTW.cmake 0000664 0000000 0000000 00000010545 15015373404 0020703 0 ustar 00root root 0000000 0000000 # #############################################################################
# Copyright (C) 2016 - 2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# #############################################################################
#if( FFTW_FIND_VERSION VERSION_LESS "3" )
# message( FFTW_FIND_VERION is ${FFTW_FIND_VERSION})
# message( FATAL_ERROR "FindFFTW can not configure versions less than FFTW 3.0.0" )
#endif( )
find_path(FFTW_INCLUDE_DIRS
NAMES fftw3.h
HINTS
${FFTW_ROOT}/include
$ENV{FFTW_ROOT}/include
PATHS
/usr/include
/usr/local/include
)
mark_as_advanced( FFTW_INCLUDE_DIRS )
# message( STATUS "FFTW_FIND_COMPONENTS: ${FFTW_FIND_COMPONENTS}" )
# message( STATUS "FFTW_FIND_REQUIRED_FLOAT: ${FFTW_FIND_REQUIRED_FLOAT}" )
# message( STATUS "FFTW_FIND_REQUIRED_DOUBLE: ${FFTW_FIND_REQUIRED_DOUBLE}" )
set( FFTW_LIBRARIES "" )
if( FFTW_FIND_REQUIRED_FLOAT OR FFTW_FIND_REQUIRED_SINGLE )
find_library( FFTW_LIBRARIES_SINGLE
NAMES fftw3f fftw3f-3 fftw3 fftw3-3
HINTS
${FFTW_ROOT}/lib
$ENV{FFTW_ROOT}/lib
PATHS
/usr/lib
/usr/local/lib
PATH_SUFFIXES
x86_64-linux-gnu
DOC "FFTW dynamic library single"
)
mark_as_advanced( FFTW_LIBRARIES_SINGLE )
list( APPEND FFTW_LIBRARIES ${FFTW_LIBRARIES_SINGLE} )
# Look for omp (preferred) or thread libraries. These are not a
# hard requirement, but are nice to have to make FFTW run faster.
find_library( FFTWF_OMP_LIBRARY fftw3f_omp )
find_library( FFTWF_THREADS_LIBRARY fftw3f_threads )
if( FFTWF_OMP_LIBRARY )
list( APPEND FFTW_LIBRARIES ${FFTWF_OMP_LIBRARY} )
set( FFTW_MULTITHREAD TRUE )
elseif( FFTWF_THREADS_LIBRARY )
list( APPEND FFTW_LIBRARIES ${FFTWF_THREADS_LIBRARY} )
set( FFTW_MULTITHREAD TRUE )
endif()
endif( )
if( FFTW_FIND_REQUIRED_DOUBLE )
find_library( FFTW_LIBRARIES_DOUBLE
NAMES fftw3
HINTS
${FFTW_ROOT}/lib
$ENV{FFTW_ROOT}/lib
PATHS
/usr/lib
/usr/local/lib
PATH_SUFFIXES
x86_64-linux-gnu
DOC "FFTW dynamic library double"
)
mark_as_advanced( FFTW_LIBRARIES_DOUBLE )
list( APPEND FFTW_LIBRARIES ${FFTW_LIBRARIES_DOUBLE} )
# Look for omp (preferred) or thread libraries. These are not a
# hard requirement, but are nice to have to make FFTW run faster.
find_library( FFTW_OMP_LIBRARY fftw3_omp )
find_library( FFTW_THREADS_LIBRARY fftw3_threads )
if( FFTW_OMP_LIBRARY )
list( APPEND FFTW_LIBRARIES ${FFTW_OMP_LIBRARY} )
set( FFTW_MULTITHREAD TRUE )
elseif( FFTW_THREADS_LIBRARY )
list( APPEND FFTW_LIBRARIES ${FFTW_THREADS_LIBRARY} )
set( FFTW_MULTITHREAD TRUE )
endif()
endif( )
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( FFTW
REQUIRED_VARS FFTW_INCLUDE_DIRS FFTW_LIBRARIES )
# assume the threads feature is always enabled on Windows, since it's
# not a separate library there
if( FFTW_FOUND AND WIN32 )
set( FFTW_MULTITHREAD TRUE )
endif()
if( NOT FFTW_FOUND )
message( STATUS "FindFFTW could not find all of the following fftw libraries" )
message( STATUS "${FFTW_FIND_COMPONENTS}" )
else( )
message(STATUS "FindFFTW configured variables:" )
message(STATUS "FFTW_INCLUDE_DIRS: ${FFTW_INCLUDE_DIRS}" )
message(STATUS "FFTW_LIBRARIES: ${FFTW_LIBRARIES}" )
endif()
hipFFT-rocm-6.4.3/clients/cmake/build-options.cmake 0000664 0000000 0000000 00000003675 15015373404 0022132 0 ustar 00root root 0000000 0000000 # #############################################################################
# Copyright (C) 2016 - 2022 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
# #############################################################################
# This file is intended to be used in two ways; independently in a stand alone PROJECT
# and as part of a superbuild. If the file is included in a stand alone project, the
# variables are not expected to be preset, and this will produce options() in the GUI
# for the user to examine. If this file is included in a superbuild, the options will be
# presented in the superbuild GUI, but then passed into the ExternalProject as -D
# parameters, which would already define them.
if( NOT BUILD_CLIENTS_TESTS )
option( BUILD_CLIENTS_TESTS "Build hipFFT unit tests" OFF )
endif( )
if( NOT BUILD_CLIENTS_SAMPLES )
option( BUILD_CLIENTS_SAMPLES "Build hipFFT samples" OFF )
endif( )
hipFFT-rocm-6.4.3/clients/hipfft_params.h 0000664 0000000 0000000 00000130605 15015373404 0020246 0 ustar 00root root 0000000 0000000 // Copyright (C) 2021 - 2023 Advanced Micro Devices, Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef HIPFFT_PARAMS_H
#define HIPFFT_PARAMS_H
#include
#include