diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile index 1eed983b4e..54d9433136 100644 --- a/.jenkins/Jenkinsfile +++ b/.jenkins/Jenkinsfile @@ -28,7 +28,43 @@ def hipBuildTest(String backendLabel) { } } } - stage("build") { + stage("Build - HIT framework") { + // Running the build on hipamd workspace + dir("${WORKSPACE}/hipamd") { + sh """#!/usr/bin/env bash + set -x + rm -rf build + mkdir build + cd build + # Check if backend label contains string "amd" or backend host is a server with amd gpu + if [[ $backendLabel =~ amd ]]; then + cmake -DHIP_CATCH_TEST=0 -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install .. + else + cmake -DHIP_CATCH_TEST=0 -DHIP_PLATFORM=nvidia -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. + fi + make install -j\$(nproc) + if [[ $backendLabel =~ amd ]]; then + make build_tests -j\$(nproc) + else + HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc) + fi + """ + } + } + stage('HIP Unit Tests - HIT framework') { + dir("${WORKSPACE}/hipamd/build") { + sh """#!/usr/bin/env bash + set -x + # Check if backend label contains string "amd" or backend host is a server with amd gpu + if [[ $backendLabel =~ amd ]]; then + LLVM_PATH=/opt/rocm/llvm make test + else + make test + fi + """ + } + } + stage("Build - Catch2 framework") { // Running the build on hipamd workspace dir("${WORKSPACE}/hipamd") { sh """#!/usr/bin/env bash @@ -37,16 +73,25 @@ def hipBuildTest(String backendLabel) { cd build # Check if backend label contains string "amd" or backend host is a server with amd gpu if [[ $backendLabel =~ amd ]]; then - cmake -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install .. + cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=\$OPENCL_DIR -DROCCLR_PATH=\$ROCclr_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=\$PWD/install .. else - cmake -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. + export HIP_PLATFORM=nvidia + export HIP_COMPILER=nvcc + export HIP_RUNTIME=cuda + cmake -DHIP_CATCH_TEST=1 -DHIP_PATH=\$PWD/install -DHIP_COMMON_DIR=$HIP_DIR -DCMAKE_INSTALL_PREFIX=\$PWD/install .. fi + make install -j\$(nproc) - make build_tests -j\$(nproc) + + if [[ $backendLabel =~ amd ]]; then + make build_tests -j\$(nproc) + else + HIP_COMPILER=nvcc HIP_PLATFORM=nvidia make build_tests -j\$(nproc) + fi """ } } - stage('HIP Unit Tests') { + stage('HIP Unit Tests - Catch2 framework') { dir("${WORKSPACE}/hipamd/build") { sh """#!/usr/bin/env bash set -x diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0815a418d..e5fd36e9d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,8 @@ # Contributor Guidelines ## Make Tips -When building HIP, you will likely want to build and install to a local user-accessible directory (rather than /opt/rocm). +ROCM_PATH is path where ROCM is installed. BY default ROCM_PATH is /opt/rocm. +When building HIP, you will likely want to build and install to a local user-accessible directory (rather than ). This can be easily be done by setting the -DCMAKE_INSTALL_PREFIX variable when running cmake. Typical use case is to set CMAKE_INSTALL_PREFIX to your HIP git root, and then ensure HIP_PATH points to this directory. For example @@ -31,7 +32,7 @@ In some cases new HIP-Clang features are tied to specified releases, and it can HIP runtime version ``` -> cat /opt/rocm/hip/bin/.hipVersion +> cat /hip/bin/.hipVersion # Auto-generated by cmake HIP_VERSION_MAJOR=3 HIP_VERSION_MINOR=9 @@ -41,11 +42,11 @@ HIP_VERSION_PATCH=20345-519ef3f2 HIP-Clang compiler version ``` -$ /opt/rocm/llvm/bin/clang -v +$ /llvm/bin/clang -v clang version 11.0.0 (/src/external/llvm-project/clang 075fedd3fd2f4d9d8cca79d0cd51f64c5ef21432) Target: x86_64-unknown-linux-gnu Thread model: posix -InstalledDir: /opt/rocm/llvm/bin +InstalledDir: /llvm/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 @@ -73,8 +74,8 @@ For applications and benchmarks outside the directed test environment, developme ## Environment Variables - **HIP_PATH** : Location of HIP include, src, bin, lib directories. -- **HCC_ROCCLR_HOME** : Path to HIP/ROCclr directory, used on AMD platforms. Default /opt/rocm/rocclr. -- **HSA_PATH** : Path to HSA include, lib. Default /opt/rocm/hsa. +- **HCC_ROCCLR_HOME** : Path to HIP/ROCclr directory, used on AMD platforms. Default /rocclr. +- **HSA_PATH** : Path to HSA include, lib. Default /hsa. - **CUDA_PATH* : On nvcc system, this points to root of CUDA installation. ## Contribution guidelines ## diff --git a/INSTALL.md b/INSTALL.md index c939c34c50..3f9305387e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -21,7 +21,7 @@ HIP can be easily installed using pre-built binary packages using the package ma HIP code can be developed either on AMD ROCm platform using HIP-Clang compiler, or a CUDA platform with nvcc installed. ## AMD Platform - +ROCM_PATH is path where ROCM is installed. BY default ROCM_PATH is /opt/rocm. ``` sudo apt install mesa-common-dev sudo apt install clang @@ -38,17 +38,17 @@ HIP-Clang can be built manually: git clone -b amd-stg-open https://github.com/RadeonOpenCompute/llvm-project.git cd llvm-project mkdir -p build && cd build -cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" ../llvm +cmake -DCMAKE_INSTALL_PREFIX=/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" ../llvm make -j sudo make install ``` Rocm device library can be manually built as following, ``` -export PATH=/opt/rocm/llvm/bin:$PATH +export PATH=/llvm/bin:$PATH git clone -b amd-stg-open https://github.com/RadeonOpenCompute/ROCm-Device-Libs.git cd ROCm-Device-Libs mkdir -p build && cd build -CC=clang CXX=clang++ cmake -DLLVM_DIR=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WERROR=1 -DLLVM_ENABLE_ASSERTIONS=1 -DCMAKE_INSTALL_PREFIX=/opt/rocm .. +CC=clang CXX=clang++ cmake -DLLVM_DIR=/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WERROR=1 -DLLVM_ENABLE_ASSERTIONS=1 -DCMAKE_INSTALL_PREFIX= .. make -j sudo make install ``` @@ -64,8 +64,8 @@ apt-get install hip-runtime-nvidia hip-devel ``` * Default paths and environment variables: * By default HIP looks for CUDA SDK in /usr/local/cuda (can be overriden by setting CUDA_PATH env variable). - * By default HIP is installed into /opt/rocm/hip (can be overridden by setting HIP_PATH environment variable). - * Optionally, consider adding /opt/rocm/bin to your path to make it easier to use the tools. + * By default HIP is installed into /hip (can be overridden by setting HIP_PATH environment variable). + * Optionally, consider adding /bin to your path to make it easier to use the tools. # Building HIP from source @@ -98,21 +98,21 @@ See https://github.com/ROCm-Developer-Tools/hipamd ``` cd "$HIPAMD_DIR" mkdir -p build; cd build -cmake -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=$OPENCL_DIR -DROCCLR_PATH=$ROCCLR_DIR -DCMAKE_PREFIX_PATH="/opt/rocm/" -DCMAKE_INSTALL_PREFIX=$PWD/install .. +cmake -DHIP_COMMON_DIR=$HIP_DIR -DAMD_OPENCL_PATH=$OPENCL_DIR -DROCCLR_PATH=$ROCCLR_DIR -DCMAKE_PREFIX_PATH="/" -DCMAKE_INSTALL_PREFIX=$PWD/install .. make -j$(nproc) sudo make install ``` -Note: If you don't specify CMAKE_INSTALL_PREFIX, hip runtime will be installed to "/opt/rocm/hip". +Note: If you don't specify CMAKE_INSTALL_PREFIX, hip runtime will be installed to "/hip". By default, release version of AMDHIP is built. ## Default paths and environment variables - * By default HIP looks for HSA in /opt/rocm/hsa (can be overridden by setting HSA_PATH environment variable). - * By default HIP is installed into /opt/rocm/hip (can be overridden by setting HIP_PATH environment variable). - * By default HIP looks for clang in /opt/rocm/llvm/bin (can be overridden by setting HIP_CLANG_PATH environment variable) - * By default HIP looks for device library in /opt/rocm/lib (can be overridden by setting DEVICE_LIB_PATH environment variable). - * Optionally, consider adding /opt/rocm/bin to your PATH to make it easier to use the tools. + * By default HIP looks for HSA in /hsa (can be overridden by setting HSA_PATH environment variable). + * By default HIP is installed into /hip (can be overridden by setting HIP_PATH environment variable). + * By default HIP looks for clang in /llvm/bin (can be overridden by setting HIP_CLANG_PATH environment variable) + * By default HIP looks for device library in /lib (can be overridden by setting DEVICE_LIB_PATH environment variable). + * Optionally, consider adding /bin to your PATH to make it easier to use the tools. * Optionally, set HIPCC_VERBOSE=7 to output the command line for compilation. After installation, make sure HIP_PATH is pointed to /where/to/install/hip @@ -121,7 +121,7 @@ After installation, make sure HIP_PATH is pointed to /where/to/install/hip Run hipconfig (instructions below assume default installation path) : ```shell -/opt/rocm/bin/hipconfig --full +/bin/hipconfig --full ``` Compile and run the [square sample](https://github.com/ROCm-Developer-Tools/HIP/tree/main/samples/0_Intro/square). diff --git a/README.md b/README.md index d4e16e70c7..f721347b33 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ New projects can be developed directly in the portable HIP C++ language and can ## DISCLAIMER -The information contained herein is for informational purposes only, and is subject to change without notice. In addition, any stated support is planned and is also subject to change. While every precaution has been taken in the preparation of this document, it may contain technical inaccuracies, omissions and typographical errors, and AMD is under no obligation to update or otherwise correct this information. Advanced Micro Devices, Inc. makes no representations or warranties with respect to the accuracy or completeness of the contents of this document, and assumes no liability of any kind, including the implied warranties of noninfringement, merchantability or fitness for particular purposes, with respect to the operation or use of AMD hardware, software or other products described herein. No license, including implied or arising by estoppel, to any intellectual property rights is granted by this document. Terms and limitations applicable to the purchase or use of AMD’s products are as set forth in a signed agreement between the parties or in AMD's Standard Terms and Conditions of Sale. +The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions, and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard versionchanges, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities that cannot be completely prevented or mitigated.AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes.THIS INFORMATION IS PROVIDED ‘AS IS.” AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. AMD, the AMD Arrow logo, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies. -© 2020 Advanced Micro Devices, Inc. All Rights Reserved. +© 2021 Advanced Micro Devices, Inc. All Rights Reserved. ## Repository branches: @@ -44,6 +44,7 @@ HIP releases are typically naming convention for each ROCM release to help diffe - [HIP Logging ](docs/markdown/hip_logging.md) - [HIP Debugging ](docs/markdown/hip_debugging.md) - [Code Object tooling ](docs/markdown/obj_tooling.md) +- [HIP RTC](docs/markdown/hip_rtc.md) - [HIP Terminology](docs/markdown/hip_terms2.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/OpenCL) - [HIPIFY](https://github.com/ROCm-Developer-Tools/HIPIFY/blob/master/README.md) - Supported CUDA APIs: @@ -145,11 +146,8 @@ The README with the procedures and tips the team used during this porting effort * **amd_detail/**** , **nvidia_detail/**** : Implementation details for specific platforms. HIP applications should not include these files directly. * **bin**: Tools and scripts to help with hip porting - * **hipify-perl** : Script based tool to convert CUDA code to portable CPP. Converts CUDA APIs and kernel builtins. * **hipcc** : Compiler driver that can be used to replace nvcc in existing CUDA code. hipcc will call nvcc or HIP-Clang depending on platform and include appropriate platform-specific headers and libraries. * **hipconfig** : Print HIP configuration (HIP_PATH, HIP_PLATFORM, HIP_COMPILER, HIP_RUNTIME, CXX config flags, etc.) - * **hipexamine-perl.sh** : Script to scan the directory, find all code, and report statistics on how much can be ported with HIP (and identify likely features not yet supported). - * **hipconvertinplace-perl.sh** : Script to scan the directory, find all code, and convert the found CUDA code to HIP reporting all unconverted things. * **doc**: Documentation - markdown and doxygen info. diff --git a/bin/findcode.sh b/bin/findcode.sh deleted file mode 100755 index 19d4ae05c9..0000000000 --- a/bin/findcode.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright (c) 2016 - 2021 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. - -SEARCH_DIRS=$@ - -find $SEARCH_DIRS -name '*.cu' -find $SEARCH_DIRS -name '*.cpp' -o -name '*.cxx' -o -name '*.c' -o -name '*.cc' -find $SEARCH_DIRS -name '*.cuh' -find $SEARCH_DIRS -name '*.h' -o -name '*.hpp' -o -name '*.inc' -o -name '*.inl' -o -name '*.hxx' -o -name '*.hdl' diff --git a/bin/finduncodep.sh b/bin/finduncodep.sh deleted file mode 100755 index 98c84dce01..0000000000 --- a/bin/finduncodep.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# Copyright (c) 2016 - 2021 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. - -SEARCH_DIR=$1 - -find $SEARCH_DIR -not -name '*.cu' -and -not -name '*.cpp' -and -not -name '*.cxx' -and -not -name '*.c' -and -not -name '*.cc' -and -not -name '*.cuh' -and -not -name '*.h' -and -not -name '*.hpp' -and -not -name '*.inc' -and -not -name '*.inl' -and -not -name '*.hxx' -and -not -name '*.hdl' diff --git a/bin/hipcc b/bin/hipcc index 840aaafd41..cd3481db80 100755 --- a/bin/hipcc +++ b/bin/hipcc @@ -58,11 +58,6 @@ $verbose = $ENV{'HIPCC_VERBOSE'} // 0; $HIPCC_COMPILE_FLAGS_APPEND=$ENV{'HIPCC_COMPILE_FLAGS_APPEND'}; $HIPCC_LINK_FLAGS_APPEND=$ENV{'HIPCC_LINK_FLAGS_APPEND'}; -# Known HIP target names. -@knownTargets = ('gfx700', 'gfx701', 'gfx702', 'gfx703', 'gfx704', 'gfx705', - 'gfx801', 'gfx802', 'gfx803', 'gfx805', 'gfx810', - 'gfx900', 'gfx902', 'gfx904', 'gfx906', 'gfx908', 'gfx909', 'gfx90a', - 'gfx1010', 'gfx1011', 'gfx1012', 'gfx1030', 'gfx1031', 'gfx1032'); # Known Features @knownFeatures = ('sramecc-', 'sramecc+', 'xnack-', 'xnack+'); @@ -146,11 +141,15 @@ $setStdLib = 0; # TODO - set to 0 $default_amdgpu_target = 1; if ($HIP_PLATFORM eq "amd") { - $HIPCC="\"$HIP_CLANG_PATH/clang++\""; + $execExtension = ""; + if($isWindows) { + $execExtension = ".exe"; + } + $HIPCC="$HIP_CLANG_PATH/clang++" . $execExtension; # If $HIPCC clang++ is not compiled, use clang instead if ( ! -e $HIPCC ) { - $HIPCC="\"$HIP_CLANG_PATH/clang\""; + $HIPCC="$HIP_CLANG_PATH/clang" . $execExtension; $HIPLDFLAGS = "--driver-mode=g++"; } @@ -158,6 +157,9 @@ if ($HIP_PLATFORM eq "amd") { $HIP_CLANG_VERSION=~/.*clang version (\S+).*/; $HIP_CLANG_VERSION=$1; + # Figure out the target with which llvm is configured + $HIP_CLANG_TARGET = `$HIPCC -print-target-triple`; + if (! defined $HIP_CLANG_INCLUDE_PATH) { $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include"); } @@ -177,6 +179,7 @@ if ($HIP_PLATFORM eq "amd") { print ("HIP_INCLUDE_PATH=$HIP_INCLUDE_PATH\n"); print ("HIP_LIB_PATH=$HIP_LIB_PATH\n"); print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n"); + print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n"); } if ($isWindows) { @@ -633,11 +636,6 @@ if($HIP_PLATFORM eq "amd"){ if ($HIP_PLATFORM eq 'amd' and $hasHIP) { $HIPCXXFLAGS .= $GPU_ARCH_ARG; } - - # If the specified target is not in the list of known target names, emit a warning. - if (grep($procName, @knownTargets) eq 0) { - print "Warning: The specified HIP target: $val is unknown. Correct compilation is not guaranteed.\n"; - } } } if ($hsacoVersion > 0) { @@ -711,7 +709,12 @@ if ($HIP_PLATFORM eq "amd") { $toolArgs = " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 " . ${toolArgs}; } # To support __fp16 and _Float16, explicitly link with compiler-rt - $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 " + $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a"; + if (-e $HIP_CLANG_BUILTIN_LIB) { + $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins " + } else { + $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 " + } } } diff --git a/bin/hipconfig b/bin/hipconfig index e1b4ab5382..5ddb8e9b7d 100755 --- a/bin/hipconfig +++ b/bin/hipconfig @@ -201,7 +201,7 @@ if (!$printed or $p_full) { print "=== Environment Variables\n"; if ($isWindows) { print ("PATH=$ENV{PATH}\n"); - system("set | findstr /B /C:\"HIP\" /C:\"HSA\" /C:\"CUDA\" /C:\"LD_LIBRARY_PATH\""); + system("set | findstr //B //C:\"HIP\" //C:\"HSA\" //C:\"CUDA\" //C:\"LD_LIBRARY_PATH\""); } else { system("echo PATH=\$PATH"); system("env | egrep '^HIP|^HSA|^CUDA|^LD_LIBRARY_PATH'"); @@ -212,7 +212,7 @@ if (!$printed or $p_full) { if ($isWindows) { print "== Windows Display Drivers\n"; print "Hostname : "; system ("hostname"); - system ("wmic path win32_VideoController get AdapterCompatibility,InstalledDisplayDrivers,Name | findstr /B /C:\"Advanced Micro Devices\""); + system ("wmic path win32_VideoController get AdapterCompatibility,InstalledDisplayDrivers,Name | findstr //B //C:\"Advanced Micro Devices\""); } else { print "== Linux Kernel\n"; print "Hostname : "; system ("hostname"); diff --git a/bin/hipconvertinplace-perl.sh b/bin/hipconvertinplace-perl.sh deleted file mode 100755 index d1b1b4fdd4..0000000000 --- a/bin/hipconvertinplace-perl.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright (c) 2017 - 2021 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. - -#usage : hipconvertinplace-perl.sh DIRNAME [hipify-perl options] - -#hipify "inplace" all code files in specified directory. -# This can be quite handy when dealing with an existing CUDA code base since the script -# preserves the existing directory structure. - -# For each code file, this script will: -# - If ".prehip file does not exist, copy the original code to a new file with extension ".prehip". Then hipify the code file. -# - If ".prehip" file exists, this is used as input to hipify. -# (this is useful for testing improvements to the hipify-perl toolset). - - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 -shift -$SCRIPT_DIR/hipify-perl -inplace -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` diff --git a/bin/hipconvertinplace.sh b/bin/hipconvertinplace.sh deleted file mode 100755 index c8588b5ea5..0000000000 --- a/bin/hipconvertinplace.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# Copyright (c) 2016 - 2021 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. - -#usage : hipconvertinplace.sh DIRNAME [hipify options] [--] [clang options] - -#hipify "inplace" all code files in specified directory. -# This can be quite handy when dealing with an existing CUDA code base since the script -# preserves the existing directory structure. - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 - -hipify_args='' -while (( "$#" )); do - shift - if [ "$1" != "--" ]; then - hipify_args="$hipify_args $1" - else - shift - break - fi -done -clang_args="$@" - -$SCRIPT_DIR/hipify-clang -inplace -print-stats $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args diff --git a/bin/hipexamine.sh b/bin/hipexamine.sh deleted file mode 100755 index 8b28bfc0c6..0000000000 --- a/bin/hipexamine.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# Copyright (c) 2016 - 2021 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. - -#usage : hipexamine.sh DIRNAME [hipify options] [--] [clang options] - -# Generate CUDA->HIP conversion statistics for all the code files in the specified directory. - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 - -hipify_args='' -while (( "$#" )); do - shift - if [ "$1" != "--" ]; then - hipify_args="$hipify_args $1" - else - shift - break - fi -done -clang_args="$@" - -$SCRIPT_DIR/hipify-clang -examine $hipify_args `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` -- -x cuda $clang_args diff --git a/bin/hipify-cmakefile b/bin/hipify-cmakefile deleted file mode 100755 index 6f70aba364..0000000000 --- a/bin/hipify-cmakefile +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env perl -## -# Copyright (c) 2015 - 2021 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. -## -#usage hipify-cmakefile [OPTIONS] INPUT_FILE -use Getopt::Long; -use warnings; - -GetOptions( - "print-stats" => \$print_stats # print the command-line, like a header. - , "quiet-warnings" => \$quiet_warnings # don't print warnings on unknown CUDA functions. - , "no-output" => \$no_output # don't write any translated output to stdout. - , "inplace" => \$inplace # modify input file inplace, save backup in ".prehip" file. - , "n" => \$n # combination of print_stats + no-output. -); - -$print_stats = 1 if $n; -$no_output = 1 if $n; - -@warn_whitelist = (); - -#--- -#Stats tracking code: -@statNames = ( "macro", "include", "option", "other" ); - -#--- -#Compute total of all individual counts: -sub totalStats { - my %count = %{ shift() }; - - my $total = 0; - foreach $key ( keys %count ) { - $total += $count{$key}; - } - - return $total; -} - -#--- -sub printStats { - my $label = shift(); - my @statNames = @{ shift() }; - my %counts = %{ shift() }; - my $warnings = shift(); - my $loc = shift(); - - my $total = totalStats( \%counts ); - - printf STDERR "%s %d CUDA->HIP refs( ", $label, $total; - - foreach $stat (@statNames) { - printf STDERR "%s:%d ", $stat, $counts{$stat}; - } - - printf STDERR ") warn:%d LOC:%d", $warnings, $loc; -} - -#--- -# Add adder stats to dest. Used to add stats for current file to a running total for all files: -sub addStats { - my $dest_ref = shift(); - my %adder = %{ shift() }; - - foreach $key ( keys %adder ) { - $dest_ref->{$key} += $adder{$key}; - } -} - -#--- -sub clearStats { - my $dest_ref = shift(); - my @statNames = @{ shift() }; - - foreach $stat (@statNames) { - $dest_ref->{$stat} = 0; - } -} - -# count of transforms in all files: -my %tt; -clearStats( \%tt, \@statNames ); - -my $fileCount = @ARGV; -my $fileName = ""; - -while (@ARGV) { - $fileName = shift(@ARGV); - if ($inplace) { - my $file_prehip = "$fileName" . ".prehip"; - my $infile; - my $outfile; - if ( -e $file_prehip ) { - $infile = $file_prehip; - $outfile = $fileName; - } - else { - system("cp $fileName $file_prehip"); - $infile = $file_prehip; - $outfile = $fileName; - } - open( INFILE, "<", $infile ) or die "error: could not open $infile"; - open( OUTFILE, ">", $outfile ) or die "error: could not open $outfile"; - $OUTFILE = OUTFILE; - } - else { - open( INFILE, "<", $fileName ) or die "error: could not open $fileName"; - $OUTFILE = STDOUT; - } - - # count of transforms in this file, init to 0 here: - my %ft; - clearStats( \%ft, \@statNames ); - - my $lineCount = 0; - - undef $/; # Read whole file at once, so we can match newlines. - while () { - - # Replace find_package(CUDA) with find_package(HIP) - $ft{'include'} += s/\bfind_package[ ]*\([ ]*CUDA[ ]*[0-9.]*/find_package(HIP/ig; - - # Replace macros - $ft{'macro'} += s/\bCUDA_ADD_EXECUTABLE/HIP_ADD_EXECUTABLE/ig; - $ft{'macro'} += s/\bCUDA_ADD_LIBRARY/HIP_ADD_LIBRARY/ig; - $ft{'macro'} += s/\bCUDA_INCLUDE_DIRECTORIES/HIP_INCLUDE_DIRECTORIES/ig; - - # Replace options - $ft{'option'} += s/\bCUDA_NVCC_FLAGS/HIP_NVCC_FLAGS/ig; - $ft{'option'} += s/\bCUDA_HOST_COMPILATION_CPP/HIP_HOST_COMPILATION_CPP/ig; - $ft{'option'} += s/\bCUDA_SOURCE_PROPERTY_FORMAT/HIP_SOURCE_PROPERTY_FORMAT/ig; - - # Replace variables - $ft{'other'} += s/\bCUDA_FOUND/HIP_FOUND/ig; - $ft{'other'} += s/\bCUDA_VERSION/HIP_VERSION/ig; - $ft{'other'} += s/\bCUDA_TOOLKIT_ROOT_DIR/HIP_ROOT_DIR/ig; - - unless ($quiet_warnings) { - - #print STDERR "Check WARNINGs\n"; - # copy into array of lines, process line-by-line to show warnings: - my @lines = split /\n/, $_; - my $tmp = $_; # copies the whole file, could be a little smarter here... - my $line_num = 0; - - foreach (@lines) { - $line_num++; - - # remove any whitelisted words: - foreach $w (@warn_whitelist) { - s/\b$w\b/ZAP/; - } - - $s = warnUnsupportedSpecialFunctions($line_num); - $warnings += $s; - } - - $_ = $tmp; - } - - #-------- - # Print it! - unless ($no_output) { - print $OUTFILE "$_"; - } - $lineCount = $_ =~ tr/\n//; - } - - my $totalConverted = totalStats( \%ft ); - - if ( ( $totalConverted + $warnings ) and $print_stats ) { - printStats( "info: converted", \@statNames, \%ft, $warnings, $lineCount ); - print STDERR " in '$fileName'\n"; - print STDERR "You may need to hand-edit '$fileName' to add steps to build correctly on HCC path\n"; - } - - # Update totals for all files: - addStats( \%tt, \%ft ); - $Twarnings += $warnings; - $TlineCount += $lineCount; -} - -#-- Print total stats for all files processed: -if ( $print_stats and ( $fileCount > 1 ) ) { - print STDERR "\n"; - printStats( "info: TOTAL-converted", \@statNames, \%tt, $Twarnings, $TlineCount ); - print STDERR "\n"; -} - -#--- -sub warnUnsupportedSpecialFunctions { - my $line_num = shift; - my $m = 0; - - foreach $func ( - # macros: - "CUDA_ADD_CUFFT_TO_TARGET", - "CUDA_ADD_CUBLAS_TO_TARGET", - #"CUDA_ADD_EXECUTABLE", - #"CUDA_ADD_LIBRARY", - "CUDA_BUILD_CLEAN_TARGET", - "CUDA_COMPILE", - "CUDA_COMPILE_PTX", - "CUDA_COMPILE_FATBIN", - "CUDA_COMPILE_CUBIN", - "CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME", - #"CUDA_INCLUDE_DIRECTORIES", - "CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS", - "CUDA_SELECT_NVCC_ARCH_FLAGS", - "CUDA_WRAP_SRCS", - - # options: - "CUDA_64_BIT_DEVICE_CODE", - "CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE", - "CUDA_BUILD_CUBIN", - "CUDA_BUILD_EMULATION", - "CUDA_LINK_LIBRARIES_KEYWORD", - "CUDA_GENERATED_OUTPUT_DIR", - #"CUDA_HOST_COMPILATION_CPP", - "CUDA_HOST_COMPILER", - #"CUDA_NVCC_FLAGS", - #"CUDA_NVCC_FLAGS_", - "CUDA_PROPAGATE_HOST_FLAGS", - "CUDA_SEPARABLE_COMPILATION", - #"CUDA_SOURCE_PROPERTY_FORMAT", - "CUDA_USE_STATIC_CUDA_RUNTIME", - "CUDA_VERBOSE_BUILD", - - # others: - #"CUDA_VERSION_MAJOR", - #"CUDA_VERSION_MINOR", - #"CUDA_VERSION", - #"CUDA_VERSION_STRING", - "CUDA_HAS_FP16", - #"CUDA_TOOLKIT_ROOT_DIR", - "CUDA_SDK_ROOT_DIR", - "CUDA_INCLUDE_DIRS", - "CUDA_LIBRARIES", - "CUDA_CUFFT_LIBRARIES", - "CUDA_CUBLAS_LIBRARIES", - "CUDA_cudart_static_LIBRARY", - "CUDA_cudadevrt_LIBRARY", - "CUDA_cupti_LIBRARY", - "CUDA_curand_LIBRARY", - "CUDA_cusolver_LIBRARY", - "CUDA_cusparse_LIBRARY", - "CUDA_npp_LIBRARY", - "CUDA_nppc_LIBRARY", - "CUDA_nppi_LIBRARY", - "CUDA_npps_LIBRARY", - "CUDA_nvcuvenc_LIBRARY", - "CUDA_nvcuvid_LIBRARY" - ) - { - my $mt = m/\b($func)/g; - if ($mt) { - $m += $mt; - print STDERR " warning: $fileName:#$line_num : unsupported macro/option : $_\n"; - } - } - - return $m; -} diff --git a/bin/hipify-perl b/bin/hipify-perl deleted file mode 100755 index cbf957939a..0000000000 --- a/bin/hipify-perl +++ /dev/null @@ -1,2694 +0,0 @@ -#!/usr/bin/env perl - -## -# Copyright (c) 2015 - 2021 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. -## - -# IMPORTANT: Do not change this file manually: it is generated by hipify-clang --perl - -#usage hipify-perl [OPTIONS] INPUT_FILE - -use warnings; -use Getopt::Long; -my $whitelist = ""; -my $fileName = ""; -my %ft; -my %Tkernels; - -GetOptions( - "examine" => \$examine # Combines -no-output and -print-stats options. - , "inplace" => \$inplace # Modify input file inplace, replacing input with hipified output, save backup in .prehip file. - , "no-output" => \$no_output # Don't write any translated output to stdout. - , "print-stats" => \$print_stats # Print translation statistics. - , "quiet-warnings" => \$quiet_warnings # Don't print warnings on unknown CUDA functions. - , "whitelist=s" => \$whitelist # TODO: test it beforehand -); - -$print_stats = 1 if $examine; -$no_output = 1 if $examine; - -# Whitelist of cuda[A-Z] identifiers, which are commonly used in CUDA sources but don't map to any CUDA API: -@whitelist = ( - "cudaCloverField" - , "cudaColorSpinorField" - , "cudaDevice" - , "cudaDeviceId" - , "cudaDevice_t" - , "cudaDevices" - , "cudaDimBlock" - , "cudaDimGrid" - , "cudaFatLink" - , "cudaGauge" - , "cudaGaugeField" - , "cudaGradInput" - , "cudaGradOutput" - , "cudaGridDim" - , "cudaIDs" - , "cudaInGauge" - , "cudaIndices" - , "cudaInput" - , "cudaMom" - , "cudaOutput" - , "cudaParam" - , "cudaSiteLink" - , "cudaStaple" -); - -push(@whitelist, split(',', $whitelist)); - -@statNames = ("error", "init", "version", "device", "context", "module", "memory", "virtual_memory", "addressing", "stream", "event", "external_resource_interop", "stream_memory", "execution", "graph", "occupancy", "texture", "surface", "peer", "graphics", "profiler", "openGL", "D3D9", "D3D10", "D3D11", "VDPAU", "EGL", "thread", "complex", "library", "device_library", "device_function", "include", "include_cuda_main_header", "type", "literal", "numeric_literal", "define", "extern_shared", "kernel_launch"); - -sub totalStats { - my %count = %{ shift() }; - my $total = 0; - foreach $key (keys %count) { - $total += $count{$key}; - } - return $total; -}; - -sub printStats { - my $label = shift(); - my @statNames = @{ shift() }; - my %counts = %{ shift() }; - my $warnings = shift(); - my $loc = shift(); - my $total = totalStats(\%counts); - printf STDERR "%s %d CUDA->HIP refs ( ", $label, $total; - foreach $stat (@statNames) { - printf STDERR "%s:%d ", $stat, $counts{$stat}; - } - printf STDERR ")\n warn:%d LOC:%d", $warnings, $loc; -} - -sub addStats { - my $dest_ref = shift(); - my %adder = %{ shift() }; - foreach $key (keys %adder) { - $dest_ref->{$key} += $adder{$key}; - } -} - -sub clearStats { - my $dest_ref = shift(); - my @statNames = @{ shift() }; - foreach $stat(@statNames) { - $dest_ref->{$stat} = 0; - } -} - -sub simpleSubstitutions { - $ft{'error'} += s/\bcudaGetErrorName\b/hipGetErrorName/g; - $ft{'error'} += s/\bcudaGetErrorString\b/hipGetErrorString/g; - $ft{'error'} += s/\bcudaGetLastError\b/hipGetLastError/g; - $ft{'error'} += s/\bcudaPeekAtLastError\b/hipPeekAtLastError/g; - $ft{'init'} += s/\bcuInit\b/hipInit/g; - $ft{'version'} += s/\bcuDriverGetVersion\b/hipDriverGetVersion/g; - $ft{'version'} += s/\bcudaDriverGetVersion\b/hipDriverGetVersion/g; - $ft{'version'} += s/\bcudaRuntimeGetVersion\b/hipRuntimeGetVersion/g; - $ft{'device'} += s/\bcuDeviceComputeCapability\b/hipDeviceComputeCapability/g; - $ft{'device'} += s/\bcuDeviceGet\b/hipGetDevice/g; - $ft{'device'} += s/\bcuDeviceGetAttribute\b/hipDeviceGetAttribute/g; - $ft{'device'} += s/\bcuDeviceGetCount\b/hipGetDeviceCount/g; - $ft{'device'} += s/\bcuDeviceGetName\b/hipDeviceGetName/g; - $ft{'device'} += s/\bcuDeviceTotalMem\b/hipDeviceTotalMem/g; - $ft{'device'} += s/\bcuDeviceTotalMem_v2\b/hipDeviceTotalMem/g; - $ft{'device'} += s/\bcudaChooseDevice\b/hipChooseDevice/g; - $ft{'device'} += s/\bcudaDeviceGetAttribute\b/hipDeviceGetAttribute/g; - $ft{'device'} += s/\bcudaDeviceGetByPCIBusId\b/hipDeviceGetByPCIBusId/g; - $ft{'device'} += s/\bcudaDeviceGetCacheConfig\b/hipDeviceGetCacheConfig/g; - $ft{'device'} += s/\bcudaDeviceGetLimit\b/hipDeviceGetLimit/g; - $ft{'device'} += s/\bcudaDeviceGetPCIBusId\b/hipDeviceGetPCIBusId/g; - $ft{'device'} += s/\bcudaDeviceGetSharedMemConfig\b/hipDeviceGetSharedMemConfig/g; - $ft{'device'} += s/\bcudaDeviceGetStreamPriorityRange\b/hipDeviceGetStreamPriorityRange/g; - $ft{'device'} += s/\bcudaDeviceReset\b/hipDeviceReset/g; - $ft{'device'} += s/\bcudaDeviceSetCacheConfig\b/hipDeviceSetCacheConfig/g; - $ft{'device'} += s/\bcudaDeviceSetLimit\b/hipDeviceSetLimit/g; - $ft{'device'} += s/\bcudaDeviceSetSharedMemConfig\b/hipDeviceSetSharedMemConfig/g; - $ft{'device'} += s/\bcudaDeviceSynchronize\b/hipDeviceSynchronize/g; - $ft{'device'} += s/\bcudaFuncSetCacheConfig\b/hipFuncSetCacheConfig/g; - $ft{'device'} += s/\bcudaGetDevice\b/hipGetDevice/g; - $ft{'device'} += s/\bcudaGetDeviceCount\b/hipGetDeviceCount/g; - $ft{'device'} += s/\bcudaGetDeviceFlags\b/hipCtxGetFlags/g; - $ft{'device'} += s/\bcudaGetDeviceProperties\b/hipGetDeviceProperties/g; - $ft{'device'} += s/\bcudaIpcCloseMemHandle\b/hipIpcCloseMemHandle/g; - $ft{'device'} += s/\bcudaIpcGetEventHandle\b/hipIpcGetEventHandle/g; - $ft{'device'} += s/\bcudaIpcGetMemHandle\b/hipIpcGetMemHandle/g; - $ft{'device'} += s/\bcudaIpcOpenEventHandle\b/hipIpcOpenEventHandle/g; - $ft{'device'} += s/\bcudaIpcOpenMemHandle\b/hipIpcOpenMemHandle/g; - $ft{'device'} += s/\bcudaSetDevice\b/hipSetDevice/g; - $ft{'device'} += s/\bcudaSetDeviceFlags\b/hipSetDeviceFlags/g; - $ft{'context'} += s/\bcuCtxCreate\b/hipCtxCreate/g; - $ft{'context'} += s/\bcuCtxCreate_v2\b/hipCtxCreate/g; - $ft{'context'} += s/\bcuCtxDestroy\b/hipCtxDestroy/g; - $ft{'context'} += s/\bcuCtxDestroy_v2\b/hipCtxDestroy/g; - $ft{'context'} += s/\bcuCtxGetApiVersion\b/hipCtxGetApiVersion/g; - $ft{'context'} += s/\bcuCtxGetCacheConfig\b/hipCtxGetCacheConfig/g; - $ft{'context'} += s/\bcuCtxGetCurrent\b/hipCtxGetCurrent/g; - $ft{'context'} += s/\bcuCtxGetDevice\b/hipCtxGetDevice/g; - $ft{'context'} += s/\bcuCtxGetFlags\b/hipCtxGetFlags/g; - $ft{'context'} += s/\bcuCtxGetLimit\b/hipDeviceGetLimit/g; - $ft{'context'} += s/\bcuCtxGetSharedMemConfig\b/hipCtxGetSharedMemConfig/g; - $ft{'context'} += s/\bcuCtxGetStreamPriorityRange\b/hipDeviceGetStreamPriorityRange/g; - $ft{'context'} += s/\bcuCtxPopCurrent\b/hipCtxPopCurrent/g; - $ft{'context'} += s/\bcuCtxPopCurrent_v2\b/hipCtxPopCurrent/g; - $ft{'context'} += s/\bcuCtxPushCurrent\b/hipCtxPushCurrent/g; - $ft{'context'} += s/\bcuCtxPushCurrent_v2\b/hipCtxPushCurrent/g; - $ft{'context'} += s/\bcuCtxSetCacheConfig\b/hipCtxSetCacheConfig/g; - $ft{'context'} += s/\bcuCtxSetCurrent\b/hipCtxSetCurrent/g; - $ft{'context'} += s/\bcuCtxSetLimit\b/hipDeviceSetLimit/g; - $ft{'context'} += s/\bcuCtxSetSharedMemConfig\b/hipCtxSetSharedMemConfig/g; - $ft{'context'} += s/\bcuCtxSynchronize\b/hipCtxSynchronize/g; - $ft{'context'} += s/\bcuDevicePrimaryCtxGetState\b/hipDevicePrimaryCtxGetState/g; - $ft{'context'} += s/\bcuDevicePrimaryCtxRelease\b/hipDevicePrimaryCtxRelease/g; - $ft{'context'} += s/\bcuDevicePrimaryCtxReset\b/hipDevicePrimaryCtxReset/g; - $ft{'context'} += s/\bcuDevicePrimaryCtxRetain\b/hipDevicePrimaryCtxRetain/g; - $ft{'context'} += s/\bcuDevicePrimaryCtxSetFlags\b/hipDevicePrimaryCtxSetFlags/g; - $ft{'module'} += s/\bcuModuleGetFunction\b/hipModuleGetFunction/g; - $ft{'module'} += s/\bcuModuleGetGlobal\b/hipModuleGetGlobal/g; - $ft{'module'} += s/\bcuModuleGetGlobal_v2\b/hipModuleGetGlobal/g; - $ft{'module'} += s/\bcuModuleGetTexRef\b/hipModuleGetTexRef/g; - $ft{'module'} += s/\bcuModuleLoad\b/hipModuleLoad/g; - $ft{'module'} += s/\bcuModuleLoadData\b/hipModuleLoadData/g; - $ft{'module'} += s/\bcuModuleLoadDataEx\b/hipModuleLoadDataEx/g; - $ft{'module'} += s/\bcuModuleUnload\b/hipModuleUnload/g; - $ft{'memory'} += s/\bcuArray3DCreate\b/hipArray3DCreate/g; - $ft{'memory'} += s/\bcuArray3DCreate_v2\b/hipArray3DCreate/g; - $ft{'memory'} += s/\bcuArrayCreate\b/hipArrayCreate/g; - $ft{'memory'} += s/\bcuArrayCreate_v2\b/hipArrayCreate/g; - $ft{'memory'} += s/\bcuDeviceGetByPCIBusId\b/hipDeviceGetByPCIBusId/g; - $ft{'memory'} += s/\bcuDeviceGetPCIBusId\b/hipDeviceGetPCIBusId/g; - $ft{'memory'} += s/\bcuIpcCloseMemHandle\b/hipIpcCloseMemHandle/g; - $ft{'memory'} += s/\bcuIpcGetMemHandle\b/hipIpcGetMemHandle/g; - $ft{'memory'} += s/\bcuIpcOpenMemHandle\b/hipIpcOpenMemHandle/g; - $ft{'memory'} += s/\bcuMemAlloc\b/hipMalloc/g; - $ft{'memory'} += s/\bcuMemAllocHost\b/hipHostMalloc/g; - $ft{'memory'} += s/\bcuMemAllocHost_v2\b/hipHostMalloc/g; - $ft{'memory'} += s/\bcuMemAllocManaged\b/hipMallocManaged/g; - $ft{'memory'} += s/\bcuMemAllocPitch\b/hipMemAllocPitch/g; - $ft{'memory'} += s/\bcuMemAllocPitch_v2\b/hipMemAllocPitch/g; - $ft{'memory'} += s/\bcuMemAlloc_v2\b/hipMalloc/g; - $ft{'memory'} += s/\bcuMemFree\b/hipFree/g; - $ft{'memory'} += s/\bcuMemFreeHost\b/hipHostFree/g; - $ft{'memory'} += s/\bcuMemFree_v2\b/hipFree/g; - $ft{'memory'} += s/\bcuMemGetAddressRange\b/hipMemGetAddressRange/g; - $ft{'memory'} += s/\bcuMemGetAddressRange_v2\b/hipMemGetAddressRange/g; - $ft{'memory'} += s/\bcuMemGetInfo\b/hipMemGetInfo/g; - $ft{'memory'} += s/\bcuMemGetInfo_v2\b/hipMemGetInfo/g; - $ft{'memory'} += s/\bcuMemHostAlloc\b/hipHostMalloc/g; - $ft{'memory'} += s/\bcuMemHostGetDevicePointer\b/hipHostGetDevicePointer/g; - $ft{'memory'} += s/\bcuMemHostGetDevicePointer_v2\b/hipHostGetDevicePointer/g; - $ft{'memory'} += s/\bcuMemHostGetFlags\b/hipHostGetFlags/g; - $ft{'memory'} += s/\bcuMemHostRegister\b/hipHostRegister/g; - $ft{'memory'} += s/\bcuMemHostRegister_v2\b/hipHostRegister/g; - $ft{'memory'} += s/\bcuMemHostUnregister\b/hipHostUnregister/g; - $ft{'memory'} += s/\bcuMemcpy2D\b/hipMemcpyParam2D/g; - $ft{'memory'} += s/\bcuMemcpy2DAsync\b/hipMemcpyParam2DAsync/g; - $ft{'memory'} += s/\bcuMemcpy2DAsync_v2\b/hipMemcpyParam2DAsync/g; - $ft{'memory'} += s/\bcuMemcpy2D_v2\b/hipMemcpyParam2D/g; - $ft{'memory'} += s/\bcuMemcpy3D\b/hipDrvMemcpy3D/g; - $ft{'memory'} += s/\bcuMemcpy3DAsync\b/hipDrvMemcpy3DAsync/g; - $ft{'memory'} += s/\bcuMemcpy3D_v2\b/hipDrvMemcpy3D/g; - $ft{'memory'} += s/\bcuMemcpy3DAsync_v2\b/hipDrvMemcpy3DAsync/g; - $ft{'memory'} += s/\bcuMemcpyAtoH\b/hipMemcpyAtoH/g; - $ft{'memory'} += s/\bcuMemcpyAtoH_v2\b/hipMemcpyAtoH/g; - $ft{'memory'} += s/\bcuMemcpyDtoD\b/hipMemcpyDtoD/g; - $ft{'memory'} += s/\bcuMemcpyDtoDAsync\b/hipMemcpyDtoDAsync/g; - $ft{'memory'} += s/\bcuMemcpyDtoDAsync_v2\b/hipMemcpyDtoDAsync/g; - $ft{'memory'} += s/\bcuMemcpyDtoD_v2\b/hipMemcpyDtoD/g; - $ft{'memory'} += s/\bcuMemcpyDtoH\b/hipMemcpyDtoH/g; - $ft{'memory'} += s/\bcuMemcpyDtoHAsync\b/hipMemcpyDtoHAsync/g; - $ft{'memory'} += s/\bcuMemcpyDtoHAsync_v2\b/hipMemcpyDtoHAsync/g; - $ft{'memory'} += s/\bcuMemcpyDtoH_v2\b/hipMemcpyDtoH/g; - $ft{'memory'} += s/\bcuMemcpyHtoA\b/hipMemcpyHtoA/g; - $ft{'memory'} += s/\bcuMemcpyHtoA_v2\b/hipMemcpyHtoA/g; - $ft{'memory'} += s/\bcuMemcpyHtoD\b/hipMemcpyHtoD/g; - $ft{'memory'} += s/\bcuMemcpyHtoDAsync\b/hipMemcpyHtoDAsync/g; - $ft{'memory'} += s/\bcuMemcpyHtoDAsync_v2\b/hipMemcpyHtoDAsync/g; - $ft{'memory'} += s/\bcuMemcpyHtoD_v2\b/hipMemcpyHtoD/g; - $ft{'memory'} += s/\bcuMemsetD16\b/hipMemsetD16/g; - $ft{'memory'} += s/\bcuMemsetD16Async\b/hipMemsetD16Async/g; - $ft{'memory'} += s/\bcuMemsetD16_v2\b/hipMemsetD16/g; - $ft{'memory'} += s/\bcuMemsetD32\b/hipMemsetD32/g; - $ft{'memory'} += s/\bcuMemsetD32Async\b/hipMemsetD32Async/g; - $ft{'memory'} += s/\bcuMemsetD32_v2\b/hipMemsetD32/g; - $ft{'memory'} += s/\bcuMemsetD8\b/hipMemsetD8/g; - $ft{'memory'} += s/\bcuMemsetD8Async\b/hipMemsetD8Async/g; - $ft{'memory'} += s/\bcuMemsetD8_v2\b/hipMemsetD8/g; - $ft{'memory'} += s/\bcudaFree\b/hipFree/g; - $ft{'memory'} += s/\bcudaFreeArray\b/hipFreeArray/g; - $ft{'memory'} += s/\bcudaFreeHost\b/hipHostFree/g; - $ft{'memory'} += s/\bcudaGetSymbolAddress\b/hipGetSymbolAddress/g; - $ft{'memory'} += s/\bcudaGetSymbolSize\b/hipGetSymbolSize/g; - $ft{'memory'} += s/\bcudaHostAlloc\b/hipHostMalloc/g; - $ft{'memory'} += s/\bcudaHostGetDevicePointer\b/hipHostGetDevicePointer/g; - $ft{'memory'} += s/\bcudaHostGetFlags\b/hipHostGetFlags/g; - $ft{'memory'} += s/\bcudaHostRegister\b/hipHostRegister/g; - $ft{'memory'} += s/\bcudaHostUnregister\b/hipHostUnregister/g; - $ft{'memory'} += s/\bcudaMalloc\b/hipMalloc/g; - $ft{'memory'} += s/\bcudaMalloc3D\b/hipMalloc3D/g; - $ft{'memory'} += s/\bcudaMalloc3DArray\b/hipMalloc3DArray/g; - $ft{'memory'} += s/\bcudaMallocArray\b/hipMallocArray/g; - $ft{'memory'} += s/\bcudaMallocHost\b/hipHostMalloc/g; - $ft{'memory'} += s/\bcudaMallocManaged\b/hipMallocManaged/g; - $ft{'memory'} += s/\bcudaMallocPitch\b/hipMallocPitch/g; - $ft{'memory'} += s/\bcudaMemGetInfo\b/hipMemGetInfo/g; - $ft{'memory'} += s/\bcudaMemcpy\b/hipMemcpy/g; - $ft{'memory'} += s/\bcudaMemcpy2D\b/hipMemcpy2D/g; - $ft{'memory'} += s/\bcudaMemcpy2DAsync\b/hipMemcpy2DAsync/g; - $ft{'memory'} += s/\bcudaMemcpy2DFromArray\b/hipMemcpy2DFromArray/g; - $ft{'memory'} += s/\bcudaMemcpy2DFromArrayAsync\b/hipMemcpy2DFromArrayAsync/g; - $ft{'memory'} += s/\bcudaMemcpy2DToArray\b/hipMemcpy2DToArray/g; - $ft{'memory'} += s/\bcudaMemcpy3D\b/hipMemcpy3D/g; - $ft{'memory'} += s/\bcudaMemcpy3DAsync\b/hipMemcpy3DAsync/g; - $ft{'memory'} += s/\bcudaMemcpyAsync\b/hipMemcpyAsync/g; - $ft{'memory'} += s/\bcudaMemcpyFromArray\b/hipMemcpyFromArray/g; - $ft{'memory'} += s/\bcudaMemcpyFromSymbol\b/hipMemcpyFromSymbol/g; - $ft{'memory'} += s/\bcudaMemcpyFromSymbolAsync\b/hipMemcpyFromSymbolAsync/g; - $ft{'memory'} += s/\bcudaMemcpyPeer\b/hipMemcpyPeer/g; - $ft{'memory'} += s/\bcudaMemcpyPeerAsync\b/hipMemcpyPeerAsync/g; - $ft{'memory'} += s/\bcudaMemcpyToArray\b/hipMemcpyToArray/g; - $ft{'memory'} += s/\bcudaMemcpyToArrayAsync\b/hipMemcpyToArrayAsync/g; - $ft{'memory'} += s/\bcudaMemcpyToSymbol\b/hipMemcpyToSymbol/g; - $ft{'memory'} += s/\bcudaMemcpyToSymbolAsync\b/hipMemcpyToSymbolAsync/g; - $ft{'memory'} += s/\bcudaMemset\b/hipMemset/g; - $ft{'memory'} += s/\bcudaMemset2D\b/hipMemset2D/g; - $ft{'memory'} += s/\bcudaMemset2DAsync\b/hipMemset2DAsync/g; - $ft{'memory'} += s/\bcudaMemset3D\b/hipMemset3D/g; - $ft{'memory'} += s/\bcudaMemset3DAsync\b/hipMemset3DAsync/g; - $ft{'memory'} += s/\bcudaMemsetAsync\b/hipMemsetAsync/g; - $ft{'memory'} += s/\bmake_cudaExtent\b/make_hipExtent/g; - $ft{'memory'} += s/\bmake_cudaPitchedPtr\b/make_hipPitchedPtr/g; - $ft{'memory'} += s/\bmake_cudaPos\b/make_hipPos/g; - $ft{'addressing'} += s/\bcudaPointerGetAttributes\b/hipPointerGetAttributes/g; - $ft{'stream'} += s/\bcuStreamAddCallback\b/hipStreamAddCallback/g; - $ft{'stream'} += s/\bcuStreamCreate\b/hipStreamCreateWithFlags/g; - $ft{'stream'} += s/\bcuStreamCreateWithPriority\b/hipStreamCreateWithPriority/g; - $ft{'stream'} += s/\bcuStreamDestroy\b/hipStreamDestroy/g; - $ft{'stream'} += s/\bcuStreamDestroy_v2\b/hipStreamDestroy/g; - $ft{'stream'} += s/\bcuStreamGetFlags\b/hipStreamGetFlags/g; - $ft{'stream'} += s/\bcuStreamGetPriority\b/hipStreamGetPriority/g; - $ft{'stream'} += s/\bcuStreamQuery\b/hipStreamQuery/g; - $ft{'stream'} += s/\bcuStreamSynchronize\b/hipStreamSynchronize/g; - $ft{'stream'} += s/\bcuStreamWaitEvent\b/hipStreamWaitEvent/g; - $ft{'stream'} += s/\bcudaStreamAddCallback\b/hipStreamAddCallback/g; - $ft{'stream'} += s/\bcudaStreamCreate\b/hipStreamCreate/g; - $ft{'stream'} += s/\bcudaStreamCreateWithFlags\b/hipStreamCreateWithFlags/g; - $ft{'stream'} += s/\bcudaStreamCreateWithPriority\b/hipStreamCreateWithPriority/g; - $ft{'stream'} += s/\bcudaStreamDestroy\b/hipStreamDestroy/g; - $ft{'stream'} += s/\bcudaStreamGetFlags\b/hipStreamGetFlags/g; - $ft{'stream'} += s/\bcudaStreamGetPriority\b/hipStreamGetPriority/g; - $ft{'stream'} += s/\bcudaStreamQuery\b/hipStreamQuery/g; - $ft{'stream'} += s/\bcudaStreamSynchronize\b/hipStreamSynchronize/g; - $ft{'stream'} += s/\bcudaStreamWaitEvent\b/hipStreamWaitEvent/g; - $ft{'event'} += s/\bcuEventCreate\b/hipEventCreateWithFlags/g; - $ft{'event'} += s/\bcuEventDestroy\b/hipEventDestroy/g; - $ft{'event'} += s/\bcuEventDestroy_v2\b/hipEventDestroy/g; - $ft{'event'} += s/\bcuEventElapsedTime\b/hipEventElapsedTime/g; - $ft{'event'} += s/\bcuEventQuery\b/hipEventQuery/g; - $ft{'event'} += s/\bcuEventRecord\b/hipEventRecord/g; - $ft{'event'} += s/\bcuEventSynchronize\b/hipEventSynchronize/g; - $ft{'event'} += s/\bcudaEventCreate\b/hipEventCreate/g; - $ft{'event'} += s/\bcudaEventCreateWithFlags\b/hipEventCreateWithFlags/g; - $ft{'event'} += s/\bcudaEventDestroy\b/hipEventDestroy/g; - $ft{'event'} += s/\bcudaEventElapsedTime\b/hipEventElapsedTime/g; - $ft{'event'} += s/\bcudaEventQuery\b/hipEventQuery/g; - $ft{'event'} += s/\bcudaEventRecord\b/hipEventRecord/g; - $ft{'event'} += s/\bcudaEventSynchronize\b/hipEventSynchronize/g; - $ft{'execution'} += s/\bcuFuncGetAttribute\b/hipFuncGetAttribute/g; - $ft{'execution'} += s/\bcuLaunchKernel\b/hipModuleLaunchKernel/g; - $ft{'execution'} += s/\bcudaConfigureCall\b/hipConfigureCall/g; - $ft{'execution'} += s/\bcudaFuncGetAttributes\b/hipFuncGetAttributes/g; - $ft{'execution'} += s/\bcudaLaunch\b/hipLaunchByPtr/g; - $ft{'execution'} += s/\bcudaLaunchCooperativeKernel\b/hipLaunchCooperativeKernel/g; - $ft{'execution'} += s/\bcudaLaunchCooperativeKernelMultiDevice\b/hipLaunchCooperativeKernelMultiDevice/g; - $ft{'execution'} += s/\bcudaLaunchKernel\b/hipLaunchKernel/g; - $ft{'execution'} += s/\bcudaSetupArgument\b/hipSetupArgument/g; - $ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessor\b/hipDrvOccupancyMaxActiveBlocksPerMultiprocessor/g; - $ft{'occupancy'} += s/\bcuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags\b/hipDrvOccupancyMaxActiveBlocksPerMultiprocessorWithFlags/g; - $ft{'occupancy'} += s/\bcuOccupancyMaxPotentialBlockSize\b/hipOccupancyMaxPotentialBlockSize/g; - $ft{'occupancy'} += s/\bcudaOccupancyMaxActiveBlocksPerMultiprocessor\b/hipOccupancyMaxActiveBlocksPerMultiprocessor/g; - $ft{'occupancy'} += s/\bcudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags\b/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags/g; - $ft{'occupancy'} += s/\bcudaOccupancyMaxPotentialBlockSize\b/hipOccupancyMaxPotentialBlockSize/g; - $ft{'texture'} += s/\bcuTexRefGetAddress\b/hipTexRefGetAddress/g; - $ft{'texture'} += s/\bcuTexRefGetAddressMode\b/hipTexRefGetAddressMode/g; - $ft{'texture'} += s/\bcuTexRefGetAddress_v2\b/hipTexRefGetAddress/g; - $ft{'texture'} += s/\bcuTexRefGetArray\b/hipTexRefGetArray/g; - $ft{'texture'} += s/\bcuTexRefSetAddress\b/hipTexRefSetAddress/g; - $ft{'texture'} += s/\bcuTexRefSetAddress2D\b/hipTexRefSetAddress2D/g; - $ft{'texture'} += s/\bcuTexRefSetAddress2D_v2\b/hipTexRefSetAddress2D/g; - $ft{'texture'} += s/\bcuTexRefSetAddress2D_v3\b/hipTexRefSetAddress2D/g; - $ft{'texture'} += s/\bcuTexRefSetAddressMode\b/hipTexRefSetAddressMode/g; - $ft{'texture'} += s/\bcuTexRefSetAddress_v2\b/hipTexRefSetAddress/g; - $ft{'texture'} += s/\bcuTexRefSetArray\b/hipTexRefSetArray/g; - $ft{'texture'} += s/\bcuTexRefSetFilterMode\b/hipTexRefSetFilterMode/g; - $ft{'texture'} += s/\bcuTexRefSetFlags\b/hipTexRefSetFlags/g; - $ft{'texture'} += s/\bcuTexRefSetFormat\b/hipTexRefSetFormat/g; - $ft{'texture'} += s/\bcudaBindTexture\b/hipBindTexture/g; - $ft{'texture'} += s/\bcudaBindTexture2D\b/hipBindTexture2D/g; - $ft{'texture'} += s/\bcudaBindTextureToArray\b/hipBindTextureToArray/g; - $ft{'texture'} += s/\bcudaBindTextureToMipmappedArray\b/hipBindTextureToMipmappedArray/g; - $ft{'texture'} += s/\bcudaCreateChannelDesc\b/hipCreateChannelDesc/g; - $ft{'texture'} += s/\bcudaCreateTextureObject\b/hipCreateTextureObject/g; - $ft{'texture'} += s/\bcudaDestroyTextureObject\b/hipDestroyTextureObject/g; - $ft{'texture'} += s/\bcudaGetChannelDesc\b/hipGetChannelDesc/g; - $ft{'texture'} += s/\bcudaGetTextureAlignmentOffset\b/hipGetTextureAlignmentOffset/g; - $ft{'texture'} += s/\bcudaGetTextureObjectResourceDesc\b/hipGetTextureObjectResourceDesc/g; - $ft{'texture'} += s/\bcudaGetTextureObjectResourceViewDesc\b/hipGetTextureObjectResourceViewDesc/g; - $ft{'texture'} += s/\bcudaGetTextureReference\b/hipGetTextureReference/g; - $ft{'texture'} += s/\bcudaUnbindTexture\b/hipUnbindTexture/g; - $ft{'surface'} += s/\bcudaCreateSurfaceObject\b/hipCreateSurfaceObject/g; - $ft{'surface'} += s/\bcudaDestroySurfaceObject\b/hipDestroySurfaceObject/g; - $ft{'peer'} += s/\bcuCtxDisablePeerAccess\b/hipCtxDisablePeerAccess/g; - $ft{'peer'} += s/\bcuCtxEnablePeerAccess\b/hipCtxEnablePeerAccess/g; - $ft{'peer'} += s/\bcuDeviceCanAccessPeer\b/hipDeviceCanAccessPeer/g; - $ft{'peer'} += s/\bcudaDeviceCanAccessPeer\b/hipDeviceCanAccessPeer/g; - $ft{'peer'} += s/\bcudaDeviceDisablePeerAccess\b/hipDeviceDisablePeerAccess/g; - $ft{'peer'} += s/\bcudaDeviceEnablePeerAccess\b/hipDeviceEnablePeerAccess/g; - $ft{'profiler'} += s/\bcuProfilerStart\b/hipProfilerStart/g; - $ft{'profiler'} += s/\bcuProfilerStop\b/hipProfilerStop/g; - $ft{'profiler'} += s/\bcudaProfilerStart\b/hipProfilerStart/g; - $ft{'profiler'} += s/\bcudaProfilerStop\b/hipProfilerStop/g; - $ft{'thread'} += s/\bcudaThreadExit\b/hipDeviceReset/g; - $ft{'thread'} += s/\bcudaThreadGetCacheConfig\b/hipDeviceGetCacheConfig/g; - $ft{'thread'} += s/\bcudaThreadSetCacheConfig\b/hipDeviceSetCacheConfig/g; - $ft{'thread'} += s/\bcudaThreadSynchronize\b/hipDeviceSynchronize/g; - $ft{'complex'} += s/\bcuCabs\b/hipCabs/g; - $ft{'complex'} += s/\bcuCabsf\b/hipCabsf/g; - $ft{'complex'} += s/\bcuCadd\b/hipCadd/g; - $ft{'complex'} += s/\bcuCaddf\b/hipCaddf/g; - $ft{'complex'} += s/\bcuCdiv\b/hipCdiv/g; - $ft{'complex'} += s/\bcuCdivf\b/hipCdivf/g; - $ft{'complex'} += s/\bcuCfma\b/hipCfma/g; - $ft{'complex'} += s/\bcuCfmaf\b/hipCfmaf/g; - $ft{'complex'} += s/\bcuCimag\b/hipCimag/g; - $ft{'complex'} += s/\bcuCimagf\b/hipCimagf/g; - $ft{'complex'} += s/\bcuCmul\b/hipCmul/g; - $ft{'complex'} += s/\bcuCmulf\b/hipCmulf/g; - $ft{'complex'} += s/\bcuComplexDoubleToFloat\b/hipComplexDoubleToFloat/g; - $ft{'complex'} += s/\bcuComplexFloatToDouble\b/hipComplexFloatToDouble/g; - $ft{'complex'} += s/\bcuConj\b/hipConj/g; - $ft{'complex'} += s/\bcuConjf\b/hipConjf/g; - $ft{'complex'} += s/\bcuCreal\b/hipCreal/g; - $ft{'complex'} += s/\bcuCrealf\b/hipCrealf/g; - $ft{'complex'} += s/\bcuCsub\b/hipCsub/g; - $ft{'complex'} += s/\bcuCsubf\b/hipCsubf/g; - $ft{'complex'} += s/\bmake_cuComplex\b/make_hipComplex/g; - $ft{'complex'} += s/\bmake_cuDoubleComplex\b/make_hipDoubleComplex/g; - $ft{'complex'} += s/\bmake_cuFloatComplex\b/make_hipFloatComplex/g; - $ft{'library'} += s/\bcublasCaxpy\b/hipblasCaxpy/g; - $ft{'library'} += s/\bcublasCaxpy_v2\b/hipblasCaxpy/g; - $ft{'library'} += s/\bcublasCcopy\b/hipblasCcopy/g; - $ft{'library'} += s/\bcublasCcopy_v2\b/hipblasCcopy/g; - $ft{'library'} += s/\bcublasCdotc\b/hipblasCdotc/g; - $ft{'library'} += s/\bcublasCdotc_v2\b/hipblasCdotc/g; - $ft{'library'} += s/\bcublasCdotu\b/hipblasCdotu/g; - $ft{'library'} += s/\bcublasCdotu_v2\b/hipblasCdotu/g; - $ft{'library'} += s/\bcublasCgemm\b/hipblasCgemm/g; - $ft{'library'} += s/\bcublasCgemmBatched\b/hipblasCgemmBatched/g; - $ft{'library'} += s/\bcublasCgemmStridedBatched\b/hipblasCgemmStridedBatched/g; - $ft{'library'} += s/\bcublasCgemv\b/hipblasCgemv/g; - $ft{'library'} += s/\bcublasCgemv_v2\b/hipblasCgemv/g; - $ft{'library'} += s/\bcublasCreate\b/hipblasCreate/g; - $ft{'library'} += s/\bcublasCreate_v2\b/hipblasCreate/g; - $ft{'library'} += s/\bcublasCrot\b/hipblasCrot/g; - $ft{'library'} += s/\bcublasCrot_v2\b/hipblasCrot/g; - $ft{'library'} += s/\bcublasCrotg\b/hipblasCrotg/g; - $ft{'library'} += s/\bcublasCrotg_v2\b/hipblasCrotg/g; - $ft{'library'} += s/\bcublasCscal\b/hipblasCscal/g; - $ft{'library'} += s/\bcublasCscal_v2\b/hipblasCscal/g; - $ft{'library'} += s/\bcublasCsrot\b/hipblasCsrot/g; - $ft{'library'} += s/\bcublasCsrot_v2\b/hipblasCsrot/g; - $ft{'library'} += s/\bcublasCsscal\b/hipblasCsscal/g; - $ft{'library'} += s/\bcublasCsscal_v2\b/hipblasCsscal/g; - $ft{'library'} += s/\bcublasCswap\b/hipblasCswap/g; - $ft{'library'} += s/\bcublasCswap_v2\b/hipblasCswap/g; - $ft{'library'} += s/\bcublasDasum\b/hipblasDasum/g; - $ft{'library'} += s/\bcublasDasum_v2\b/hipblasDasum/g; - $ft{'library'} += s/\bcublasDaxpy\b/hipblasDaxpy/g; - $ft{'library'} += s/\bcublasDaxpy_v2\b/hipblasDaxpy/g; - $ft{'library'} += s/\bcublasDcopy\b/hipblasDcopy/g; - $ft{'library'} += s/\bcublasDcopy_v2\b/hipblasDcopy/g; - $ft{'library'} += s/\bcublasDdot\b/hipblasDdot/g; - $ft{'library'} += s/\bcublasDdot_v2\b/hipblasDdot/g; - $ft{'library'} += s/\bcublasDestroy\b/hipblasDestroy/g; - $ft{'library'} += s/\bcublasDestroy_v2\b/hipblasDestroy/g; - $ft{'library'} += s/\bcublasDgeam\b/hipblasDgeam/g; - $ft{'library'} += s/\bcublasDgemm\b/hipblasDgemm/g; - $ft{'library'} += s/\bcublasDgemmBatched\b/hipblasDgemmBatched/g; - $ft{'library'} += s/\bcublasDgemmStridedBatched\b/hipblasDgemmStridedBatched/g; - $ft{'library'} += s/\bcublasDgemm_v2\b/hipblasDgemm/g; - $ft{'library'} += s/\bcublasDgemv\b/hipblasDgemv/g; - $ft{'library'} += s/\bcublasDgemv_v2\b/hipblasDgemv/g; - $ft{'library'} += s/\bcublasDger\b/hipblasDger/g; - $ft{'library'} += s/\bcublasDger_v2\b/hipblasDger/g; - $ft{'library'} += s/\bcublasDnrm2\b/hipblasDnrm2/g; - $ft{'library'} += s/\bcublasDnrm2_v2\b/hipblasDnrm2/g; - $ft{'library'} += s/\bcublasDrot\b/hipblasDrot/g; - $ft{'library'} += s/\bcublasDrot_v2\b/hipblasDrot/g; - $ft{'library'} += s/\bcublasDrotg\b/hipblasDrotg/g; - $ft{'library'} += s/\bcublasDrotg_v2\b/hipblasDrotg/g; - $ft{'library'} += s/\bcublasDrotm\b/hipblasDrotm/g; - $ft{'library'} += s/\bcublasDrotm_v2\b/hipblasDrotm/g; - $ft{'library'} += s/\bcublasDrotmg\b/hipblasDrotmg/g; - $ft{'library'} += s/\bcublasDrotmg_v2\b/hipblasDrotmg/g; - $ft{'library'} += s/\bcublasDscal\b/hipblasDscal/g; - $ft{'library'} += s/\bcublasDscal_v2\b/hipblasDscal/g; - $ft{'library'} += s/\bcublasDswap\b/hipblasDswap/g; - $ft{'library'} += s/\bcublasDswap_v2\b/hipblasDswap/g; - $ft{'library'} += s/\bcublasDsyr\b/hipblasDsyr/g; - $ft{'library'} += s/\bcublasDsyr_v2\b/hipblasDsyr/g; - $ft{'library'} += s/\bcublasDtrsm\b/hipblasDtrsm/g; - $ft{'library'} += s/\bcublasDtrsm_v2\b/hipblasDtrsm/g; - $ft{'library'} += s/\bcublasDtrsv\b/hipblasDtrsv/g; - $ft{'library'} += s/\bcublasDtrsv_v2\b/hipblasDtrsv/g; - $ft{'library'} += s/\bcublasDzasum\b/hipblasDzasum/g; - $ft{'library'} += s/\bcublasDzasum_v2\b/hipblasDzasum/g; - $ft{'library'} += s/\bcublasDznrm2\b/hipblasDznrm2/g; - $ft{'library'} += s/\bcublasDznrm2_v2\b/hipblasDznrm2/g; - $ft{'library'} += s/\bcublasGemmEx\b/hipblasGemmEx/g; - $ft{'library'} += s/\bcublasGetMatrix\b/hipblasGetMatrix/g; - $ft{'library'} += s/\bcublasGetPointerMode\b/hipblasGetPointerMode/g; - $ft{'library'} += s/\bcublasGetPointerMode_v2\b/hipblasGetPointerMode/g; - $ft{'library'} += s/\bcublasGetStream\b/hipblasGetStream/g; - $ft{'library'} += s/\bcublasGetStream_v2\b/hipblasGetStream/g; - $ft{'library'} += s/\bcublasGetVector\b/hipblasGetVector/g; - $ft{'library'} += s/\bcublasHgemm\b/hipblasHgemm/g; - $ft{'library'} += s/\bcublasHgemmBatched\b/hipblasHgemmBatched/g; - $ft{'library'} += s/\bcublasHgemmStridedBatched\b/hipblasHgemmStridedBatched/g; - $ft{'library'} += s/\bcublasIcamax\b/hipblasIcamax/g; - $ft{'library'} += s/\bcublasIcamax_v2\b/hipblasIcamax/g; - $ft{'library'} += s/\bcublasIcamin\b/hipblasIcamin/g; - $ft{'library'} += s/\bcublasIcamin_v2\b/hipblasIcamin/g; - $ft{'library'} += s/\bcublasIdamax\b/hipblasIdamax/g; - $ft{'library'} += s/\bcublasIdamax_v2\b/hipblasIdamax/g; - $ft{'library'} += s/\bcublasIdamin\b/hipblasIdamin/g; - $ft{'library'} += s/\bcublasIdamin_v2\b/hipblasIdamin/g; - $ft{'library'} += s/\bcublasIsamax\b/hipblasIsamax/g; - $ft{'library'} += s/\bcublasIsamax_v2\b/hipblasIsamax/g; - $ft{'library'} += s/\bcublasIsamin\b/hipblasIsamin/g; - $ft{'library'} += s/\bcublasIsamin_v2\b/hipblasIsamin/g; - $ft{'library'} += s/\bcublasIzamax\b/hipblasIzamax/g; - $ft{'library'} += s/\bcublasIzamax_v2\b/hipblasIzamax/g; - $ft{'library'} += s/\bcublasIzamin\b/hipblasIzamin/g; - $ft{'library'} += s/\bcublasIzamin_v2\b/hipblasIzamin/g; - $ft{'library'} += s/\bcublasSasum\b/hipblasSasum/g; - $ft{'library'} += s/\bcublasSasum_v2\b/hipblasSasum/g; - $ft{'library'} += s/\bcublasSaxpy\b/hipblasSaxpy/g; - $ft{'library'} += s/\bcublasSaxpy_v2\b/hipblasSaxpy/g; - $ft{'library'} += s/\bcublasScasum\b/hipblasScasum/g; - $ft{'library'} += s/\bcublasScasum_v2\b/hipblasScasum/g; - $ft{'library'} += s/\bcublasScnrm2\b/hipblasScnrm2/g; - $ft{'library'} += s/\bcublasScnrm2_v2\b/hipblasScnrm2/g; - $ft{'library'} += s/\bcublasScopy\b/hipblasScopy/g; - $ft{'library'} += s/\bcublasScopy_v2\b/hipblasScopy/g; - $ft{'library'} += s/\bcublasSdot\b/hipblasSdot/g; - $ft{'library'} += s/\bcublasSdot_v2\b/hipblasSdot/g; - $ft{'library'} += s/\bcublasSetMatrix\b/hipblasSetMatrix/g; - $ft{'library'} += s/\bcublasSetPointerMode\b/hipblasSetPointerMode/g; - $ft{'library'} += s/\bcublasSetPointerMode_v2\b/hipblasSetPointerMode/g; - $ft{'library'} += s/\bcublasSetStream\b/hipblasSetStream/g; - $ft{'library'} += s/\bcublasSetStream_v2\b/hipblasSetStream/g; - $ft{'library'} += s/\bcublasSetVector\b/hipblasSetVector/g; - $ft{'library'} += s/\bcublasSgeam\b/hipblasSgeam/g; - $ft{'library'} += s/\bcublasSgemm\b/hipblasSgemm/g; - $ft{'library'} += s/\bcublasSgemmBatched\b/hipblasSgemmBatched/g; - $ft{'library'} += s/\bcublasSgemmStridedBatched\b/hipblasSgemmStridedBatched/g; - $ft{'library'} += s/\bcublasSgemm_v2\b/hipblasSgemm/g; - $ft{'library'} += s/\bcublasSgemv\b/hipblasSgemv/g; - $ft{'library'} += s/\bcublasSgemvBatched\b/hipblasSgemvBatched/g; - $ft{'library'} += s/\bcublasSgemv_v2\b/hipblasSgemv/g; - $ft{'library'} += s/\bcublasSger\b/hipblasSger/g; - $ft{'library'} += s/\bcublasSger_v2\b/hipblasSger/g; - $ft{'library'} += s/\bcublasSnrm2\b/hipblasSnrm2/g; - $ft{'library'} += s/\bcublasSnrm2_v2\b/hipblasSnrm2/g; - $ft{'library'} += s/\bcublasSrot\b/hipblasSrot/g; - $ft{'library'} += s/\bcublasSrot_v2\b/hipblasSrot/g; - $ft{'library'} += s/\bcublasSrotg\b/hipblasSrotg/g; - $ft{'library'} += s/\bcublasSrotg_v2\b/hipblasSrotg/g; - $ft{'library'} += s/\bcublasSrotm\b/hipblasSrotm/g; - $ft{'library'} += s/\bcublasSrotm_v2\b/hipblasSrotm/g; - $ft{'library'} += s/\bcublasSrotmg\b/hipblasSrotmg/g; - $ft{'library'} += s/\bcublasSrotmg_v2\b/hipblasSrotmg/g; - $ft{'library'} += s/\bcublasSscal\b/hipblasSscal/g; - $ft{'library'} += s/\bcublasSscal_v2\b/hipblasSscal/g; - $ft{'library'} += s/\bcublasSswap\b/hipblasSswap/g; - $ft{'library'} += s/\bcublasSswap_v2\b/hipblasSswap/g; - $ft{'library'} += s/\bcublasSsyr\b/hipblasSsyr/g; - $ft{'library'} += s/\bcublasSsyr_v2\b/hipblasSsyr/g; - $ft{'library'} += s/\bcublasStrsm\b/hipblasStrsm/g; - $ft{'library'} += s/\bcublasStrsm_v2\b/hipblasStrsm/g; - $ft{'library'} += s/\bcublasStrsv\b/hipblasStrsv/g; - $ft{'library'} += s/\bcublasStrsv_v2\b/hipblasStrsv/g; - $ft{'library'} += s/\bcublasZaxpy\b/hipblasZaxpy/g; - $ft{'library'} += s/\bcublasZaxpy_v2\b/hipblasZaxpy/g; - $ft{'library'} += s/\bcublasZcopy\b/hipblasZcopy/g; - $ft{'library'} += s/\bcublasZcopy_v2\b/hipblasZcopy/g; - $ft{'library'} += s/\bcublasZdotc\b/hipblasZdotc/g; - $ft{'library'} += s/\bcublasZdotc_v2\b/hipblasZdotc/g; - $ft{'library'} += s/\bcublasZdotu\b/hipblasZdotu/g; - $ft{'library'} += s/\bcublasZdotu_v2\b/hipblasZdotu/g; - $ft{'library'} += s/\bcublasZdrot\b/hipblasZdrot/g; - $ft{'library'} += s/\bcublasZdrot_v2\b/hipblasZdrot/g; - $ft{'library'} += s/\bcublasZdscal\b/hipblasZdscal/g; - $ft{'library'} += s/\bcublasZdscal_v2\b/hipblasZdscal/g; - $ft{'library'} += s/\bcublasZgemm\b/hipblasZgemm/g; - $ft{'library'} += s/\bcublasZgemmBatched\b/hipblasZgemmBatched/g; - $ft{'library'} += s/\bcublasZgemmStridedBatched\b/hipblasZgemmStridedBatched/g; - $ft{'library'} += s/\bcublasZgemm_v2\b/hipblasZgemm/g; - $ft{'library'} += s/\bcublasZgemv\b/hipblasZgemv/g; - $ft{'library'} += s/\bcublasZgemv_v2\b/hipblasZgemv/g; - $ft{'library'} += s/\bcublasZrot\b/hipblasZrot/g; - $ft{'library'} += s/\bcublasZrot_v2\b/hipblasZrot/g; - $ft{'library'} += s/\bcublasZrotg\b/hipblasZrotg/g; - $ft{'library'} += s/\bcublasZrotg_v2\b/hipblasZrotg/g; - $ft{'library'} += s/\bcublasZscal\b/hipblasZscal/g; - $ft{'library'} += s/\bcublasZscal_v2\b/hipblasZscal/g; - $ft{'library'} += s/\bcublasZswap\b/hipblasZswap/g; - $ft{'library'} += s/\bcublasZswap_v2\b/hipblasZswap/g; - $ft{'library'} += s/\bcuda_stream\b/hip_stream/g; - $ft{'library'} += s/\bcudnnActivationBackward\b/hipdnnActivationBackward/g; - $ft{'library'} += s/\bcudnnActivationForward\b/hipdnnActivationForward/g; - $ft{'library'} += s/\bcudnnAddTensor\b/hipdnnAddTensor/g; - $ft{'library'} += s/\bcudnnBatchNormalizationBackward\b/hipdnnBatchNormalizationBackward/g; - $ft{'library'} += s/\bcudnnBatchNormalizationForwardInference\b/hipdnnBatchNormalizationForwardInference/g; - $ft{'library'} += s/\bcudnnBatchNormalizationForwardTraining\b/hipdnnBatchNormalizationForwardTraining/g; - $ft{'library'} += s/\bcudnnConvolutionBackwardBias\b/hipdnnConvolutionBackwardBias/g; - $ft{'library'} += s/\bcudnnConvolutionBackwardData\b/hipdnnConvolutionBackwardData/g; - $ft{'library'} += s/\bcudnnConvolutionBackwardFilter\b/hipdnnConvolutionBackwardFilter/g; - $ft{'library'} += s/\bcudnnConvolutionForward\b/hipdnnConvolutionForward/g; - $ft{'library'} += s/\bcudnnCreate\b/hipdnnCreate/g; - $ft{'library'} += s/\bcudnnCreateActivationDescriptor\b/hipdnnCreateActivationDescriptor/g; - $ft{'library'} += s/\bcudnnCreateConvolutionDescriptor\b/hipdnnCreateConvolutionDescriptor/g; - $ft{'library'} += s/\bcudnnCreateDropoutDescriptor\b/hipdnnCreateDropoutDescriptor/g; - $ft{'library'} += s/\bcudnnCreateFilterDescriptor\b/hipdnnCreateFilterDescriptor/g; - $ft{'library'} += s/\bcudnnCreateLRNDescriptor\b/hipdnnCreateLRNDescriptor/g; - $ft{'library'} += s/\bcudnnCreateOpTensorDescriptor\b/hipdnnCreateOpTensorDescriptor/g; - $ft{'library'} += s/\bcudnnCreatePersistentRNNPlan\b/hipdnnCreatePersistentRNNPlan/g; - $ft{'library'} += s/\bcudnnCreatePoolingDescriptor\b/hipdnnCreatePoolingDescriptor/g; - $ft{'library'} += s/\bcudnnCreateRNNDescriptor\b/hipdnnCreateRNNDescriptor/g; - $ft{'library'} += s/\bcudnnCreateReduceTensorDescriptor\b/hipdnnCreateReduceTensorDescriptor/g; - $ft{'library'} += s/\bcudnnCreateTensorDescriptor\b/hipdnnCreateTensorDescriptor/g; - $ft{'library'} += s/\bcudnnDeriveBNTensorDescriptor\b/hipdnnDeriveBNTensorDescriptor/g; - $ft{'library'} += s/\bcudnnDestroy\b/hipdnnDestroy/g; - $ft{'library'} += s/\bcudnnDestroyActivationDescriptor\b/hipdnnDestroyActivationDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyConvolutionDescriptor\b/hipdnnDestroyConvolutionDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyDropoutDescriptor\b/hipdnnDestroyDropoutDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyFilterDescriptor\b/hipdnnDestroyFilterDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyLRNDescriptor\b/hipdnnDestroyLRNDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyOpTensorDescriptor\b/hipdnnDestroyOpTensorDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyPersistentRNNPlan\b/hipdnnDestroyPersistentRNNPlan/g; - $ft{'library'} += s/\bcudnnDestroyPoolingDescriptor\b/hipdnnDestroyPoolingDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyRNNDescriptor\b/hipdnnDestroyRNNDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyReduceTensorDescriptor\b/hipdnnDestroyReduceTensorDescriptor/g; - $ft{'library'} += s/\bcudnnDestroyTensorDescriptor\b/hipdnnDestroyTensorDescriptor/g; - $ft{'library'} += s/\bcudnnDropoutGetStatesSize\b/hipdnnDropoutGetStatesSize/g; - $ft{'library'} += s/\bcudnnFindConvolutionBackwardDataAlgorithm\b/hipdnnFindConvolutionBackwardDataAlgorithm/g; - $ft{'library'} += s/\bcudnnFindConvolutionBackwardDataAlgorithmEx\b/hipdnnFindConvolutionBackwardDataAlgorithmEx/g; - $ft{'library'} += s/\bcudnnFindConvolutionBackwardFilterAlgorithm\b/hipdnnFindConvolutionBackwardFilterAlgorithm/g; - $ft{'library'} += s/\bcudnnFindConvolutionBackwardFilterAlgorithmEx\b/hipdnnFindConvolutionBackwardFilterAlgorithmEx/g; - $ft{'library'} += s/\bcudnnFindConvolutionForwardAlgorithm\b/hipdnnFindConvolutionForwardAlgorithm/g; - $ft{'library'} += s/\bcudnnFindConvolutionForwardAlgorithmEx\b/hipdnnFindConvolutionForwardAlgorithmEx/g; - $ft{'library'} += s/\bcudnnGetActivationDescriptor\b/hipdnnGetActivationDescriptor/g; - $ft{'library'} += s/\bcudnnGetConvolution2dDescriptor\b/hipdnnGetConvolution2dDescriptor/g; - $ft{'library'} += s/\bcudnnGetConvolution2dForwardOutputDim\b/hipdnnGetConvolution2dForwardOutputDim/g; - $ft{'library'} += s/\bcudnnGetConvolutionBackwardDataAlgorithm\b/hipdnnGetConvolutionBackwardDataAlgorithm/g; - $ft{'library'} += s/\bcudnnGetConvolutionBackwardDataWorkspaceSize\b/hipdnnGetConvolutionBackwardDataWorkspaceSize/g; - $ft{'library'} += s/\bcudnnGetConvolutionBackwardFilterAlgorithm\b/hipdnnGetConvolutionBackwardFilterAlgorithm/g; - $ft{'library'} += s/\bcudnnGetConvolutionBackwardFilterWorkspaceSize\b/hipdnnGetConvolutionBackwardFilterWorkspaceSize/g; - $ft{'library'} += s/\bcudnnGetConvolutionForwardAlgorithm\b/hipdnnGetConvolutionForwardAlgorithm/g; - $ft{'library'} += s/\bcudnnGetConvolutionForwardWorkspaceSize\b/hipdnnGetConvolutionForwardWorkspaceSize/g; - $ft{'library'} += s/\bcudnnGetErrorString\b/hipdnnGetErrorString/g; - $ft{'library'} += s/\bcudnnGetFilter4dDescriptor\b/hipdnnGetFilter4dDescriptor/g; - $ft{'library'} += s/\bcudnnGetFilterNdDescriptor\b/hipdnnGetFilterNdDescriptor/g; - $ft{'library'} += s/\bcudnnGetLRNDescriptor\b/hipdnnGetLRNDescriptor/g; - $ft{'library'} += s/\bcudnnGetOpTensorDescriptor\b/hipdnnGetOpTensorDescriptor/g; - $ft{'library'} += s/\bcudnnGetPooling2dDescriptor\b/hipdnnGetPooling2dDescriptor/g; - $ft{'library'} += s/\bcudnnGetPooling2dForwardOutputDim\b/hipdnnGetPooling2dForwardOutputDim/g; - $ft{'library'} += s/\bcudnnGetRNNDescriptor\b/hipdnnGetRNNDescriptor/g; - $ft{'library'} += s/\bcudnnGetRNNLinLayerBiasParams\b/hipdnnGetRNNLinLayerBiasParams/g; - $ft{'library'} += s/\bcudnnGetRNNLinLayerMatrixParams\b/hipdnnGetRNNLinLayerMatrixParams/g; - $ft{'library'} += s/\bcudnnGetRNNParamsSize\b/hipdnnGetRNNParamsSize/g; - $ft{'library'} += s/\bcudnnGetRNNTrainingReserveSize\b/hipdnnGetRNNTrainingReserveSize/g; - $ft{'library'} += s/\bcudnnGetRNNWorkspaceSize\b/hipdnnGetRNNWorkspaceSize/g; - $ft{'library'} += s/\bcudnnGetReduceTensorDescriptor\b/hipdnnGetReduceTensorDescriptor/g; - $ft{'library'} += s/\bcudnnGetReductionWorkspaceSize\b/hipdnnGetReductionWorkspaceSize/g; - $ft{'library'} += s/\bcudnnGetStream\b/hipdnnGetStream/g; - $ft{'library'} += s/\bcudnnGetTensor4dDescriptor\b/hipdnnGetTensor4dDescriptor/g; - $ft{'library'} += s/\bcudnnGetTensorNdDescriptor\b/hipdnnGetTensorNdDescriptor/g; - $ft{'library'} += s/\bcudnnGetVersion\b/hipdnnGetVersion/g; - $ft{'library'} += s/\bcudnnLRNCrossChannelBackward\b/hipdnnLRNCrossChannelBackward/g; - $ft{'library'} += s/\bcudnnLRNCrossChannelForward\b/hipdnnLRNCrossChannelForward/g; - $ft{'library'} += s/\bcudnnOpTensor\b/hipdnnOpTensor/g; - $ft{'library'} += s/\bcudnnPoolingBackward\b/hipdnnPoolingBackward/g; - $ft{'library'} += s/\bcudnnPoolingForward\b/hipdnnPoolingForward/g; - $ft{'library'} += s/\bcudnnRNNBackwardData\b/hipdnnRNNBackwardData/g; - $ft{'library'} += s/\bcudnnRNNBackwardWeights\b/hipdnnRNNBackwardWeights/g; - $ft{'library'} += s/\bcudnnRNNForwardInference\b/hipdnnRNNForwardInference/g; - $ft{'library'} += s/\bcudnnRNNForwardTraining\b/hipdnnRNNForwardTraining/g; - $ft{'library'} += s/\bcudnnReduceTensor\b/hipdnnReduceTensor/g; - $ft{'library'} += s/\bcudnnScaleTensor\b/hipdnnScaleTensor/g; - $ft{'library'} += s/\bcudnnSetActivationDescriptor\b/hipdnnSetActivationDescriptor/g; - $ft{'library'} += s/\bcudnnSetConvolution2dDescriptor\b/hipdnnSetConvolution2dDescriptor/g; - $ft{'library'} += s/\bcudnnSetConvolutionGroupCount\b/hipdnnSetConvolutionGroupCount/g; - $ft{'library'} += s/\bcudnnSetConvolutionMathType\b/hipdnnSetConvolutionMathType/g; - $ft{'library'} += s/\bcudnnSetConvolutionNdDescriptor\b/hipdnnSetConvolutionNdDescriptor/g; - $ft{'library'} += s/\bcudnnSetDropoutDescriptor\b/hipdnnSetDropoutDescriptor/g; - $ft{'library'} += s/\bcudnnSetFilter4dDescriptor\b/hipdnnSetFilter4dDescriptor/g; - $ft{'library'} += s/\bcudnnSetFilterNdDescriptor\b/hipdnnSetFilterNdDescriptor/g; - $ft{'library'} += s/\bcudnnSetLRNDescriptor\b/hipdnnSetLRNDescriptor/g; - $ft{'library'} += s/\bcudnnSetOpTensorDescriptor\b/hipdnnSetOpTensorDescriptor/g; - $ft{'library'} += s/\bcudnnSetPersistentRNNPlan\b/hipdnnSetPersistentRNNPlan/g; - $ft{'library'} += s/\bcudnnSetPooling2dDescriptor\b/hipdnnSetPooling2dDescriptor/g; - $ft{'library'} += s/\bcudnnSetPoolingNdDescriptor\b/hipdnnSetPoolingNdDescriptor/g; - $ft{'library'} += s/\bcudnnSetRNNDescriptor\b/hipdnnSetRNNDescriptor/g; - $ft{'library'} += s/\bcudnnSetRNNDescriptor_v5\b/hipdnnSetRNNDescriptor_v5/g; - $ft{'library'} += s/\bcudnnSetRNNDescriptor_v6\b/hipdnnSetRNNDescriptor_v6/g; - $ft{'library'} += s/\bcudnnSetReduceTensorDescriptor\b/hipdnnSetReduceTensorDescriptor/g; - $ft{'library'} += s/\bcudnnSetStream\b/hipdnnSetStream/g; - $ft{'library'} += s/\bcudnnSetTensor\b/hipdnnSetTensor/g; - $ft{'library'} += s/\bcudnnSetTensor4dDescriptor\b/hipdnnSetTensor4dDescriptor/g; - $ft{'library'} += s/\bcudnnSetTensor4dDescriptorEx\b/hipdnnSetTensor4dDescriptorEx/g; - $ft{'library'} += s/\bcudnnSetTensorNdDescriptor\b/hipdnnSetTensorNdDescriptor/g; - $ft{'library'} += s/\bcudnnSoftmaxBackward\b/hipdnnSoftmaxBackward/g; - $ft{'library'} += s/\bcudnnSoftmaxForward\b/hipdnnSoftmaxForward/g; - $ft{'library'} += s/\bcufftCreate\b/hipfftCreate/g; - $ft{'library'} += s/\bcufftDestroy\b/hipfftDestroy/g; - $ft{'library'} += s/\bcufftEstimate1d\b/hipfftEstimate1d/g; - $ft{'library'} += s/\bcufftEstimate2d\b/hipfftEstimate2d/g; - $ft{'library'} += s/\bcufftEstimate3d\b/hipfftEstimate3d/g; - $ft{'library'} += s/\bcufftEstimateMany\b/hipfftEstimateMany/g; - $ft{'library'} += s/\bcufftExecC2C\b/hipfftExecC2C/g; - $ft{'library'} += s/\bcufftExecC2R\b/hipfftExecC2R/g; - $ft{'library'} += s/\bcufftExecD2Z\b/hipfftExecD2Z/g; - $ft{'library'} += s/\bcufftExecR2C\b/hipfftExecR2C/g; - $ft{'library'} += s/\bcufftExecZ2D\b/hipfftExecZ2D/g; - $ft{'library'} += s/\bcufftExecZ2Z\b/hipfftExecZ2Z/g; - $ft{'library'} += s/\bcufftGetSize\b/hipfftGetSize/g; - $ft{'library'} += s/\bcufftGetSize1d\b/hipfftGetSize1d/g; - $ft{'library'} += s/\bcufftGetSize2d\b/hipfftGetSize2d/g; - $ft{'library'} += s/\bcufftGetSize3d\b/hipfftGetSize3d/g; - $ft{'library'} += s/\bcufftGetSizeMany\b/hipfftGetSizeMany/g; - $ft{'library'} += s/\bcufftGetSizeMany64\b/hipfftGetSizeMany64/g; - $ft{'library'} += s/\bcufftGetVersion\b/hipfftGetVersion/g; - $ft{'library'} += s/\bcufftMakePlan1d\b/hipfftMakePlan1d/g; - $ft{'library'} += s/\bcufftMakePlan2d\b/hipfftMakePlan2d/g; - $ft{'library'} += s/\bcufftMakePlan3d\b/hipfftMakePlan3d/g; - $ft{'library'} += s/\bcufftMakePlanMany\b/hipfftMakePlanMany/g; - $ft{'library'} += s/\bcufftMakePlanMany64\b/hipfftMakePlanMany64/g; - $ft{'library'} += s/\bcufftPlan1d\b/hipfftPlan1d/g; - $ft{'library'} += s/\bcufftPlan2d\b/hipfftPlan2d/g; - $ft{'library'} += s/\bcufftPlan3d\b/hipfftPlan3d/g; - $ft{'library'} += s/\bcufftPlanMany\b/hipfftPlanMany/g; - $ft{'library'} += s/\bcufftSetAutoAllocation\b/hipfftSetAutoAllocation/g; - $ft{'library'} += s/\bcufftSetStream\b/hipfftSetStream/g; - $ft{'library'} += s/\bcufftSetWorkArea\b/hipfftSetWorkArea/g; - $ft{'library'} += s/\bcurandCreateGenerator\b/hiprandCreateGenerator/g; - $ft{'library'} += s/\bcurandCreateGeneratorHost\b/hiprandCreateGeneratorHost/g; - $ft{'library'} += s/\bcurandCreatePoissonDistribution\b/hiprandCreatePoissonDistribution/g; - $ft{'library'} += s/\bcurandDestroyDistribution\b/hiprandDestroyDistribution/g; - $ft{'library'} += s/\bcurandDestroyGenerator\b/hiprandDestroyGenerator/g; - $ft{'library'} += s/\bcurandGenerate\b/hiprandGenerate/g; - $ft{'library'} += s/\bcurandGenerateLogNormal\b/hiprandGenerateLogNormal/g; - $ft{'library'} += s/\bcurandGenerateLogNormalDouble\b/hiprandGenerateLogNormalDouble/g; - $ft{'library'} += s/\bcurandGenerateNormal\b/hiprandGenerateNormal/g; - $ft{'library'} += s/\bcurandGenerateNormalDouble\b/hiprandGenerateNormalDouble/g; - $ft{'library'} += s/\bcurandGeneratePoisson\b/hiprandGeneratePoisson/g; - $ft{'library'} += s/\bcurandGenerateSeeds\b/hiprandGenerateSeeds/g; - $ft{'library'} += s/\bcurandGenerateUniform\b/hiprandGenerateUniform/g; - $ft{'library'} += s/\bcurandGenerateUniformDouble\b/hiprandGenerateUniformDouble/g; - $ft{'library'} += s/\bcurandGetVersion\b/hiprandGetVersion/g; - $ft{'library'} += s/\bcurandMakeMTGP32Constants\b/hiprandMakeMTGP32Constants/g; - $ft{'library'} += s/\bcurandMakeMTGP32KernelState\b/hiprandMakeMTGP32KernelState/g; - $ft{'library'} += s/\bcurandSetGeneratorOffset\b/hiprandSetGeneratorOffset/g; - $ft{'library'} += s/\bcurandSetPseudoRandomGeneratorSeed\b/hiprandSetPseudoRandomGeneratorSeed/g; - $ft{'library'} += s/\bcurandSetQuasiRandomGeneratorDimensions\b/hiprandSetQuasiRandomGeneratorDimensions/g; - $ft{'library'} += s/\bcurandSetStream\b/hiprandSetStream/g; - $ft{'library'} += s/\bcusparseCaxpyi\b/hipsparseCaxpyi/g; - $ft{'library'} += s/\bcusparseCbsrmv\b/hipsparseCbsrmv/g; - $ft{'library'} += s/\bcusparseCcsr2csc\b/hipsparseCcsr2csc/g; - $ft{'library'} += s/\bcusparseCcsr2hyb\b/hipsparseCcsr2hyb/g; - $ft{'library'} += s/\bcusparseCcsrgeam\b/hipsparseCcsrgeam/g; - $ft{'library'} += s/\bcusparseCcsrgeam2\b/hipsparseCcsrgeam2/g; - $ft{'library'} += s/\bcusparseCcsrgeam2_bufferSizeExt\b/hipsparseCcsrgeam2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseCcsrgemm\b/hipsparseCcsrgemm/g; - $ft{'library'} += s/\bcusparseCcsrgemm2\b/hipsparseCcsrgemm2/g; - $ft{'library'} += s/\bcusparseCcsrgemm2_bufferSizeExt\b/hipsparseCcsrgemm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseCcsrilu02\b/hipsparseCcsrilu02/g; - $ft{'library'} += s/\bcusparseCcsrilu02_analysis\b/hipsparseCcsrilu02_analysis/g; - $ft{'library'} += s/\bcusparseCcsrilu02_bufferSize\b/hipsparseCcsrilu02_bufferSize/g; - $ft{'library'} += s/\bcusparseCcsrilu02_bufferSizeExt\b/hipsparseCcsrilu02_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseCcsrmm\b/hipsparseCcsrmm/g; - $ft{'library'} += s/\bcusparseCcsrmm2\b/hipsparseCcsrmm2/g; - $ft{'library'} += s/\bcusparseCcsrmv\b/hipsparseCcsrmv/g; - $ft{'library'} += s/\bcusparseCcsrsm2_analysis\b/hipsparseCcsrsm2_analysis/g; - $ft{'library'} += s/\bcusparseCcsrsm2_bufferSizeExt\b/hipsparseCcsrsm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseCcsrsm_solve\b/hipsparseCcsrsm_solve/g; - $ft{'library'} += s/\bcusparseCcsrsv2_analysis\b/hipsparseCcsrsv2_analysis/g; - $ft{'library'} += s/\bcusparseCcsrsv2_bufferSize\b/hipsparseCcsrsv2_bufferSize/g; - $ft{'library'} += s/\bcusparseCcsrsv2_bufferSizeExt\b/hipsparseCcsrsv2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseCcsrsv2_solve\b/hipsparseCcsrsv2_solve/g; - $ft{'library'} += s/\bcusparseCdotci\b/hipsparseCdotci/g; - $ft{'library'} += s/\bcusparseCdoti\b/hipsparseCdoti/g; - $ft{'library'} += s/\bcusparseCgthr\b/hipsparseCgthr/g; - $ft{'library'} += s/\bcusparseCgthrz\b/hipsparseCgthrz/g; - $ft{'library'} += s/\bcusparseChybmv\b/hipsparseChybmv/g; - $ft{'library'} += s/\bcusparseCnnz\b/hipsparseCnnz/g; - $ft{'library'} += s/\bcusparseCnnz_compress\b/hipsparseCnnz_compress/g; - $ft{'library'} += s/\bcusparseCreate\b/hipsparseCreate/g; - $ft{'library'} += s/\bcusparseCreateCsrgemm2Info\b/hipsparseCreateCsrgemm2Info/g; - $ft{'library'} += s/\bcusparseCreateCsrilu02Info\b/hipsparseCreateCsrilu02Info/g; - $ft{'library'} += s/\bcusparseCreateCsrsm2Info\b/hipsparseCreateCsrsm2Info/g; - $ft{'library'} += s/\bcusparseCreateCsrsv2Info\b/hipsparseCreateCsrsv2Info/g; - $ft{'library'} += s/\bcusparseCreateHybMat\b/hipsparseCreateHybMat/g; - $ft{'library'} += s/\bcusparseCreateIdentityPermutation\b/hipsparseCreateIdentityPermutation/g; - $ft{'library'} += s/\bcusparseCreateMatDescr\b/hipsparseCreateMatDescr/g; - $ft{'library'} += s/\bcusparseCsctr\b/hipsparseCsctr/g; - $ft{'library'} += s/\bcusparseDaxpyi\b/hipsparseDaxpyi/g; - $ft{'library'} += s/\bcusparseDbsrmv\b/hipsparseDbsrmv/g; - $ft{'library'} += s/\bcusparseDcsr2csc\b/hipsparseDcsr2csc/g; - $ft{'library'} += s/\bcusparseDcsr2hyb\b/hipsparseDcsr2hyb/g; - $ft{'library'} += s/\bcusparseDcsrgeam\b/hipsparseDcsrgeam/g; - $ft{'library'} += s/\bcusparseDcsrgeam2\b/hipsparseDcsrgeam2/g; - $ft{'library'} += s/\bcusparseDcsrgeam2_bufferSizeExt\b/hipsparseDcsrgeam2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseDcsrgemm\b/hipsparseDcsrgemm/g; - $ft{'library'} += s/\bcusparseDcsrgemm2\b/hipsparseDcsrgemm2/g; - $ft{'library'} += s/\bcusparseDcsrgemm2_bufferSizeExt\b/hipsparseDcsrgemm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseDcsrilu02\b/hipsparseDcsrilu02/g; - $ft{'library'} += s/\bcusparseDcsrilu02_analysis\b/hipsparseDcsrilu02_analysis/g; - $ft{'library'} += s/\bcusparseDcsrilu02_bufferSize\b/hipsparseDcsrilu02_bufferSize/g; - $ft{'library'} += s/\bcusparseDcsrilu02_bufferSizeExt\b/hipsparseDcsrilu02_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseDcsrmm\b/hipsparseDcsrmm/g; - $ft{'library'} += s/\bcusparseDcsrmm2\b/hipsparseDcsrmm2/g; - $ft{'library'} += s/\bcusparseDcsrmv\b/hipsparseDcsrmv/g; - $ft{'library'} += s/\bcusparseDcsrsm2_analysis\b/hipsparseDcsrsm2_analysis/g; - $ft{'library'} += s/\bcusparseDcsrsm2_bufferSizeExt\b/hipsparseDcsrsm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseDcsrsm_solve\b/hipsparseDcsrsm_solve/g; - $ft{'library'} += s/\bcusparseDcsrsv2_analysis\b/hipsparseDcsrsv2_analysis/g; - $ft{'library'} += s/\bcusparseDcsrsv2_bufferSize\b/hipsparseDcsrsv2_bufferSize/g; - $ft{'library'} += s/\bcusparseDcsrsv2_bufferSizeExt\b/hipsparseDcsrsv2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseDcsrsv2_solve\b/hipsparseDcsrsv2_solve/g; - $ft{'library'} += s/\bcusparseDdoti\b/hipsparseDdoti/g; - $ft{'library'} += s/\bcusparseDestroy\b/hipsparseDestroy/g; - $ft{'library'} += s/\bcusparseDestroyCsrgemm2Info\b/hipsparseDestroyCsrgemm2Info/g; - $ft{'library'} += s/\bcusparseDestroyCsrilu02Info\b/hipsparseDestroyCsrilu02Info/g; - $ft{'library'} += s/\bcusparseDestroyCsrsm2Info\b/hipsparseDestroyCsrsm2Info/g; - $ft{'library'} += s/\bcusparseDestroyCsrsv2Info\b/hipsparseDestroyCsrsv2Info/g; - $ft{'library'} += s/\bcusparseDestroyHybMat\b/hipsparseDestroyHybMat/g; - $ft{'library'} += s/\bcusparseDestroyMatDescr\b/hipsparseDestroyMatDescr/g; - $ft{'library'} += s/\bcusparseDgthr\b/hipsparseDgthr/g; - $ft{'library'} += s/\bcusparseDgthrz\b/hipsparseDgthrz/g; - $ft{'library'} += s/\bcusparseDhybmv\b/hipsparseDhybmv/g; - $ft{'library'} += s/\bcusparseDnnz\b/hipsparseDnnz/g; - $ft{'library'} += s/\bcusparseDnnz_compress\b/hipsparseDnnz_compress/g; - $ft{'library'} += s/\bcusparseDroti\b/hipsparseDroti/g; - $ft{'library'} += s/\bcusparseDsctr\b/hipsparseDsctr/g; - $ft{'library'} += s/\bcusparseGetMatDiagType\b/hipsparseGetMatDiagType/g; - $ft{'library'} += s/\bcusparseGetMatFillMode\b/hipsparseGetMatFillMode/g; - $ft{'library'} += s/\bcusparseGetMatIndexBase\b/hipsparseGetMatIndexBase/g; - $ft{'library'} += s/\bcusparseGetMatType\b/hipsparseGetMatType/g; - $ft{'library'} += s/\bcusparseGetPointerMode\b/hipsparseGetPointerMode/g; - $ft{'library'} += s/\bcusparseGetStream\b/hipsparseGetStream/g; - $ft{'library'} += s/\bcusparseGetVersion\b/hipsparseGetVersion/g; - $ft{'library'} += s/\bcusparseSaxpyi\b/hipsparseSaxpyi/g; - $ft{'library'} += s/\bcusparseSbsrmv\b/hipsparseSbsrmv/g; - $ft{'library'} += s/\bcusparseScsr2csc\b/hipsparseScsr2csc/g; - $ft{'library'} += s/\bcusparseScsr2hyb\b/hipsparseScsr2hyb/g; - $ft{'library'} += s/\bcusparseScsrgeam\b/hipsparseScsrgeam/g; - $ft{'library'} += s/\bcusparseScsrgeam2\b/hipsparseScsrgeam2/g; - $ft{'library'} += s/\bcusparseScsrgeam2_bufferSizeExt\b/hipsparseScsrgeam2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseScsrgemm\b/hipsparseScsrgemm/g; - $ft{'library'} += s/\bcusparseScsrgemm2\b/hipsparseScsrgemm2/g; - $ft{'library'} += s/\bcusparseScsrgemm2_bufferSizeExt\b/hipsparseScsrgemm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseScsrilu02\b/hipsparseScsrilu02/g; - $ft{'library'} += s/\bcusparseScsrilu02_analysis\b/hipsparseScsrilu02_analysis/g; - $ft{'library'} += s/\bcusparseScsrilu02_bufferSize\b/hipsparseScsrilu02_bufferSize/g; - $ft{'library'} += s/\bcusparseScsrilu02_bufferSizeExt\b/hipsparseScsrilu02_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseScsrmm\b/hipsparseScsrmm/g; - $ft{'library'} += s/\bcusparseScsrmm2\b/hipsparseScsrmm2/g; - $ft{'library'} += s/\bcusparseScsrmv\b/hipsparseScsrmv/g; - $ft{'library'} += s/\bcusparseScsrsm2_analysis\b/hipsparseScsrsm2_analysis/g; - $ft{'library'} += s/\bcusparseScsrsm2_bufferSizeExt\b/hipsparseScsrsm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseScsrsm_solve\b/hipsparseScsrsm_solve/g; - $ft{'library'} += s/\bcusparseScsrsv2_analysis\b/hipsparseScsrsv2_analysis/g; - $ft{'library'} += s/\bcusparseScsrsv2_bufferSize\b/hipsparseScsrsv2_bufferSize/g; - $ft{'library'} += s/\bcusparseScsrsv2_bufferSizeExt\b/hipsparseScsrsv2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseScsrsv2_solve\b/hipsparseScsrsv2_solve/g; - $ft{'library'} += s/\bcusparseSdoti\b/hipsparseSdoti/g; - $ft{'library'} += s/\bcusparseSetMatDiagType\b/hipsparseSetMatDiagType/g; - $ft{'library'} += s/\bcusparseSetMatFillMode\b/hipsparseSetMatFillMode/g; - $ft{'library'} += s/\bcusparseSetMatIndexBase\b/hipsparseSetMatIndexBase/g; - $ft{'library'} += s/\bcusparseSetMatType\b/hipsparseSetMatType/g; - $ft{'library'} += s/\bcusparseSetPointerMode\b/hipsparseSetPointerMode/g; - $ft{'library'} += s/\bcusparseSetStream\b/hipsparseSetStream/g; - $ft{'library'} += s/\bcusparseSgthr\b/hipsparseSgthr/g; - $ft{'library'} += s/\bcusparseSgthrz\b/hipsparseSgthrz/g; - $ft{'library'} += s/\bcusparseShybmv\b/hipsparseShybmv/g; - $ft{'library'} += s/\bcusparseSnnz\b/hipsparseSnnz/g; - $ft{'library'} += s/\bcusparseSnnz_compress\b/hipsparseSnnz_compress/g; - $ft{'library'} += s/\bcusparseSroti\b/hipsparseSroti/g; - $ft{'library'} += s/\bcusparseSsctr\b/hipsparseSsctr/g; - $ft{'library'} += s/\bcusparseXbsrilu02_zeroPivot\b/hipsparseXbsrilu02_zeroPivot/g; - $ft{'library'} += s/\bcusparseXcoo2csr\b/hipsparseXcoo2csr/g; - $ft{'library'} += s/\bcusparseXcoosortByColumn\b/hipsparseXcoosortByColumn/g; - $ft{'library'} += s/\bcusparseXcoosortByRow\b/hipsparseXcoosortByRow/g; - $ft{'library'} += s/\bcusparseXcoosort_bufferSizeExt\b/hipsparseXcoosort_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseXcscsort\b/hipsparseXcscsort/g; - $ft{'library'} += s/\bcusparseXcscsort_bufferSizeExt\b/hipsparseXcscsort_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseXcsr2coo\b/hipsparseXcsr2coo/g; - $ft{'library'} += s/\bcusparseXcsrgeam2Nnz\b/hipsparseXcsrgeam2Nnz/g; - $ft{'library'} += s/\bcusparseXcsrgeamNnz\b/hipsparseXcsrgeamNnz/g; - $ft{'library'} += s/\bcusparseXcsrgemm2Nnz\b/hipsparseXcsrgemm2Nnz/g; - $ft{'library'} += s/\bcusparseXcsrgemmNnz\b/hipsparseXcsrgemmNnz/g; - $ft{'library'} += s/\bcusparseXcsrilu02_zeroPivot\b/hipsparseXcsrilu02_zeroPivot/g; - $ft{'library'} += s/\bcusparseXcsrsm2_zeroPivot\b/hipsparseXcsrsm2_zeroPivot/g; - $ft{'library'} += s/\bcusparseXcsrsort\b/hipsparseXcsrsort/g; - $ft{'library'} += s/\bcusparseXcsrsort_bufferSizeExt\b/hipsparseXcsrsort_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseXcsrsv2_zeroPivot\b/hipsparseXcsrsv2_zeroPivot/g; - $ft{'library'} += s/\bcusparseZaxpyi\b/hipsparseZaxpyi/g; - $ft{'library'} += s/\bcusparseZbsrmv\b/hipsparseZbsrmv/g; - $ft{'library'} += s/\bcusparseZcsr2csc\b/hipsparseZcsr2csc/g; - $ft{'library'} += s/\bcusparseZcsr2hyb\b/hipsparseZcsr2hyb/g; - $ft{'library'} += s/\bcusparseZcsrgeam\b/hipsparseZcsrgeam/g; - $ft{'library'} += s/\bcusparseZcsrgeam2\b/hipsparseZcsrgeam2/g; - $ft{'library'} += s/\bcusparseZcsrgeam2_bufferSizeExt\b/hipsparseZcsrgeam2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseZcsrgemm\b/hipsparseZcsrgemm/g; - $ft{'library'} += s/\bcusparseZcsrgemm2\b/hipsparseZcsrgemm2/g; - $ft{'library'} += s/\bcusparseZcsrgemm2_bufferSizeExt\b/hipsparseZcsrgemm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseZcsrilu02\b/hipsparseZcsrilu02/g; - $ft{'library'} += s/\bcusparseZcsrilu02_analysis\b/hipsparseZcsrilu02_analysis/g; - $ft{'library'} += s/\bcusparseZcsrilu02_bufferSize\b/hipsparseZcsrilu02_bufferSize/g; - $ft{'library'} += s/\bcusparseZcsrilu02_bufferSizeExt\b/hipsparseZcsrilu02_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseZcsrmm\b/hipsparseZcsrmm/g; - $ft{'library'} += s/\bcusparseZcsrmm2\b/hipsparseZcsrmm2/g; - $ft{'library'} += s/\bcusparseZcsrmv\b/hipsparseZcsrmv/g; - $ft{'library'} += s/\bcusparseZcsrsm2_analysis\b/hipsparseZcsrsm2_analysis/g; - $ft{'library'} += s/\bcusparseZcsrsm2_bufferSizeExt\b/hipsparseZcsrsm2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseZcsrsm_solve\b/hipsparseZcsrsm_solve/g; - $ft{'library'} += s/\bcusparseZcsrsv2_analysis\b/hipsparseZcsrsv2_analysis/g; - $ft{'library'} += s/\bcusparseZcsrsv2_bufferSize\b/hipsparseZcsrsv2_bufferSize/g; - $ft{'library'} += s/\bcusparseZcsrsv2_bufferSizeExt\b/hipsparseZcsrsv2_bufferSizeExt/g; - $ft{'library'} += s/\bcusparseZcsrsv2_solve\b/hipsparseZcsrsv2_solve/g; - $ft{'library'} += s/\bcusparseZdotci\b/hipsparseZdotci/g; - $ft{'library'} += s/\bcusparseZdoti\b/hipsparseZdoti/g; - $ft{'library'} += s/\bcusparseZgthr\b/hipsparseZgthr/g; - $ft{'library'} += s/\bcusparseZgthrz\b/hipsparseZgthrz/g; - $ft{'library'} += s/\bcusparseZhybmv\b/hipsparseZhybmv/g; - $ft{'library'} += s/\bcusparseZnnz\b/hipsparseZnnz/g; - $ft{'library'} += s/\bcusparseZnnz_compress\b/hipsparseZnnz_compress/g; - $ft{'library'} += s/\bcusparseZsctr\b/hipsparseZsctr/g; - $ft{'device_library'} += s/\bcurand\b/hiprand/g; - $ft{'device_library'} += s/\bcurand_discrete\b/hiprand_discrete/g; - $ft{'device_library'} += s/\bcurand_discrete4\b/hiprand_discrete4/g; - $ft{'device_library'} += s/\bcurand_init\b/hiprand_init/g; - $ft{'device_library'} += s/\bcurand_log_normal\b/hiprand_log_normal/g; - $ft{'device_library'} += s/\bcurand_log_normal2\b/hiprand_log_normal2/g; - $ft{'device_library'} += s/\bcurand_log_normal2_double\b/hiprand_log_normal2_double/g; - $ft{'device_library'} += s/\bcurand_log_normal4\b/hiprand_log_normal4/g; - $ft{'device_library'} += s/\bcurand_log_normal4_double\b/hiprand_log_normal4_double/g; - $ft{'device_library'} += s/\bcurand_log_normal_double\b/hiprand_log_normal_double/g; - $ft{'device_library'} += s/\bcurand_normal\b/hiprand_normal/g; - $ft{'device_library'} += s/\bcurand_normal2\b/hiprand_normal2/g; - $ft{'device_library'} += s/\bcurand_normal2_double\b/hiprand_normal2_double/g; - $ft{'device_library'} += s/\bcurand_normal4\b/hiprand_normal4/g; - $ft{'device_library'} += s/\bcurand_normal4_double\b/hiprand_normal4_double/g; - $ft{'device_library'} += s/\bcurand_normal_double\b/hiprand_normal_double/g; - $ft{'device_library'} += s/\bcurand_poisson\b/hiprand_poisson/g; - $ft{'device_library'} += s/\bcurand_poisson4\b/hiprand_poisson4/g; - $ft{'device_library'} += s/\bcurand_uniform\b/hiprand_uniform/g; - $ft{'device_library'} += s/\bcurand_uniform2_double\b/hiprand_uniform2_double/g; - $ft{'device_library'} += s/\bcurand_uniform4\b/hiprand_uniform4/g; - $ft{'device_library'} += s/\bcurand_uniform4_double\b/hiprand_uniform4_double/g; - $ft{'device_library'} += s/\bcurand_uniform_double\b/hiprand_uniform_double/g; - $ft{'include'} += s/\bcaffe2\/core\/common_cudnn.h\b/caffe2\/core\/hip\/common_miopen.h/g; - $ft{'include'} += s/\bcaffe2\/operators\/spatial_batch_norm_op.h\b/caffe2\/operators\/hip\/spatial_batch_norm_op_miopen.hip/g; - $ft{'include'} += s/\bchannel_descriptor.h\b/hip\/channel_descriptor.h/g; - $ft{'include'} += s/\bcooperative_groups.h\b/hip\/hip_cooperative_groups.h/g; - $ft{'include'} += s/\bcuda_fp16.h\b/hip\/hip_fp16.h/g; - $ft{'include'} += s/\bcuda_profiler_api.h\b/hip\/hip_profile.h/g; - $ft{'include'} += s/\bcuda_runtime_api.h\b/hip\/hip_runtime_api.h/g; - $ft{'include'} += s/\bcuda_texture_types.h\b/hip\/hip_texture_types.h/g; - $ft{'include'} += s/\bcurand_discrete.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_discrete2.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_globals.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_kernel.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_lognormal.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_mrg32k3a.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_mtgp32.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_mtgp32_host.h\b/hiprand_mtgp32_host.h/g; - $ft{'include'} += s/\bcurand_mtgp32_kernel.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_mtgp32dc_p_11213.h\b/rocrand_mtgp32_11213.h/g; - $ft{'include'} += s/\bcurand_normal.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_normal_static.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_philox4x32_x.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_poisson.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_precalc.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bcurand_uniform.h\b/hiprand_kernel.h/g; - $ft{'include'} += s/\bdevice_functions.h\b/hip\/device_functions.h/g; - $ft{'include'} += s/\bdriver_types.h\b/hip\/driver_types.h/g; - $ft{'include'} += s/\btexture_fetch_functions.h\b//g; - $ft{'include'} += s/\bvector_types.h\b/hip\/hip_vector_types.h/g; - $ft{'include_cuda_main_header'} += s/\bcuComplex.h\b/hip\/hip_complex.h/g; - $ft{'include_cuda_main_header'} += s/\bcub\/cub.cuh\b/hipcub\/hipcub.hpp/g; - $ft{'include_cuda_main_header'} += s/\bcublas.h\b/hipblas.h/g; - $ft{'include_cuda_main_header'} += s/\bcublas_v2.h\b/hipblas.h/g; - $ft{'include_cuda_main_header'} += s/\bcuda.h\b/hip\/hip_runtime.h/g; - $ft{'include_cuda_main_header'} += s/\bcuda_runtime.h\b/hip\/hip_runtime.h/g; - $ft{'include_cuda_main_header'} += s/\bcudnn.h\b/hipDNN.h/g; - $ft{'include_cuda_main_header'} += s/\bcufft.h\b/hipfft.h/g; - $ft{'include_cuda_main_header'} += s/\bcurand.h\b/hiprand.h/g; - $ft{'include_cuda_main_header'} += s/\bcusparse.h\b/hipsparse.h/g; - $ft{'include_cuda_main_header'} += s/\bcusparse_v2.h\b/hipsparse.h/g; - $ft{'type'} += s/\bCUDAContext\b/HIPContext/g; - $ft{'type'} += s/\bCUDA_ARRAY3D_DESCRIPTOR\b/HIP_ARRAY3D_DESCRIPTOR/g; - $ft{'type'} += s/\bCUDA_ARRAY3D_DESCRIPTOR_st\b/HIP_ARRAY3D_DESCRIPTOR/g; - $ft{'type'} += s/\bCUDA_ARRAY_DESCRIPTOR\b/HIP_ARRAY_DESCRIPTOR/g; - $ft{'type'} += s/\bCUDA_ARRAY_DESCRIPTOR_st\b/HIP_ARRAY_DESCRIPTOR/g; - $ft{'type'} += s/\bCUDA_MEMCPY2D\b/hip_Memcpy2D/g; - $ft{'type'} += s/\bCUDA_MEMCPY2D_st\b/hip_Memcpy2D/g; - $ft{'type'} += s/\bCUDA_MEMCPY3D\b/HIP_MEMCPY3D/g; - $ft{'type'} += s/\bCUDA_MEMCPY3D_st\b/HIP_MEMCPY3D/g; - $ft{'type'} += s/\bCUaddress_mode\b/hipTextureAddressMode/g; - $ft{'type'} += s/\bCUaddress_mode_enum\b/hipTextureAddressMode/g; - $ft{'type'} += s/\bCUarray\b/hipArray */g; - $ft{'type'} += s/\bCUarray_format\b/hipArray_format/g; - $ft{'type'} += s/\bCUarray_format_enum\b/hipArray_format/g; - $ft{'type'} += s/\bCUarray_st\b/hipArray/g; - $ft{'type'} += s/\bCUcomputemode\b/hipComputeMode/g; - $ft{'type'} += s/\bCUcomputemode_enum\b/hipComputeMode/g; - $ft{'type'} += s/\bCUcontext\b/hipCtx_t/g; - $ft{'type'} += s/\bCUctx_st\b/ihipCtx_t/g; - $ft{'type'} += s/\bCUdevice\b/hipDevice_t/g; - $ft{'type'} += s/\bCUdevice_attribute\b/hipDeviceAttribute_t/g; - $ft{'type'} += s/\bCUdevice_attribute_enum\b/hipDeviceAttribute_t/g; - $ft{'type'} += s/\bCUdeviceptr\b/hipDeviceptr_t/g; - $ft{'type'} += s/\bCUevent\b/hipEvent_t/g; - $ft{'type'} += s/\bCUevent_st\b/ihipEvent_t/g; - $ft{'type'} += s/\bCUfilter_mode\b/hipTextureFilterMode/g; - $ft{'type'} += s/\bCUfilter_mode_enum\b/hipTextureFilterMode/g; - $ft{'type'} += s/\bCUfunc_cache\b/hipFuncCache_t/g; - $ft{'type'} += s/\bCUfunc_cache_enum\b/hipFuncCache_t/g; - $ft{'type'} += s/\bCUfunc_st\b/ihipModuleSymbol_t/g; - $ft{'type'} += s/\bCUfunction\b/hipFunction_t/g; - $ft{'type'} += s/\bCUfunction_attribute\b/hipFunction_attribute/g; - $ft{'type'} += s/\bCUfunction_attribute_enum\b/hipFunction_attribute/g; - $ft{'type'} += s/\bCUipcEventHandle\b/ihipIpcEventHandle_t/g; - $ft{'type'} += s/\bCUipcEventHandle_st\b/ihipIpcEventHandle_t/g; - $ft{'type'} += s/\bCUipcMemHandle\b/hipIpcMemHandle_t/g; - $ft{'type'} += s/\bCUipcMemHandle_st\b/hipIpcMemHandle_st/g; - $ft{'type'} += s/\bCUjit_option\b/hipJitOption/g; - $ft{'type'} += s/\bCUjit_option_enum\b/hipJitOption/g; - $ft{'type'} += s/\bCUlimit\b/hipLimit_t/g; - $ft{'type'} += s/\bCUlimit_enum\b/hipLimit_t/g; - $ft{'type'} += s/\bCUmemorytype\b/hipMemoryType/g; - $ft{'type'} += s/\bCUmemorytype_enum\b/hipMemoryType/g; - $ft{'type'} += s/\bCUmipmappedArray\b/hipMipmappedArray_t/g; - $ft{'type'} += s/\bCUmipmappedArray_st\b/hipMipmappedArray_st/g; - $ft{'type'} += s/\bCUmod_st\b/ihipModule_t/g; - $ft{'type'} += s/\bCUmodule\b/hipModule_t/g; - $ft{'type'} += s/\bCUresourceViewFormat\b/hipResourceViewFormat/g; - $ft{'type'} += s/\bCUresourceViewFormat_enum\b/hipResourceViewFormat/g; - $ft{'type'} += s/\bCUresourcetype\b/hipResourceType/g; - $ft{'type'} += s/\bCUresourcetype_enum\b/hipResourceType/g; - $ft{'type'} += s/\bCUresult\b/hipError_t/g; - $ft{'type'} += s/\bCUsharedconfig\b/hipSharedMemConfig/g; - $ft{'type'} += s/\bCUsharedconfig_enum\b/hipSharedMemConfig/g; - $ft{'type'} += s/\bCUstream\b/hipStream_t/g; - $ft{'type'} += s/\bCUstreamCallback\b/hipStreamCallback_t/g; - $ft{'type'} += s/\bCUstream_st\b/ihipStream_t/g; - $ft{'type'} += s/\bCUtexObject\b/hipTextureObject_t/g; - $ft{'type'} += s/\bCUtexref_st\b/textureReference/g; - $ft{'type'} += s/\bcsrgemm2Info\b/csrgemm2Info/g; - $ft{'type'} += s/\bcsrgemm2Info_t\b/csrgemm2Info_t/g; - $ft{'type'} += s/\bcsrilu02Info_t\b/csrilu02Info_t/g; - $ft{'type'} += s/\bcsrsm2Info\b/csrsm2Info/g; - $ft{'type'} += s/\bcsrsm2Info_t\b/csrsm2Info_t/g; - $ft{'type'} += s/\bcsrsv2Info_t\b/csrsv2Info_t/g; - $ft{'type'} += s/\bcuComplex\b/hipComplex/g; - $ft{'type'} += s/\bcuDoubleComplex\b/hipDoubleComplex/g; - $ft{'type'} += s/\bcuFloatComplex\b/hipFloatComplex/g; - $ft{'type'} += s/\bcublasDataType_t\b/hipblasDatatype_t/g; - $ft{'type'} += s/\bcublasDiagType_t\b/hipblasDiagType_t/g; - $ft{'type'} += s/\bcublasFillMode_t\b/hipblasFillMode_t/g; - $ft{'type'} += s/\bcublasGemmAlgo_t\b/hipblasGemmAlgo_t/g; - $ft{'type'} += s/\bcublasHandle_t\b/hipblasHandle_t/g; - $ft{'type'} += s/\bcublasOperation_t\b/hipblasOperation_t/g; - $ft{'type'} += s/\bcublasPointerMode_t\b/hipblasPointerMode_t/g; - $ft{'type'} += s/\bcublasSideMode_t\b/hipblasSideMode_t/g; - $ft{'type'} += s/\bcublasStatus\b/hipblasStatus_t/g; - $ft{'type'} += s/\bcublasStatus_t\b/hipblasStatus_t/g; - $ft{'type'} += s/\bcudaArray\b/hipArray/g; - $ft{'type'} += s/\bcudaArray_const_t\b/hipArray_const_t/g; - $ft{'type'} += s/\bcudaArray_t\b/hipArray_t/g; - $ft{'type'} += s/\bcudaChannelFormatDesc\b/hipChannelFormatDesc/g; - $ft{'type'} += s/\bcudaChannelFormatKind\b/hipChannelFormatKind/g; - $ft{'type'} += s/\bcudaComputeMode\b/hipComputeMode/g; - $ft{'type'} += s/\bcudaDataType\b/hipblasDatatype_t/g; - $ft{'type'} += s/\bcudaDataType_t\b/hipblasDatatype_t/g; - $ft{'type'} += s/\bcudaDeviceAttr\b/hipDeviceAttribute_t/g; - $ft{'type'} += s/\bcudaDeviceProp\b/hipDeviceProp_t/g; - $ft{'type'} += s/\bcudaError\b/hipError_t/g; - $ft{'type'} += s/\bcudaError_enum\b/hipError_t/g; - $ft{'type'} += s/\bcudaError_t\b/hipError_t/g; - $ft{'type'} += s/\bcudaEvent_t\b/hipEvent_t/g; - $ft{'type'} += s/\bcudaExtent\b/hipExtent/g; - $ft{'type'} += s/\bcudaFuncAttributes\b/hipFuncAttributes/g; - $ft{'type'} += s/\bcudaFuncCache\b/hipFuncCache_t/g; - $ft{'type'} += s/\bcudaIpcEventHandle_st\b/ihipIpcEventHandle_t/g; - $ft{'type'} += s/\bcudaIpcEventHandle_t\b/ihipIpcEventHandle_t/g; - $ft{'type'} += s/\bcudaIpcMemHandle_st\b/hipIpcMemHandle_st/g; - $ft{'type'} += s/\bcudaIpcMemHandle_t\b/hipIpcMemHandle_t/g; - $ft{'type'} += s/\bcudaLaunchParams\b/hipLaunchParams/g; - $ft{'type'} += s/\bcudaLimit\b/hipLimit_t/g; - $ft{'type'} += s/\bcudaMemcpy3DParms\b/hipMemcpy3DParms/g; - $ft{'type'} += s/\bcudaMemcpyKind\b/hipMemcpyKind/g; - $ft{'type'} += s/\bcudaMipmappedArray\b/hipMipmappedArray/g; - $ft{'type'} += s/\bcudaMipmappedArray_const_t\b/hipMipmappedArray_const_t/g; - $ft{'type'} += s/\bcudaMipmappedArray_t\b/hipMipmappedArray_t/g; - $ft{'type'} += s/\bcudaPitchedPtr\b/hipPitchedPtr/g; - $ft{'type'} += s/\bcudaPointerAttributes\b/hipPointerAttribute_t/g; - $ft{'type'} += s/\bcudaPos\b/hipPos/g; - $ft{'type'} += s/\bcudaResourceDesc\b/hipResourceDesc/g; - $ft{'type'} += s/\bcudaResourceType\b/hipResourceType/g; - $ft{'type'} += s/\bcudaResourceViewDesc\b/hipResourceViewDesc/g; - $ft{'type'} += s/\bcudaResourceViewFormat\b/hipResourceViewFormat/g; - $ft{'type'} += s/\bcudaSharedMemConfig\b/hipSharedMemConfig/g; - $ft{'type'} += s/\bcudaStreamCallback_t\b/hipStreamCallback_t/g; - $ft{'type'} += s/\bcudaStream_t\b/hipStream_t/g; - $ft{'type'} += s/\bcudaSurfaceBoundaryMode\b/hipSurfaceBoundaryMode/g; - $ft{'type'} += s/\bcudaSurfaceObject_t\b/hipSurfaceObject_t/g; - $ft{'type'} += s/\bcudaTextureAddressMode\b/hipTextureAddressMode/g; - $ft{'type'} += s/\bcudaTextureDesc\b/hipTextureDesc/g; - $ft{'type'} += s/\bcudaTextureFilterMode\b/hipTextureFilterMode/g; - $ft{'type'} += s/\bcudaTextureObject_t\b/hipTextureObject_t/g; - $ft{'type'} += s/\bcudaTextureReadMode\b/hipTextureReadMode/g; - $ft{'type'} += s/\bcudnnActivationDescriptor_t\b/hipdnnActivationDescriptor_t/g; - $ft{'type'} += s/\bcudnnActivationMode_t\b/hipdnnActivationMode_t/g; - $ft{'type'} += s/\bcudnnBatchNormMode_t\b/hipdnnBatchNormMode_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdDataAlgoPerf_t\b/hipdnnConvolutionBwdDataAlgoPerf_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdDataAlgo_t\b/hipdnnConvolutionBwdDataAlgo_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdDataPreference_t\b/hipdnnConvolutionBwdDataPreference_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdFilterAlgoPerf_t\b/hipdnnConvolutionBwdFilterAlgoPerf_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdFilterAlgo_t\b/hipdnnConvolutionBwdFilterAlgo_t/g; - $ft{'type'} += s/\bcudnnConvolutionBwdFilterPreference_t\b/hipdnnConvolutionBwdFilterPreference_t/g; - $ft{'type'} += s/\bcudnnConvolutionDescriptor_t\b/hipdnnConvolutionDescriptor_t/g; - $ft{'type'} += s/\bcudnnConvolutionFwdAlgoPerf_t\b/hipdnnConvolutionFwdAlgoPerf_t/g; - $ft{'type'} += s/\bcudnnConvolutionFwdAlgo_t\b/hipdnnConvolutionFwdAlgo_t/g; - $ft{'type'} += s/\bcudnnConvolutionFwdPreference_t\b/hipdnnConvolutionFwdPreference_t/g; - $ft{'type'} += s/\bcudnnConvolutionMode_t\b/hipdnnConvolutionMode_t/g; - $ft{'type'} += s/\bcudnnDataType_t\b/hipdnnDataType_t/g; - $ft{'type'} += s/\bcudnnDirectionMode_t\b/hipdnnDirectionMode_t/g; - $ft{'type'} += s/\bcudnnDropoutDescriptor_t\b/hipdnnDropoutDescriptor_t/g; - $ft{'type'} += s/\bcudnnFilterDescriptor_t\b/hipdnnFilterDescriptor_t/g; - $ft{'type'} += s/\bcudnnHandle_t\b/hipdnnHandle_t/g; - $ft{'type'} += s/\bcudnnIndicesType_t\b/hipdnnIndicesType_t/g; - $ft{'type'} += s/\bcudnnLRNDescriptor_t\b/hipdnnLRNDescriptor_t/g; - $ft{'type'} += s/\bcudnnLRNMode_t\b/hipdnnLRNMode_t/g; - $ft{'type'} += s/\bcudnnMathType_t\b/hipdnnMathType_t/g; - $ft{'type'} += s/\bcudnnNanPropagation_t\b/hipdnnNanPropagation_t/g; - $ft{'type'} += s/\bcudnnOpTensorDescriptor_t\b/hipdnnOpTensorDescriptor_t/g; - $ft{'type'} += s/\bcudnnOpTensorOp_t\b/hipdnnOpTensorOp_t/g; - $ft{'type'} += s/\bcudnnPersistentRNNPlan_t\b/hipdnnPersistentRNNPlan_t/g; - $ft{'type'} += s/\bcudnnPoolingDescriptor_t\b/hipdnnPoolingDescriptor_t/g; - $ft{'type'} += s/\bcudnnPoolingMode_t\b/hipdnnPoolingMode_t/g; - $ft{'type'} += s/\bcudnnRNNAlgo_t\b/hipdnnRNNAlgo_t/g; - $ft{'type'} += s/\bcudnnRNNBiasMode_t\b/hipdnnRNNBiasMode_t/g; - $ft{'type'} += s/\bcudnnRNNDescriptor_t\b/hipdnnRNNDescriptor_t/g; - $ft{'type'} += s/\bcudnnRNNInputMode_t\b/hipdnnRNNInputMode_t/g; - $ft{'type'} += s/\bcudnnRNNMode_t\b/hipdnnRNNMode_t/g; - $ft{'type'} += s/\bcudnnReduceTensorDescriptor_t\b/hipdnnReduceTensorDescriptor_t/g; - $ft{'type'} += s/\bcudnnReduceTensorIndices_t\b/hipdnnReduceTensorIndices_t/g; - $ft{'type'} += s/\bcudnnReduceTensorOp_t\b/hipdnnReduceTensorOp_t/g; - $ft{'type'} += s/\bcudnnSoftmaxAlgorithm_t\b/hipdnnSoftmaxAlgorithm_t/g; - $ft{'type'} += s/\bcudnnSoftmaxMode_t\b/hipdnnSoftmaxMode_t/g; - $ft{'type'} += s/\bcudnnStatus_t\b/hipdnnStatus_t/g; - $ft{'type'} += s/\bcudnnTensorDescriptor_t\b/hipdnnTensorDescriptor_t/g; - $ft{'type'} += s/\bcudnnTensorFormat_t\b/hipdnnTensorFormat_t/g; - $ft{'type'} += s/\bcufftComplex\b/hipfftComplex/g; - $ft{'type'} += s/\bcufftDoubleComplex\b/hipfftDoubleComplex/g; - $ft{'type'} += s/\bcufftDoubleReal\b/hipfftDoubleReal/g; - $ft{'type'} += s/\bcufftHandle\b/hipfftHandle/g; - $ft{'type'} += s/\bcufftReal\b/hipfftReal/g; - $ft{'type'} += s/\bcufftResult\b/hipfftResult/g; - $ft{'type'} += s/\bcufftResult_t\b/hipfftResult_t/g; - $ft{'type'} += s/\bcufftType\b/hipfftType/g; - $ft{'type'} += s/\bcufftType_t\b/hipfftType_t/g; - $ft{'type'} += s/\bcurandDirectionVectors32_t\b/hiprandDirectionVectors32_t/g; - $ft{'type'} += s/\bcurandDiscreteDistribution_st\b/hiprandDiscreteDistribution_st/g; - $ft{'type'} += s/\bcurandDiscreteDistribution_t\b/hiprandDiscreteDistribution_t/g; - $ft{'type'} += s/\bcurandGenerator_st\b/hiprandGenerator_st/g; - $ft{'type'} += s/\bcurandGenerator_t\b/hiprandGenerator_t/g; - $ft{'type'} += s/\bcurandRngType\b/hiprandRngType_t/g; - $ft{'type'} += s/\bcurandRngType_t\b/hiprandRngType_t/g; - $ft{'type'} += s/\bcurandState\b/hiprandState/g; - $ft{'type'} += s/\bcurandStateMRG32k3a\b/hiprandStateMRG32k3a/g; - $ft{'type'} += s/\bcurandStateMRG32k3a_t\b/hiprandStateMRG32k3a_t/g; - $ft{'type'} += s/\bcurandStateMtgp32\b/hiprandStateMtgp32/g; - $ft{'type'} += s/\bcurandStateMtgp32_t\b/hiprandStateMtgp32_t/g; - $ft{'type'} += s/\bcurandStatePhilox4_32_10\b/hiprandStatePhilox4_32_10/g; - $ft{'type'} += s/\bcurandStatePhilox4_32_10_t\b/hiprandStatePhilox4_32_10_t/g; - $ft{'type'} += s/\bcurandStateSobol32\b/hiprandStateSobol32/g; - $ft{'type'} += s/\bcurandStateSobol32_t\b/hiprandStateSobol32_t/g; - $ft{'type'} += s/\bcurandStateXORWOW\b/hiprandStateXORWOW/g; - $ft{'type'} += s/\bcurandStateXORWOW_t\b/hiprandStateXORWOW_t/g; - $ft{'type'} += s/\bcurandState_t\b/hiprandState_t/g; - $ft{'type'} += s/\bcurandStatus\b/hiprandStatus_t/g; - $ft{'type'} += s/\bcurandStatus_t\b/hiprandStatus_t/g; - $ft{'type'} += s/\bcusparseAction_t\b/hipsparseAction_t/g; - $ft{'type'} += s/\bcusparseDiagType_t\b/hipsparseDiagType_t/g; - $ft{'type'} += s/\bcusparseDirection_t\b/hipsparseDirection_t/g; - $ft{'type'} += s/\bcusparseFillMode_t\b/hipsparseFillMode_t/g; - $ft{'type'} += s/\bcusparseHandle_t\b/hipsparseHandle_t/g; - $ft{'type'} += s/\bcusparseHybMat_t\b/hipsparseHybMat_t/g; - $ft{'type'} += s/\bcusparseHybPartition_t\b/hipsparseHybPartition_t/g; - $ft{'type'} += s/\bcusparseIndexBase_t\b/hipsparseIndexBase_t/g; - $ft{'type'} += s/\bcusparseMatDescr_t\b/hipsparseMatDescr_t/g; - $ft{'type'} += s/\bcusparseMatrixType_t\b/hipsparseMatrixType_t/g; - $ft{'type'} += s/\bcusparseOperation_t\b/hipsparseOperation_t/g; - $ft{'type'} += s/\bcusparsePointerMode_t\b/hipsparsePointerMode_t/g; - $ft{'type'} += s/\bcusparseSolvePolicy_t\b/hipsparseSolvePolicy_t/g; - $ft{'type'} += s/\bcusparseStatus_t\b/hipsparseStatus_t/g; - $ft{'numeric_literal'} += s/\bCUBLAS_DIAG_NON_UNIT\b/HIPBLAS_DIAG_NON_UNIT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_DIAG_UNIT\b/HIPBLAS_DIAG_UNIT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_FILL_MODE_FULL\b/HIPBLAS_FILL_MODE_FULL/g; - $ft{'numeric_literal'} += s/\bCUBLAS_FILL_MODE_LOWER\b/HIPBLAS_FILL_MODE_LOWER/g; - $ft{'numeric_literal'} += s/\bCUBLAS_FILL_MODE_UPPER\b/HIPBLAS_FILL_MODE_UPPER/g; - $ft{'numeric_literal'} += s/\bCUBLAS_GEMM_DEFAULT\b/HIPBLAS_GEMM_DEFAULT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_GEMM_DFALT\b/HIPBLAS_GEMM_DEFAULT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_OP_C\b/HIPBLAS_OP_C/g; - $ft{'numeric_literal'} += s/\bCUBLAS_OP_HERMITAN\b/HIPBLAS_OP_C/g; - $ft{'numeric_literal'} += s/\bCUBLAS_OP_N\b/HIPBLAS_OP_N/g; - $ft{'numeric_literal'} += s/\bCUBLAS_OP_T\b/HIPBLAS_OP_T/g; - $ft{'numeric_literal'} += s/\bCUBLAS_POINTER_MODE_DEVICE\b/HIPBLAS_POINTER_MODE_DEVICE/g; - $ft{'numeric_literal'} += s/\bCUBLAS_POINTER_MODE_HOST\b/HIPBLAS_POINTER_MODE_HOST/g; - $ft{'numeric_literal'} += s/\bCUBLAS_SIDE_LEFT\b/HIPBLAS_SIDE_LEFT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_SIDE_RIGHT\b/HIPBLAS_SIDE_RIGHT/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_ALLOC_FAILED\b/HIPBLAS_STATUS_ALLOC_FAILED/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_ARCH_MISMATCH\b/HIPBLAS_STATUS_ARCH_MISMATCH/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_EXECUTION_FAILED\b/HIPBLAS_STATUS_EXECUTION_FAILED/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_INTERNAL_ERROR\b/HIPBLAS_STATUS_INTERNAL_ERROR/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_INVALID_VALUE\b/HIPBLAS_STATUS_INVALID_VALUE/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_MAPPING_ERROR\b/HIPBLAS_STATUS_MAPPING_ERROR/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_NOT_INITIALIZED\b/HIPBLAS_STATUS_NOT_INITIALIZED/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_NOT_SUPPORTED\b/HIPBLAS_STATUS_NOT_SUPPORTED/g; - $ft{'numeric_literal'} += s/\bCUBLAS_STATUS_SUCCESS\b/HIPBLAS_STATUS_SUCCESS/g; - $ft{'numeric_literal'} += s/\bCUDA_C_16F\b/HIPBLAS_C_16F/g; - $ft{'numeric_literal'} += s/\bCUDA_C_32F\b/HIPBLAS_C_32F/g; - $ft{'numeric_literal'} += s/\bCUDA_C_32I\b/HIPBLAS_C_32I/g; - $ft{'numeric_literal'} += s/\bCUDA_C_32U\b/HIPBLAS_C_32U/g; - $ft{'numeric_literal'} += s/\bCUDA_C_64F\b/HIPBLAS_C_64F/g; - $ft{'numeric_literal'} += s/\bCUDA_C_8I\b/HIPBLAS_C_8I/g; - $ft{'numeric_literal'} += s/\bCUDA_C_8U\b/HIPBLAS_C_8U/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ALREADY_ACQUIRED\b/hipErrorAlreadyAcquired/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ALREADY_MAPPED\b/hipErrorAlreadyMapped/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ARRAY_IS_MAPPED\b/hipErrorArrayIsMapped/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ASSERT\b/hipErrorAssert/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_CONTEXT_ALREADY_CURRENT\b/hipErrorContextAlreadyCurrent/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_CONTEXT_ALREADY_IN_USE\b/hipErrorContextAlreadyInUse/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE\b/hipErrorCooperativeLaunchTooLarge/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_DEINITIALIZED\b/hipErrorDeinitialized/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ECC_UNCORRECTABLE\b/hipErrorECCNotCorrectable/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_FILE_NOT_FOUND\b/hipErrorFileNotFound/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED\b/hipErrorHostMemoryAlreadyRegistered/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_HOST_MEMORY_NOT_REGISTERED\b/hipErrorHostMemoryNotRegistered/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_ILLEGAL_ADDRESS\b/hipErrorIllegalAddress/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_CONTEXT\b/hipErrorInvalidContext/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_DEVICE\b/hipErrorInvalidDevice/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_GRAPHICS_CONTEXT\b/hipErrorInvalidGraphicsContext/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_HANDLE\b/hipErrorInvalidHandle/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_IMAGE\b/hipErrorInvalidImage/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_PTX\b/hipErrorInvalidKernelFile/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_SOURCE\b/hipErrorInvalidSource/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_INVALID_VALUE\b/hipErrorInvalidValue/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_LAUNCH_FAILED\b/hipErrorLaunchFailure/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_LAUNCH_OUT_OF_RESOURCES\b/hipErrorLaunchOutOfResources/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_LAUNCH_TIMEOUT\b/hipErrorLaunchTimeOut/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_MAP_FAILED\b/hipErrorMapFailed/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_FOUND\b/hipErrorNotFound/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_INITIALIZED\b/hipErrorNotInitialized/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_MAPPED\b/hipErrorNotMapped/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_MAPPED_AS_ARRAY\b/hipErrorNotMappedAsArray/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_MAPPED_AS_POINTER\b/hipErrorNotMappedAsPointer/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_READY\b/hipErrorNotReady/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NOT_SUPPORTED\b/hipErrorNotSupported/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NO_BINARY_FOR_GPU\b/hipErrorNoBinaryForGpu/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_NO_DEVICE\b/hipErrorNoDevice/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_OPERATING_SYSTEM\b/hipErrorOperatingSystem/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_OUT_OF_MEMORY\b/hipErrorOutOfMemory/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED\b/hipErrorPeerAccessAlreadyEnabled/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PEER_ACCESS_NOT_ENABLED\b/hipErrorPeerAccessNotEnabled/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PEER_ACCESS_UNSUPPORTED\b/hipErrorPeerAccessUnsupported/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PRIMARY_CONTEXT_ACTIVE\b/hipErrorSetOnActiveProcess/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PROFILER_ALREADY_STARTED\b/hipErrorProfilerAlreadyStarted/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PROFILER_ALREADY_STOPPED\b/hipErrorProfilerAlreadyStopped/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PROFILER_DISABLED\b/hipErrorProfilerDisabled/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_PROFILER_NOT_INITIALIZED\b/hipErrorProfilerNotInitialized/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_SHARED_OBJECT_INIT_FAILED\b/hipErrorSharedObjectInitFailed/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND\b/hipErrorSharedObjectSymbolNotFound/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_UNKNOWN\b/hipErrorUnknown/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_UNMAP_FAILED\b/hipErrorUnmapFailed/g; - $ft{'numeric_literal'} += s/\bCUDA_ERROR_UNSUPPORTED_LIMIT\b/hipErrorUnsupportedLimit/g; - $ft{'numeric_literal'} += s/\bCUDA_R_16F\b/HIPBLAS_R_16F/g; - $ft{'numeric_literal'} += s/\bCUDA_R_32F\b/HIPBLAS_R_32F/g; - $ft{'numeric_literal'} += s/\bCUDA_R_32I\b/HIPBLAS_R_32I/g; - $ft{'numeric_literal'} += s/\bCUDA_R_32U\b/HIPBLAS_R_32U/g; - $ft{'numeric_literal'} += s/\bCUDA_R_64F\b/HIPBLAS_R_64F/g; - $ft{'numeric_literal'} += s/\bCUDA_R_8I\b/HIPBLAS_R_8I/g; - $ft{'numeric_literal'} += s/\bCUDA_R_8U\b/HIPBLAS_R_8U/g; - $ft{'numeric_literal'} += s/\bCUDA_SUCCESS\b/hipSuccess/g; - $ft{'numeric_literal'} += s/\bCUDNN_16BIT_INDICES\b/HIPDNN_16BIT_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_32BIT_INDICES\b/HIPDNN_32BIT_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_64BIT_INDICES\b/HIPDNN_64BIT_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_8BIT_INDICES\b/HIPDNN_8BIT_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_CLIPPED_RELU\b/HIPDNN_ACTIVATION_CLIPPED_RELU/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_ELU\b/HIPDNN_ACTIVATION_ELU/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_IDENTITY\b/HIPDNN_ACTIVATION_PATHTRU/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_RELU\b/HIPDNN_ACTIVATION_RELU/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_SIGMOID\b/HIPDNN_ACTIVATION_SIGMOID/g; - $ft{'numeric_literal'} += s/\bCUDNN_ACTIVATION_TANH\b/HIPDNN_ACTIVATION_TANH/g; - $ft{'numeric_literal'} += s/\bCUDNN_BATCHNORM_PER_ACTIVATION\b/HIPDNN_BATCHNORM_PER_ACTIVATION/g; - $ft{'numeric_literal'} += s/\bCUDNN_BATCHNORM_SPATIAL\b/HIPDNN_BATCHNORM_SPATIAL/g; - $ft{'numeric_literal'} += s/\bCUDNN_BATCHNORM_SPATIAL_PERSISTENT\b/HIPDNN_BATCHNORM_SPATIAL_PERSISTENT/g; - $ft{'numeric_literal'} += s/\bCUDNN_BIDIRECTIONAL\b/HIPDNN_BIDIRECTIONAL/g; - $ft{'numeric_literal'} += s/\bCUDNN_BN_MIN_EPSILON\b/HIPDNN_BN_MIN_EPSILON/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION\b/HIPDNN_CONVOLUTION/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_0\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_0/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_1\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_1/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_COUNT\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_TRANSPOSE_GEMM/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_FFT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED\b/HIPDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD_NONFUSED/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_NO_WORKSPACE\b/HIPDNN_CONVOLUTION_BWD_DATA_NO_WORKSPACE/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST\b/HIPDNN_CONVOLUTION_BWD_DATA_PREFER_FASTEST/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT\b/HIPDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_0\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_0/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_1\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_1/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_3\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_3/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_COUNT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_FFT_TILING/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED\b/HIPDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_NO_WORKSPACE\b/HIPDNN_CONVOLUTION_BWD_FILTER_NO_WORKSPACE/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_PREFER_FASTEST\b/HIPDNN_CONVOLUTION_BWD_FILTER_PREFER_FASTEST/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT\b/HIPDNN_CONVOLUTION_BWD_FILTER_SPECIFY_WORKSPACE_LIMIT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_COUNT\b/HIPDNN_CONVOLUTION_FWD_ALGO_COUNT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_DIRECT\b/HIPDNN_CONVOLUTION_FWD_ALGO_DIRECT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_FFT\b/HIPDNN_CONVOLUTION_FWD_ALGO_FFT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_FFT_TILING\b/HIPDNN_CONVOLUTION_FWD_ALGO_FFT_TILING/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_GEMM\b/HIPDNN_CONVOLUTION_FWD_ALGO_GEMM/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM\b/HIPDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_GEMM/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM\b/HIPDNN_CONVOLUTION_FWD_ALGO_IMPLICIT_PRECOMP_GEMM/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD\b/HIPDNN_CONVOLUTION_FWD_ALGO_WINOGRAD/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED\b/HIPDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_NO_WORKSPACE\b/HIPDNN_CONVOLUTION_FWD_NO_WORKSPACE/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_PREFER_FASTEST\b/HIPDNN_CONVOLUTION_FWD_PREFER_FASTEST/g; - $ft{'numeric_literal'} += s/\bCUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT\b/HIPDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT/g; - $ft{'numeric_literal'} += s/\bCUDNN_CROSS_CORRELATION\b/HIPDNN_CROSS_CORRELATION/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_DOUBLE\b/HIPDNN_DATA_DOUBLE/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_FLOAT\b/HIPDNN_DATA_FLOAT/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_HALF\b/HIPDNN_DATA_HALF/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_INT32\b/HIPDNN_DATA_INT32/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_INT8\b/HIPDNN_DATA_INT8/g; - $ft{'numeric_literal'} += s/\bCUDNN_DATA_INT8x4\b/HIPDNN_DATA_INT8x4/g; - $ft{'numeric_literal'} += s/\bCUDNN_DEFAULT_MATH\b/HIPDNN_DEFAULT_MATH/g; - $ft{'numeric_literal'} += s/\bCUDNN_GRU\b/HIPDNN_GRU/g; - $ft{'numeric_literal'} += s/\bCUDNN_LINEAR_INPUT\b/HIPDNN_LINEAR_INPUT/g; - $ft{'numeric_literal'} += s/\bCUDNN_LRN_CROSS_CHANNEL_DIM1\b/HIPDNN_LRN_CROSS_CHANNEL/g; - $ft{'numeric_literal'} += s/\bCUDNN_LSTM\b/HIPDNN_LSTM/g; - $ft{'numeric_literal'} += s/\bCUDNN_NOT_PROPAGATE_NAN\b/HIPDNN_NOT_PROPAGATE_NAN/g; - $ft{'numeric_literal'} += s/\bCUDNN_OP_TENSOR_ADD\b/HIPDNN_OP_TENSOR_ADD/g; - $ft{'numeric_literal'} += s/\bCUDNN_OP_TENSOR_MAX\b/HIPDNN_OP_TENSOR_MAX/g; - $ft{'numeric_literal'} += s/\bCUDNN_OP_TENSOR_MIN\b/HIPDNN_OP_TENSOR_MIN/g; - $ft{'numeric_literal'} += s/\bCUDNN_OP_TENSOR_MUL\b/HIPDNN_OP_TENSOR_MUL/g; - $ft{'numeric_literal'} += s/\bCUDNN_OP_TENSOR_SQRT\b/HIPDNN_OP_TENSOR_SQRT/g; - $ft{'numeric_literal'} += s/\bCUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING\b/HIPDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING/g; - $ft{'numeric_literal'} += s/\bCUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING\b/HIPDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING/g; - $ft{'numeric_literal'} += s/\bCUDNN_POOLING_MAX\b/HIPDNN_POOLING_MAX/g; - $ft{'numeric_literal'} += s/\bCUDNN_POOLING_MAX_DETERMINISTIC\b/HIPDNN_POOLING_MAX_DETERMINISTIC/g; - $ft{'numeric_literal'} += s/\bCUDNN_PROPAGATE_NAN\b/HIPDNN_PROPAGATE_NAN/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_ADD\b/HIPDNN_REDUCE_TENSOR_ADD/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_AMAX\b/HIPDNN_REDUCE_TENSOR_AMAX/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_AVG\b/HIPDNN_REDUCE_TENSOR_AVG/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_FLATTENED_INDICES\b/HIPDNN_REDUCE_TENSOR_FLATTENED_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_MAX\b/HIPDNN_REDUCE_TENSOR_MAX/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_MIN\b/HIPDNN_REDUCE_TENSOR_MIN/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_MUL\b/HIPDNN_REDUCE_TENSOR_MUL/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_MUL_NO_ZEROS\b/HIPDNN_REDUCE_TENSOR_MUL_NO_ZEROS/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_NORM1\b/HIPDNN_REDUCE_TENSOR_NORM1/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_NORM2\b/HIPDNN_REDUCE_TENSOR_NORM2/g; - $ft{'numeric_literal'} += s/\bCUDNN_REDUCE_TENSOR_NO_INDICES\b/HIPDNN_REDUCE_TENSOR_NO_INDICES/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_ALGO_PERSIST_DYNAMIC\b/HIPDNN_RNN_ALGO_PERSIST_DYNAMIC/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_ALGO_PERSIST_STATIC\b/HIPDNN_RNN_ALGO_PERSIST_STATIC/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_ALGO_STANDARD\b/HIPDNN_RNN_ALGO_STANDARD/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_DOUBLE_BIAS\b/HIPDNN_RNN_WITH_BIAS/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_NO_BIAS\b/HIPDNN_RNN_NO_BIAS/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_RELU\b/HIPDNN_RNN_RELU/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_SINGLE_INP_BIAS\b/HIPDNN_RNN_WITH_BIAS/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_SINGLE_REC_BIAS\b/HIPDNN_RNN_WITH_BIAS/g; - $ft{'numeric_literal'} += s/\bCUDNN_RNN_TANH\b/HIPDNN_RNN_TANH/g; - $ft{'numeric_literal'} += s/\bCUDNN_SKIP_INPUT\b/HIPDNN_SKIP_INPUT/g; - $ft{'numeric_literal'} += s/\bCUDNN_SOFTMAX_ACCURATE\b/HIPDNN_SOFTMAX_ACCURATE/g; - $ft{'numeric_literal'} += s/\bCUDNN_SOFTMAX_FAST\b/HIPDNN_SOFTMAX_FAST/g; - $ft{'numeric_literal'} += s/\bCUDNN_SOFTMAX_LOG\b/HIPDNN_SOFTMAX_LOG/g; - $ft{'numeric_literal'} += s/\bCUDNN_SOFTMAX_MODE_CHANNEL\b/HIPDNN_SOFTMAX_MODE_CHANNEL/g; - $ft{'numeric_literal'} += s/\bCUDNN_SOFTMAX_MODE_INSTANCE\b/HIPDNN_SOFTMAX_MODE_INSTANCE/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_ALLOC_FAILED\b/HIPDNN_STATUS_ALLOC_FAILED/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_ARCH_MISMATCH\b/HIPDNN_STATUS_ARCH_MISMATCH/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_BAD_PARAM\b/HIPDNN_STATUS_BAD_PARAM/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_EXECUTION_FAILED\b/HIPDNN_STATUS_EXECUTION_FAILED/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_INTERNAL_ERROR\b/HIPDNN_STATUS_INTERNAL_ERROR/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_INVALID_VALUE\b/HIPDNN_STATUS_INVALID_VALUE/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_LICENSE_ERROR\b/HIPDNN_STATUS_LICENSE_ERROR/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_MAPPING_ERROR\b/HIPDNN_STATUS_MAPPING_ERROR/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_NOT_INITIALIZED\b/HIPDNN_STATUS_NOT_INITIALIZED/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_NOT_SUPPORTED\b/HIPDNN_STATUS_NOT_SUPPORTED/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING\b/HIPDNN_STATUS_RUNTIME_PREREQUISITE_MISSING/g; - $ft{'numeric_literal'} += s/\bCUDNN_STATUS_SUCCESS\b/HIPDNN_STATUS_SUCCESS/g; - $ft{'numeric_literal'} += s/\bCUDNN_TENSOR_NCHW\b/HIPDNN_TENSOR_NCHW/g; - $ft{'numeric_literal'} += s/\bCUDNN_TENSOR_NCHW_VECT_C\b/HIPDNN_TENSOR_NCHW_VECT_C/g; - $ft{'numeric_literal'} += s/\bCUDNN_TENSOR_NHWC\b/HIPDNN_TENSOR_NHWC/g; - $ft{'numeric_literal'} += s/\bCUDNN_TENSOR_OP_MATH\b/HIPDNN_TENSOR_OP_MATH/g; - $ft{'numeric_literal'} += s/\bCUDNN_UNIDIRECTIONAL\b/HIPDNN_UNIDIRECTIONAL/g; - $ft{'numeric_literal'} += s/\bCUDNN_VERSION\b/HIPDNN_VERSION/g; - $ft{'numeric_literal'} += s/\bCUFFT_ALLOC_FAILED\b/HIPFFT_ALLOC_FAILED/g; - $ft{'numeric_literal'} += s/\bCUFFT_C2C\b/HIPFFT_C2C/g; - $ft{'numeric_literal'} += s/\bCUFFT_C2R\b/HIPFFT_C2R/g; - $ft{'numeric_literal'} += s/\bCUFFT_D2Z\b/HIPFFT_D2Z/g; - $ft{'numeric_literal'} += s/\bCUFFT_EXEC_FAILED\b/HIPFFT_EXEC_FAILED/g; - $ft{'numeric_literal'} += s/\bCUFFT_FORWARD\b/HIPFFT_FORWARD/g; - $ft{'numeric_literal'} += s/\bCUFFT_INCOMPLETE_PARAMETER_LIST\b/HIPFFT_INCOMPLETE_PARAMETER_LIST/g; - $ft{'numeric_literal'} += s/\bCUFFT_INTERNAL_ERROR\b/HIPFFT_INTERNAL_ERROR/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVALID_DEVICE\b/HIPFFT_INVALID_DEVICE/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVALID_PLAN\b/HIPFFT_INVALID_PLAN/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVALID_SIZE\b/HIPFFT_INVALID_SIZE/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVALID_TYPE\b/HIPFFT_INVALID_TYPE/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVALID_VALUE\b/HIPFFT_INVALID_VALUE/g; - $ft{'numeric_literal'} += s/\bCUFFT_INVERSE\b/HIPFFT_BACKWARD/g; - $ft{'numeric_literal'} += s/\bCUFFT_NOT_IMPLEMENTED\b/HIPFFT_NOT_IMPLEMENTED/g; - $ft{'numeric_literal'} += s/\bCUFFT_NOT_SUPPORTED\b/HIPFFT_NOT_SUPPORTED/g; - $ft{'numeric_literal'} += s/\bCUFFT_NO_WORKSPACE\b/HIPFFT_NO_WORKSPACE/g; - $ft{'numeric_literal'} += s/\bCUFFT_PARSE_ERROR\b/HIPFFT_PARSE_ERROR/g; - $ft{'numeric_literal'} += s/\bCUFFT_R2C\b/HIPFFT_R2C/g; - $ft{'numeric_literal'} += s/\bCUFFT_SETUP_FAILED\b/HIPFFT_SETUP_FAILED/g; - $ft{'numeric_literal'} += s/\bCUFFT_SUCCESS\b/HIPFFT_SUCCESS/g; - $ft{'numeric_literal'} += s/\bCUFFT_UNALIGNED_DATA\b/HIPFFT_UNALIGNED_DATA/g; - $ft{'numeric_literal'} += s/\bCUFFT_Z2D\b/HIPFFT_Z2D/g; - $ft{'numeric_literal'} += s/\bCUFFT_Z2Z\b/HIPFFT_Z2Z/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_DEFAULT\b/HIPRAND_RNG_PSEUDO_DEFAULT/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_MRG32K3A\b/HIPRAND_RNG_PSEUDO_MRG32K3A/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_MT19937\b/HIPRAND_RNG_PSEUDO_MT19937/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_MTGP32\b/HIPRAND_RNG_PSEUDO_MTGP32/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_PHILOX4_32_10\b/HIPRAND_RNG_PSEUDO_PHILOX4_32_10/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_PSEUDO_XORWOW\b/HIPRAND_RNG_PSEUDO_XORWOW/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_QUASI_DEFAULT\b/HIPRAND_RNG_QUASI_DEFAULT/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_QUASI_SCRAMBLED_SOBOL32\b/HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL32/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_QUASI_SCRAMBLED_SOBOL64\b/HIPRAND_RNG_QUASI_SCRAMBLED_SOBOL64/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_QUASI_SOBOL32\b/HIPRAND_RNG_QUASI_SOBOL32/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_QUASI_SOBOL64\b/HIPRAND_RNG_QUASI_SOBOL64/g; - $ft{'numeric_literal'} += s/\bCURAND_RNG_TEST\b/HIPRAND_RNG_TEST/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_ALLOCATION_FAILED\b/HIPRAND_STATUS_ALLOCATION_FAILED/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_ARCH_MISMATCH\b/HIPRAND_STATUS_ARCH_MISMATCH/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_DOUBLE_PRECISION_REQUIRED\b/HIPRAND_STATUS_DOUBLE_PRECISION_REQUIRED/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_INITIALIZATION_FAILED\b/HIPRAND_STATUS_INITIALIZATION_FAILED/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_INTERNAL_ERROR\b/HIPRAND_STATUS_INTERNAL_ERROR/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_LAUNCH_FAILURE\b/HIPRAND_STATUS_LAUNCH_FAILURE/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_LENGTH_NOT_MULTIPLE\b/HIPRAND_STATUS_LENGTH_NOT_MULTIPLE/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_NOT_INITIALIZED\b/HIPRAND_STATUS_NOT_INITIALIZED/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_OUT_OF_RANGE\b/HIPRAND_STATUS_OUT_OF_RANGE/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_PREEXISTING_FAILURE\b/HIPRAND_STATUS_PREEXISTING_FAILURE/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_SUCCESS\b/HIPRAND_STATUS_SUCCESS/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_TYPE_ERROR\b/HIPRAND_STATUS_TYPE_ERROR/g; - $ft{'numeric_literal'} += s/\bCURAND_STATUS_VERSION_MISMATCH\b/HIPRAND_STATUS_VERSION_MISMATCH/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_ACTION_NUMERIC\b/HIPSPARSE_ACTION_NUMERIC/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_ACTION_SYMBOLIC\b/HIPSPARSE_ACTION_SYMBOLIC/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_DIAG_TYPE_NON_UNIT\b/HIPSPARSE_DIAG_TYPE_NON_UNIT/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_DIAG_TYPE_UNIT\b/HIPSPARSE_DIAG_TYPE_UNIT/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_DIRECTION_COLUMN\b/HIPSPARSE_DIRECTION_COLUMN/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_DIRECTION_ROW\b/HIPSPARSE_DIRECTION_ROW/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_FILL_MODE_LOWER\b/HIPSPARSE_FILL_MODE_LOWER/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_FILL_MODE_UPPER\b/HIPSPARSE_FILL_MODE_UPPER/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_HYB_PARTITION_AUTO\b/HIPSPARSE_HYB_PARTITION_AUTO/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_HYB_PARTITION_MAX\b/HIPSPARSE_HYB_PARTITION_MAX/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_HYB_PARTITION_USER\b/HIPSPARSE_HYB_PARTITION_USER/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_INDEX_BASE_ONE\b/HIPSPARSE_INDEX_BASE_ONE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_INDEX_BASE_ZERO\b/HIPSPARSE_INDEX_BASE_ZERO/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_MATRIX_TYPE_GENERAL\b/HIPSPARSE_MATRIX_TYPE_GENERAL/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_MATRIX_TYPE_HERMITIAN\b/HIPSPARSE_MATRIX_TYPE_HERMITIAN/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_MATRIX_TYPE_SYMMETRIC\b/HIPSPARSE_MATRIX_TYPE_SYMMETRIC/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_MATRIX_TYPE_TRIANGULAR\b/HIPSPARSE_MATRIX_TYPE_TRIANGULAR/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_OPERATION_CONJUGATE_TRANSPOSE\b/HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_OPERATION_NON_TRANSPOSE\b/HIPSPARSE_OPERATION_NON_TRANSPOSE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_OPERATION_TRANSPOSE\b/HIPSPARSE_OPERATION_TRANSPOSE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_POINTER_MODE_DEVICE\b/HIPSPARSE_POINTER_MODE_DEVICE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_POINTER_MODE_HOST\b/HIPSPARSE_POINTER_MODE_HOST/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_SOLVE_POLICY_NO_LEVEL\b/HIPSPARSE_SOLVE_POLICY_NO_LEVEL/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_SOLVE_POLICY_USE_LEVEL\b/HIPSPARSE_SOLVE_POLICY_USE_LEVEL/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_ALLOC_FAILED\b/HIPSPARSE_STATUS_ALLOC_FAILED/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_ARCH_MISMATCH\b/HIPSPARSE_STATUS_ARCH_MISMATCH/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_EXECUTION_FAILED\b/HIPSPARSE_STATUS_EXECUTION_FAILED/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_INTERNAL_ERROR\b/HIPSPARSE_STATUS_INTERNAL_ERROR/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_INVALID_VALUE\b/HIPSPARSE_STATUS_INVALID_VALUE/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_MAPPING_ERROR\b/HIPSPARSE_STATUS_MAPPING_ERROR/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED\b/HIPSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_NOT_INITIALIZED\b/HIPSPARSE_STATUS_NOT_INITIALIZED/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_SUCCESS\b/HIPSPARSE_STATUS_SUCCESS/g; - $ft{'numeric_literal'} += s/\bCUSPARSE_STATUS_ZERO_PIVOT\b/HIPSPARSE_STATUS_ZERO_PIVOT/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_FLOAT\b/HIP_AD_FORMAT_FLOAT/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_HALF\b/HIP_AD_FORMAT_HALF/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_SIGNED_INT16\b/HIP_AD_FORMAT_SIGNED_INT16/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_SIGNED_INT32\b/HIP_AD_FORMAT_SIGNED_INT32/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_SIGNED_INT8\b/HIP_AD_FORMAT_SIGNED_INT8/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_UNSIGNED_INT16\b/HIP_AD_FORMAT_UNSIGNED_INT16/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_UNSIGNED_INT32\b/HIP_AD_FORMAT_UNSIGNED_INT32/g; - $ft{'numeric_literal'} += s/\bCU_AD_FORMAT_UNSIGNED_INT8\b/HIP_AD_FORMAT_UNSIGNED_INT8/g; - $ft{'numeric_literal'} += s/\bCU_COMPUTEMODE_DEFAULT\b/hipComputeModeDefault/g; - $ft{'numeric_literal'} += s/\bCU_COMPUTEMODE_EXCLUSIVE\b/hipComputeModeExclusive/g; - $ft{'numeric_literal'} += s/\bCU_COMPUTEMODE_EXCLUSIVE_PROCESS\b/hipComputeModeExclusiveProcess/g; - $ft{'numeric_literal'} += s/\bCU_COMPUTEMODE_PROHIBITED\b/hipComputeModeProhibited/g; - $ft{'numeric_literal'} += s/\bCU_CTX_BLOCKING_SYNC\b/hipDeviceScheduleBlockingSync/g; - $ft{'numeric_literal'} += s/\bCU_CTX_LMEM_RESIZE_TO_MAX\b/hipDeviceLmemResizeToMax/g; - $ft{'numeric_literal'} += s/\bCU_CTX_MAP_HOST\b/hipDeviceMapHost/g; - $ft{'numeric_literal'} += s/\bCU_CTX_SCHED_AUTO\b/hipDeviceScheduleAuto/g; - $ft{'numeric_literal'} += s/\bCU_CTX_SCHED_BLOCKING_SYNC\b/hipDeviceScheduleBlockingSync/g; - $ft{'numeric_literal'} += s/\bCU_CTX_SCHED_MASK\b/hipDeviceScheduleMask/g; - $ft{'numeric_literal'} += s/\bCU_CTX_SCHED_SPIN\b/hipDeviceScheduleSpin/g; - $ft{'numeric_literal'} += s/\bCU_CTX_SCHED_YIELD\b/hipDeviceScheduleYield/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY\b/hipDeviceAttributeCanMapHostMemory/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_CLOCK_RATE\b/hipDeviceAttributeClockRate/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR\b/hipDeviceAttributeComputeCapabilityMajor/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR\b/hipDeviceAttributeComputeCapabilityMinor/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_COMPUTE_MODE\b/hipDeviceAttributeComputeMode/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS\b/hipDeviceAttributeConcurrentKernels/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH\b/hipDeviceAttributeCooperativeLaunch/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH\b/hipDeviceAttributeCooperativeMultiDeviceLaunch/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_ECC_ENABLED\b/hipDeviceAttributeEccEnabled/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH\b/hipDeviceAttributeMemoryBusWidth/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_INTEGRATED\b/hipDeviceAttributeIntegrated/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT\b/hipDeviceAttributeKernelExecTimeout/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE\b/hipDeviceAttributeL2CacheSize/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH\b/hipDeviceAttributeMaxTexture1DWidth/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT\b/hipDeviceAttributeMaxTexture2DHeight/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH\b/hipDeviceAttributeMaxTexture2DWidth/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH\b/hipDeviceAttributeMaxTexture3DDepth/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT\b/hipDeviceAttributeMaxTexture3DHeight/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH\b/hipDeviceAttributeMaxTexture3DWidth/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X\b/hipDeviceAttributeMaxBlockDimX/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y\b/hipDeviceAttributeMaxBlockDimY/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z\b/hipDeviceAttributeMaxBlockDimZ/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X\b/hipDeviceAttributeMaxGridDimX/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y\b/hipDeviceAttributeMaxGridDimY/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z\b/hipDeviceAttributeMaxGridDimZ/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_PITCH\b/hipDeviceAttributeMaxPitch/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK\b/hipDeviceAttributeMaxRegistersPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK\b/hipDeviceAttributeMaxSharedMemoryPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR\b/hipDeviceAttributeMaxSharedMemoryPerMultiprocessor/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK\b/hipDeviceAttributeMaxThreadsPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR\b/hipDeviceAttributeMaxThreadsPerMultiProcessor/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE\b/hipDeviceAttributeMemoryClockRate/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT\b/hipDeviceAttributeMultiprocessorCount/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD\b/hipDeviceAttributeIsMultiGpuBoard/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_PCI_BUS_ID\b/hipDeviceAttributePciBusId/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID\b/hipDeviceAttributePciDeviceId/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK\b/hipDeviceAttributeMaxRegistersPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK\b/hipDeviceAttributeMaxSharedMemoryPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT\b/hipDeviceAttributeTextureAlignment/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY\b/hipDeviceAttributeTotalConstantMemory/g; - $ft{'numeric_literal'} += s/\bCU_DEVICE_ATTRIBUTE_WARP_SIZE\b/hipDeviceAttributeWarpSize/g; - $ft{'numeric_literal'} += s/\bCU_EVENT_BLOCKING_SYNC\b/hipEventBlockingSync/g; - $ft{'numeric_literal'} += s/\bCU_EVENT_DEFAULT\b/hipEventDefault/g; - $ft{'numeric_literal'} += s/\bCU_EVENT_DISABLE_TIMING\b/hipEventDisableTiming/g; - $ft{'numeric_literal'} += s/\bCU_EVENT_INTERPROCESS\b/hipEventInterprocess/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_BINARY_VERSION\b/HIP_FUNC_ATTRIBUTE_BINARY_VERSION/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_CACHE_MODE_CA\b/HIP_FUNC_ATTRIBUTE_CACHE_MODE_CA/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES\b/HIP_FUNC_ATTRIBUTE_CONST_SIZE_BYTES/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES\b/HIP_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_MAX\b/HIP_FUNC_ATTRIBUTE_MAX/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES\b/HIP_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK\b/HIP_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_NUM_REGS\b/HIP_FUNC_ATTRIBUTE_NUM_REGS/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT\b/HIP_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_PTX_VERSION\b/HIP_FUNC_ATTRIBUTE_PTX_VERSION/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES\b/HIP_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_CACHE_PREFER_EQUAL\b/hipFuncCachePreferEqual/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_CACHE_PREFER_L1\b/hipFuncCachePreferL1/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_CACHE_PREFER_NONE\b/hipFuncCachePreferNone/g; - $ft{'numeric_literal'} += s/\bCU_FUNC_CACHE_PREFER_SHARED\b/hipFuncCachePreferShared/g; - $ft{'numeric_literal'} += s/\bCU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS\b/hipIpcMemLazyEnablePeerAccess/g; - $ft{'numeric_literal'} += s/\bCU_JIT_CACHE_MODE\b/hipJitOptionCacheMode/g; - $ft{'numeric_literal'} += s/\bCU_JIT_ERROR_LOG_BUFFER\b/hipJitOptionErrorLogBuffer/g; - $ft{'numeric_literal'} += s/\bCU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES\b/hipJitOptionErrorLogBufferSizeBytes/g; - $ft{'numeric_literal'} += s/\bCU_JIT_FALLBACK_STRATEGY\b/hipJitOptionFallbackStrategy/g; - $ft{'numeric_literal'} += s/\bCU_JIT_FAST_COMPILE\b/hipJitOptionFastCompile/g; - $ft{'numeric_literal'} += s/\bCU_JIT_GENERATE_DEBUG_INFO\b/hipJitOptionGenerateDebugInfo/g; - $ft{'numeric_literal'} += s/\bCU_JIT_GENERATE_LINE_INFO\b/hipJitOptionGenerateLineInfo/g; - $ft{'numeric_literal'} += s/\bCU_JIT_GLOBAL_SYMBOL_ADDRESSES\b/hipJitGlobalSymbolAddresses/g; - $ft{'numeric_literal'} += s/\bCU_JIT_GLOBAL_SYMBOL_COUNT\b/hipJitGlobalSymbolCount/g; - $ft{'numeric_literal'} += s/\bCU_JIT_GLOBAL_SYMBOL_NAMES\b/hipJitGlobalSymbolNames/g; - $ft{'numeric_literal'} += s/\bCU_JIT_INFO_LOG_BUFFER\b/hipJitOptionInfoLogBuffer/g; - $ft{'numeric_literal'} += s/\bCU_JIT_INFO_LOG_BUFFER_SIZE_BYTES\b/hipJitOptionInfoLogBufferSizeBytes/g; - $ft{'numeric_literal'} += s/\bCU_JIT_LOG_VERBOSE\b/hipJitOptionLogVerbose/g; - $ft{'numeric_literal'} += s/\bCU_JIT_MAX_REGISTERS\b/hipJitOptionMaxRegisters/g; - $ft{'numeric_literal'} += s/\bCU_JIT_NEW_SM3X_OPT\b/hipJitOptionSm3xOpt/g; - $ft{'numeric_literal'} += s/\bCU_JIT_NUM_OPTIONS\b/hipJitOptionNumOptions/g; - $ft{'numeric_literal'} += s/\bCU_JIT_OPTIMIZATION_LEVEL\b/hipJitOptionOptimizationLevel/g; - $ft{'numeric_literal'} += s/\bCU_JIT_TARGET\b/hipJitOptionTarget/g; - $ft{'numeric_literal'} += s/\bCU_JIT_TARGET_FROM_CUCONTEXT\b/hipJitOptionTargetFromContext/g; - $ft{'numeric_literal'} += s/\bCU_JIT_THREADS_PER_BLOCK\b/hipJitOptionThreadsPerBlock/g; - $ft{'numeric_literal'} += s/\bCU_JIT_WALL_TIME\b/hipJitOptionWallTime/g; - $ft{'numeric_literal'} += s/\bCU_LIMIT_MALLOC_HEAP_SIZE\b/hipLimitMallocHeapSize/g; - $ft{'numeric_literal'} += s/\bCU_MEMORYTYPE_ARRAY\b/hipMemoryTypeArray/g; - $ft{'numeric_literal'} += s/\bCU_MEMORYTYPE_DEVICE\b/hipMemoryTypeDevice/g; - $ft{'numeric_literal'} += s/\bCU_MEMORYTYPE_HOST\b/hipMemoryTypeHost/g; - $ft{'numeric_literal'} += s/\bCU_MEMORYTYPE_UNIFIED\b/hipMemoryTypeUnified/g; - $ft{'numeric_literal'} += s/\bCU_MEM_ATTACH_GLOBAL\b/hipMemAttachGlobal/g; - $ft{'numeric_literal'} += s/\bCU_MEM_ATTACH_HOST\b/hipMemAttachHost/g; - $ft{'numeric_literal'} += s/\bCU_OCCUPANCY_DEFAULT\b/hipOccupancyDefault/g; - $ft{'numeric_literal'} += s/\bCU_RESOURCE_TYPE_ARRAY\b/hipResourceTypeArray/g; - $ft{'numeric_literal'} += s/\bCU_RESOURCE_TYPE_LINEAR\b/hipResourceTypeLinear/g; - $ft{'numeric_literal'} += s/\bCU_RESOURCE_TYPE_MIPMAPPED_ARRAY\b/hipResourceTypeMipmappedArray/g; - $ft{'numeric_literal'} += s/\bCU_RESOURCE_TYPE_PITCH2D\b/hipResourceTypePitch2D/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_1X16\b/hipResViewFormatHalf1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_1X32\b/hipResViewFormatFloat1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_2X16\b/hipResViewFormatHalf2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_2X32\b/hipResViewFormatFloat2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_4X16\b/hipResViewFormatHalf4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_FLOAT_4X32\b/hipResViewFormatFloat4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_NONE\b/hipResViewFormatNone/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SIGNED_BC4\b/hipResViewFormatSignedBlockCompressed4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SIGNED_BC5\b/hipResViewFormatSignedBlockCompressed5/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SIGNED_BC6H\b/hipResViewFormatSignedBlockCompressed6H/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_1X16\b/hipResViewFormatSignedShort1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_1X32\b/hipResViewFormatSignedInt1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_1X8\b/hipResViewFormatSignedChar1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_2X16\b/hipResViewFormatSignedShort2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_2X32\b/hipResViewFormatSignedInt2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_2X8\b/hipResViewFormatSignedChar2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_4X16\b/hipResViewFormatSignedShort4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_4X32\b/hipResViewFormatSignedInt4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_SINT_4X8\b/hipResViewFormatSignedChar4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_1X16\b/hipResViewFormatUnsignedShort1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_1X32\b/hipResViewFormatUnsignedInt1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_1X8\b/hipResViewFormatUnsignedChar1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_2X16\b/hipResViewFormatUnsignedShort2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_2X32\b/hipResViewFormatUnsignedInt2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_2X8\b/hipResViewFormatUnsignedChar2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_4X16\b/hipResViewFormatUnsignedShort4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_4X32\b/hipResViewFormatUnsignedInt4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UINT_4X8\b/hipResViewFormatUnsignedChar4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC1\b/hipResViewFormatUnsignedBlockCompressed1/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC2\b/hipResViewFormatUnsignedBlockCompressed2/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC3\b/hipResViewFormatUnsignedBlockCompressed3/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC4\b/hipResViewFormatUnsignedBlockCompressed4/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC5\b/hipResViewFormatUnsignedBlockCompressed5/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC6H\b/hipResViewFormatUnsignedBlockCompressed6H/g; - $ft{'numeric_literal'} += s/\bCU_RES_VIEW_FORMAT_UNSIGNED_BC7\b/hipResViewFormatUnsignedBlockCompressed7/g; - $ft{'numeric_literal'} += s/\bCU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE\b/hipSharedMemBankSizeDefault/g; - $ft{'numeric_literal'} += s/\bCU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE\b/hipSharedMemBankSizeEightByte/g; - $ft{'numeric_literal'} += s/\bCU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE\b/hipSharedMemBankSizeFourByte/g; - $ft{'numeric_literal'} += s/\bCU_STREAM_DEFAULT\b/hipStreamDefault/g; - $ft{'numeric_literal'} += s/\bCU_STREAM_NON_BLOCKING\b/hipStreamNonBlocking/g; - $ft{'numeric_literal'} += s/\bCU_TR_ADDRESS_MODE_BORDER\b/hipAddressModeBorder/g; - $ft{'numeric_literal'} += s/\bCU_TR_ADDRESS_MODE_CLAMP\b/hipAddressModeClamp/g; - $ft{'numeric_literal'} += s/\bCU_TR_ADDRESS_MODE_MIRROR\b/hipAddressModeMirror/g; - $ft{'numeric_literal'} += s/\bCU_TR_ADDRESS_MODE_WRAP\b/hipAddressModeWrap/g; - $ft{'numeric_literal'} += s/\bCU_TR_FILTER_MODE_LINEAR\b/hipFilterModeLinear/g; - $ft{'numeric_literal'} += s/\bCU_TR_FILTER_MODE_POINT\b/hipFilterModePoint/g; - $ft{'numeric_literal'} += s/\bcudaAddressModeBorder\b/hipAddressModeBorder/g; - $ft{'numeric_literal'} += s/\bcudaAddressModeClamp\b/hipAddressModeClamp/g; - $ft{'numeric_literal'} += s/\bcudaAddressModeMirror\b/hipAddressModeMirror/g; - $ft{'numeric_literal'} += s/\bcudaAddressModeWrap\b/hipAddressModeWrap/g; - $ft{'numeric_literal'} += s/\bcudaBoundaryModeClamp\b/hipBoundaryModeClamp/g; - $ft{'numeric_literal'} += s/\bcudaBoundaryModeTrap\b/hipBoundaryModeTrap/g; - $ft{'numeric_literal'} += s/\bcudaBoundaryModeZero\b/hipBoundaryModeZero/g; - $ft{'numeric_literal'} += s/\bcudaChannelFormatKindFloat\b/hipChannelFormatKindFloat/g; - $ft{'numeric_literal'} += s/\bcudaChannelFormatKindNone\b/hipChannelFormatKindNone/g; - $ft{'numeric_literal'} += s/\bcudaChannelFormatKindSigned\b/hipChannelFormatKindSigned/g; - $ft{'numeric_literal'} += s/\bcudaChannelFormatKindUnsigned\b/hipChannelFormatKindUnsigned/g; - $ft{'numeric_literal'} += s/\bcudaComputeModeDefault\b/hipComputeModeDefault/g; - $ft{'numeric_literal'} += s/\bcudaComputeModeExclusive\b/hipComputeModeExclusive/g; - $ft{'numeric_literal'} += s/\bcudaComputeModeExclusiveProcess\b/hipComputeModeExclusiveProcess/g; - $ft{'numeric_literal'} += s/\bcudaComputeModeProhibited\b/hipComputeModeProhibited/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrCanMapHostMemory\b/hipDeviceAttributeCanMapHostMemory/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrClockRate\b/hipDeviceAttributeClockRate/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrComputeCapabilityMajor\b/hipDeviceAttributeComputeCapabilityMajor/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrComputeCapabilityMinor\b/hipDeviceAttributeComputeCapabilityMinor/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrComputeMode\b/hipDeviceAttributeComputeMode/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrConcurrentKernels\b/hipDeviceAttributeConcurrentKernels/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrCooperativeLaunch\b/hipDeviceAttributeCooperativeLaunch/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrCooperativeMultiDeviceLaunch\b/hipDeviceAttributeCooperativeMultiDeviceLaunch/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrEccEnabled\b/hipDeviceAttributeEccEnabled/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrGlobalMemoryBusWidth\b/hipDeviceAttributeMemoryBusWidth/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrIntegrated\b/hipDeviceAttributeIntegrated/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrIsMultiGpuBoard\b/hipDeviceAttributeIsMultiGpuBoard/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrKernelExecTimeout\b/hipDeviceAttributeKernelExecTimeout/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrL2CacheSize\b/hipDeviceAttributeL2CacheSize/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxBlockDimX\b/hipDeviceAttributeMaxBlockDimX/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxBlockDimY\b/hipDeviceAttributeMaxBlockDimY/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxBlockDimZ\b/hipDeviceAttributeMaxBlockDimZ/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxGridDimX\b/hipDeviceAttributeMaxGridDimX/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxGridDimY\b/hipDeviceAttributeMaxGridDimY/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxGridDimZ\b/hipDeviceAttributeMaxGridDimZ/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxPitch\b/hipDeviceAttributeMaxPitch/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxRegistersPerBlock\b/hipDeviceAttributeMaxRegistersPerBlock/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxSharedMemoryPerBlock\b/hipDeviceAttributeMaxSharedMemoryPerBlock/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxSharedMemoryPerMultiprocessor\b/hipDeviceAttributeMaxSharedMemoryPerMultiprocessor/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture1DWidth\b/hipDeviceAttributeMaxTexture1DWidth/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture2DHeight\b/hipDeviceAttributeMaxTexture2DHeight/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture2DWidth\b/hipDeviceAttributeMaxTexture2DWidth/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture3DDepth\b/hipDeviceAttributeMaxTexture3DDepth/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture3DHeight\b/hipDeviceAttributeMaxTexture3DHeight/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxTexture3DWidth\b/hipDeviceAttributeMaxTexture3DWidth/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxThreadsPerBlock\b/hipDeviceAttributeMaxThreadsPerBlock/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMaxThreadsPerMultiProcessor\b/hipDeviceAttributeMaxThreadsPerMultiProcessor/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMemoryClockRate\b/hipDeviceAttributeMemoryClockRate/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrMultiProcessorCount\b/hipDeviceAttributeMultiprocessorCount/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrPciBusId\b/hipDeviceAttributePciBusId/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrPciDeviceId\b/hipDeviceAttributePciDeviceId/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrTextureAlignment\b/hipDeviceAttributeTextureAlignment/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrTotalConstantMemory\b/hipDeviceAttributeTotalConstantMemory/g; - $ft{'numeric_literal'} += s/\bcudaDevAttrWarpSize\b/hipDeviceAttributeWarpSize/g; - $ft{'numeric_literal'} += s/\bcudaErrorAlreadyAcquired\b/hipErrorAlreadyAcquired/g; - $ft{'numeric_literal'} += s/\bcudaErrorAlreadyMapped\b/hipErrorAlreadyMapped/g; - $ft{'numeric_literal'} += s/\bcudaErrorArrayIsMapped\b/hipErrorArrayIsMapped/g; - $ft{'numeric_literal'} += s/\bcudaErrorAssert\b/hipErrorAssert/g; - $ft{'numeric_literal'} += s/\bcudaErrorCooperativeLaunchTooLarge\b/hipErrorCooperativeLaunchTooLarge/g; - $ft{'numeric_literal'} += s/\bcudaErrorCudartUnloading\b/hipErrorDeinitialized/g; - $ft{'numeric_literal'} += s/\bcudaErrorDeviceAlreadyInUse\b/hipErrorContextAlreadyInUse/g; - $ft{'numeric_literal'} += s/\bcudaErrorDeviceUninitialized\b/hipErrorInvalidContext/g; - $ft{'numeric_literal'} += s/\bcudaErrorDeviceUninitilialized\b/hipErrorInvalidContext/g; - $ft{'numeric_literal'} += s/\bcudaErrorECCUncorrectable\b/hipErrorECCNotCorrectable/g; - $ft{'numeric_literal'} += s/\bcudaErrorFileNotFound\b/hipErrorFileNotFound/g; - $ft{'numeric_literal'} += s/\bcudaErrorHostMemoryAlreadyRegistered\b/hipErrorHostMemoryAlreadyRegistered/g; - $ft{'numeric_literal'} += s/\bcudaErrorHostMemoryNotRegistered\b/hipErrorHostMemoryNotRegistered/g; - $ft{'numeric_literal'} += s/\bcudaErrorIllegalAddress\b/hipErrorIllegalAddress/g; - $ft{'numeric_literal'} += s/\bcudaErrorInitializationError\b/hipErrorNotInitialized/g; - $ft{'numeric_literal'} += s/\bcudaErrorInsufficientDriver\b/hipErrorInsufficientDriver/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidConfiguration\b/hipErrorInvalidConfiguration/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidDevice\b/hipErrorInvalidDevice/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidDeviceFunction\b/hipErrorInvalidDeviceFunction/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidDevicePointer\b/hipErrorInvalidDevicePointer/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidGraphicsContext\b/hipErrorInvalidGraphicsContext/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidKernelImage\b/hipErrorInvalidImage/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidMemcpyDirection\b/hipErrorInvalidMemcpyDirection/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidPtx\b/hipErrorInvalidKernelFile/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidResourceHandle\b/hipErrorInvalidHandle/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidSource\b/hipErrorInvalidSource/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidSymbol\b/hipErrorInvalidSymbol/g; - $ft{'numeric_literal'} += s/\bcudaErrorInvalidValue\b/hipErrorInvalidValue/g; - $ft{'numeric_literal'} += s/\bcudaErrorLaunchFailure\b/hipErrorLaunchFailure/g; - $ft{'numeric_literal'} += s/\bcudaErrorLaunchOutOfResources\b/hipErrorLaunchOutOfResources/g; - $ft{'numeric_literal'} += s/\bcudaErrorLaunchTimeout\b/hipErrorLaunchTimeOut/g; - $ft{'numeric_literal'} += s/\bcudaErrorMapBufferObjectFailed\b/hipErrorMapFailed/g; - $ft{'numeric_literal'} += s/\bcudaErrorMemoryAllocation\b/hipErrorOutOfMemory/g; - $ft{'numeric_literal'} += s/\bcudaErrorMissingConfiguration\b/hipErrorMissingConfiguration/g; - $ft{'numeric_literal'} += s/\bcudaErrorNoDevice\b/hipErrorNoDevice/g; - $ft{'numeric_literal'} += s/\bcudaErrorNoKernelImageForDevice\b/hipErrorNoBinaryForGpu/g; - $ft{'numeric_literal'} += s/\bcudaErrorNotMapped\b/hipErrorNotMapped/g; - $ft{'numeric_literal'} += s/\bcudaErrorNotMappedAsArray\b/hipErrorNotMappedAsArray/g; - $ft{'numeric_literal'} += s/\bcudaErrorNotMappedAsPointer\b/hipErrorNotMappedAsPointer/g; - $ft{'numeric_literal'} += s/\bcudaErrorNotReady\b/hipErrorNotReady/g; - $ft{'numeric_literal'} += s/\bcudaErrorNotSupported\b/hipErrorNotSupported/g; - $ft{'numeric_literal'} += s/\bcudaErrorOperatingSystem\b/hipErrorOperatingSystem/g; - $ft{'numeric_literal'} += s/\bcudaErrorPeerAccessAlreadyEnabled\b/hipErrorPeerAccessAlreadyEnabled/g; - $ft{'numeric_literal'} += s/\bcudaErrorPeerAccessNotEnabled\b/hipErrorPeerAccessNotEnabled/g; - $ft{'numeric_literal'} += s/\bcudaErrorPeerAccessUnsupported\b/hipErrorPeerAccessUnsupported/g; - $ft{'numeric_literal'} += s/\bcudaErrorPriorLaunchFailure\b/hipErrorPriorLaunchFailure/g; - $ft{'numeric_literal'} += s/\bcudaErrorProfilerAlreadyStarted\b/hipErrorProfilerAlreadyStarted/g; - $ft{'numeric_literal'} += s/\bcudaErrorProfilerAlreadyStopped\b/hipErrorProfilerAlreadyStopped/g; - $ft{'numeric_literal'} += s/\bcudaErrorProfilerDisabled\b/hipErrorProfilerDisabled/g; - $ft{'numeric_literal'} += s/\bcudaErrorProfilerNotInitialized\b/hipErrorProfilerNotInitialized/g; - $ft{'numeric_literal'} += s/\bcudaErrorSetOnActiveProcess\b/hipErrorSetOnActiveProcess/g; - $ft{'numeric_literal'} += s/\bcudaErrorSharedObjectInitFailed\b/hipErrorSharedObjectInitFailed/g; - $ft{'numeric_literal'} += s/\bcudaErrorSharedObjectSymbolNotFound\b/hipErrorSharedObjectSymbolNotFound/g; - $ft{'numeric_literal'} += s/\bcudaErrorSymbolNotFound\b/hipErrorNotFound/g; - $ft{'numeric_literal'} += s/\bcudaErrorUnknown\b/hipErrorUnknown/g; - $ft{'numeric_literal'} += s/\bcudaErrorUnmapBufferObjectFailed\b/hipErrorUnmapFailed/g; - $ft{'numeric_literal'} += s/\bcudaErrorUnsupportedLimit\b/hipErrorUnsupportedLimit/g; - $ft{'numeric_literal'} += s/\bcudaFilterModeLinear\b/hipFilterModeLinear/g; - $ft{'numeric_literal'} += s/\bcudaFilterModePoint\b/hipFilterModePoint/g; - $ft{'numeric_literal'} += s/\bcudaFuncCachePreferEqual\b/hipFuncCachePreferEqual/g; - $ft{'numeric_literal'} += s/\bcudaFuncCachePreferL1\b/hipFuncCachePreferL1/g; - $ft{'numeric_literal'} += s/\bcudaFuncCachePreferNone\b/hipFuncCachePreferNone/g; - $ft{'numeric_literal'} += s/\bcudaFuncCachePreferShared\b/hipFuncCachePreferShared/g; - $ft{'numeric_literal'} += s/\bcudaLimitMallocHeapSize\b/hipLimitMallocHeapSize/g; - $ft{'numeric_literal'} += s/\bcudaMemcpyDefault\b/hipMemcpyDefault/g; - $ft{'numeric_literal'} += s/\bcudaMemcpyDeviceToDevice\b/hipMemcpyDeviceToDevice/g; - $ft{'numeric_literal'} += s/\bcudaMemcpyDeviceToHost\b/hipMemcpyDeviceToHost/g; - $ft{'numeric_literal'} += s/\bcudaMemcpyHostToDevice\b/hipMemcpyHostToDevice/g; - $ft{'numeric_literal'} += s/\bcudaMemcpyHostToHost\b/hipMemcpyHostToHost/g; - $ft{'numeric_literal'} += s/\bcudaReadModeElementType\b/hipReadModeElementType/g; - $ft{'numeric_literal'} += s/\bcudaReadModeNormalizedFloat\b/hipReadModeNormalizedFloat/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatFloat1\b/hipResViewFormatFloat1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatFloat2\b/hipResViewFormatFloat2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatFloat4\b/hipResViewFormatFloat4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatHalf1\b/hipResViewFormatHalf1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatHalf2\b/hipResViewFormatHalf2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatHalf4\b/hipResViewFormatHalf4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatNone\b/hipResViewFormatNone/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedBlockCompressed4\b/hipResViewFormatSignedBlockCompressed4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedBlockCompressed5\b/hipResViewFormatSignedBlockCompressed5/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedBlockCompressed6H\b/hipResViewFormatSignedBlockCompressed6H/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedChar1\b/hipResViewFormatSignedChar1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedChar2\b/hipResViewFormatSignedChar2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedChar4\b/hipResViewFormatSignedChar4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedInt1\b/hipResViewFormatSignedInt1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedInt2\b/hipResViewFormatSignedInt2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedInt4\b/hipResViewFormatSignedInt4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedShort1\b/hipResViewFormatSignedShort1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedShort2\b/hipResViewFormatSignedShort2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatSignedShort4\b/hipResViewFormatSignedShort4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed1\b/hipResViewFormatUnsignedBlockCompressed1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed2\b/hipResViewFormatUnsignedBlockCompressed2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed3\b/hipResViewFormatUnsignedBlockCompressed3/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed4\b/hipResViewFormatUnsignedBlockCompressed4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed5\b/hipResViewFormatUnsignedBlockCompressed5/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed6H\b/hipResViewFormatUnsignedBlockCompressed6H/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedBlockCompressed7\b/hipResViewFormatUnsignedBlockCompressed7/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedChar1\b/hipResViewFormatUnsignedChar1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedChar2\b/hipResViewFormatUnsignedChar2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedChar4\b/hipResViewFormatUnsignedChar4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedInt1\b/hipResViewFormatUnsignedInt1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedInt2\b/hipResViewFormatUnsignedInt2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedInt4\b/hipResViewFormatUnsignedInt4/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedShort1\b/hipResViewFormatUnsignedShort1/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedShort2\b/hipResViewFormatUnsignedShort2/g; - $ft{'numeric_literal'} += s/\bcudaResViewFormatUnsignedShort4\b/hipResViewFormatUnsignedShort4/g; - $ft{'numeric_literal'} += s/\bcudaResourceTypeArray\b/hipResourceTypeArray/g; - $ft{'numeric_literal'} += s/\bcudaResourceTypeLinear\b/hipResourceTypeLinear/g; - $ft{'numeric_literal'} += s/\bcudaResourceTypeMipmappedArray\b/hipResourceTypeMipmappedArray/g; - $ft{'numeric_literal'} += s/\bcudaResourceTypePitch2D\b/hipResourceTypePitch2D/g; - $ft{'numeric_literal'} += s/\bcudaSharedMemBankSizeDefault\b/hipSharedMemBankSizeDefault/g; - $ft{'numeric_literal'} += s/\bcudaSharedMemBankSizeEightByte\b/hipSharedMemBankSizeEightByte/g; - $ft{'numeric_literal'} += s/\bcudaSharedMemBankSizeFourByte\b/hipSharedMemBankSizeFourByte/g; - $ft{'numeric_literal'} += s/\bcudaSuccess\b/hipSuccess/g; - $ft{'define'} += s/\bCUDA_ARRAY3D_CUBEMAP\b/hipArrayCubemap/g; - $ft{'define'} += s/\bCUDA_ARRAY3D_LAYERED\b/hipArrayLayered/g; - $ft{'define'} += s/\bCUDA_ARRAY3D_SURFACE_LDST\b/hipArraySurfaceLoadStore/g; - $ft{'define'} += s/\bCUDA_ARRAY3D_TEXTURE_GATHER\b/hipArrayTextureGather/g; - $ft{'define'} += s/\bCUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC\b/hipCooperativeLaunchMultiDeviceNoPostSync/g; - $ft{'define'} += s/\bCUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC\b/hipCooperativeLaunchMultiDeviceNoPreSync/g; - $ft{'define'} += s/\bCU_LAUNCH_PARAM_BUFFER_POINTER\b/HIP_LAUNCH_PARAM_BUFFER_POINTER/g; - $ft{'define'} += s/\bCU_LAUNCH_PARAM_BUFFER_SIZE\b/HIP_LAUNCH_PARAM_BUFFER_SIZE/g; - $ft{'define'} += s/\bCU_LAUNCH_PARAM_END\b/HIP_LAUNCH_PARAM_END/g; - $ft{'define'} += s/\bCU_MEMHOSTALLOC_DEVICEMAP\b/hipHostMallocMapped/g; - $ft{'define'} += s/\bCU_MEMHOSTALLOC_PORTABLE\b/hipHostMallocPortable/g; - $ft{'define'} += s/\bCU_MEMHOSTALLOC_WRITECOMBINED\b/hipHostMallocWriteCombined/g; - $ft{'define'} += s/\bCU_MEMHOSTREGISTER_DEVICEMAP\b/hipHostRegisterMapped/g; - $ft{'define'} += s/\bCU_MEMHOSTREGISTER_IOMEMORY\b/hipHostRegisterIoMemory/g; - $ft{'define'} += s/\bCU_MEMHOSTREGISTER_PORTABLE\b/hipHostRegisterPortable/g; - $ft{'define'} += s/\bCU_TRSA_OVERRIDE_FORMAT\b/HIP_TRSA_OVERRIDE_FORMAT/g; - $ft{'define'} += s/\bCU_TRSF_NORMALIZED_COORDINATES\b/HIP_TRSF_NORMALIZED_COORDINATES/g; - $ft{'define'} += s/\bCU_TRSF_READ_AS_INTEGER\b/HIP_TRSF_READ_AS_INTEGER/g; - $ft{'define'} += s/\bREGISTER_CUDA_OPERATOR\b/REGISTER_HIP_OPERATOR/g; - $ft{'define'} += s/\bREGISTER_CUDA_OPERATOR_CREATOR\b/REGISTER_HIP_OPERATOR_CREATOR/g; - $ft{'define'} += s/\b__CUDACC__\b/__HIPCC__/g; - $ft{'define'} += s/\bcudaArrayCubemap\b/hipArrayCubemap/g; - $ft{'define'} += s/\bcudaArrayDefault\b/hipArrayDefault/g; - $ft{'define'} += s/\bcudaArrayLayered\b/hipArrayLayered/g; - $ft{'define'} += s/\bcudaArraySurfaceLoadStore\b/hipArraySurfaceLoadStore/g; - $ft{'define'} += s/\bcudaArrayTextureGather\b/hipArrayTextureGather/g; - $ft{'define'} += s/\bcudaCooperativeLaunchMultiDeviceNoPostSync\b/hipCooperativeLaunchMultiDeviceNoPostSync/g; - $ft{'define'} += s/\bcudaCooperativeLaunchMultiDeviceNoPreSync\b/hipCooperativeLaunchMultiDeviceNoPreSync/g; - $ft{'define'} += s/\bcudaDeviceBlockingSync\b/hipDeviceScheduleBlockingSync/g; - $ft{'define'} += s/\bcudaDeviceLmemResizeToMax\b/hipDeviceLmemResizeToMax/g; - $ft{'define'} += s/\bcudaDeviceMapHost\b/hipDeviceMapHost/g; - $ft{'define'} += s/\bcudaDeviceScheduleAuto\b/hipDeviceScheduleAuto/g; - $ft{'define'} += s/\bcudaDeviceScheduleBlockingSync\b/hipDeviceScheduleBlockingSync/g; - $ft{'define'} += s/\bcudaDeviceScheduleMask\b/hipDeviceScheduleMask/g; - $ft{'define'} += s/\bcudaDeviceScheduleSpin\b/hipDeviceScheduleSpin/g; - $ft{'define'} += s/\bcudaDeviceScheduleYield\b/hipDeviceScheduleYield/g; - $ft{'define'} += s/\bcudaEventBlockingSync\b/hipEventBlockingSync/g; - $ft{'define'} += s/\bcudaEventDefault\b/hipEventDefault/g; - $ft{'define'} += s/\bcudaEventDisableTiming\b/hipEventDisableTiming/g; - $ft{'define'} += s/\bcudaEventInterprocess\b/hipEventInterprocess/g; - $ft{'define'} += s/\bcudaHostAllocDefault\b/hipHostMallocDefault/g; - $ft{'define'} += s/\bcudaHostAllocMapped\b/hipHostMallocMapped/g; - $ft{'define'} += s/\bcudaHostAllocPortable\b/hipHostMallocPortable/g; - $ft{'define'} += s/\bcudaHostAllocWriteCombined\b/hipHostMallocWriteCombined/g; - $ft{'define'} += s/\bcudaHostRegisterDefault\b/hipHostRegisterDefault/g; - $ft{'define'} += s/\bcudaHostRegisterIoMemory\b/hipHostRegisterIoMemory/g; - $ft{'define'} += s/\bcudaHostRegisterMapped\b/hipHostRegisterMapped/g; - $ft{'define'} += s/\bcudaHostRegisterPortable\b/hipHostRegisterPortable/g; - $ft{'define'} += s/\bcudaIpcMemLazyEnablePeerAccess\b/hipIpcMemLazyEnablePeerAccess/g; - $ft{'define'} += s/\bcudaMemAttachGlobal\b/hipMemAttachGlobal/g; - $ft{'define'} += s/\bcudaMemAttachHost\b/hipMemAttachHost/g; - $ft{'define'} += s/\bcudaOccupancyDefault\b/hipOccupancyDefault/g; - $ft{'define'} += s/\bcudaStreamDefault\b/hipStreamDefault/g; - $ft{'define'} += s/\bcudaStreamNonBlocking\b/hipStreamNonBlocking/g; - $ft{'define'} += s/\bcudaTextureType1D\b/hipTextureType1D/g; - $ft{'define'} += s/\bcudaTextureType1DLayered\b/hipTextureType1DLayered/g; - $ft{'define'} += s/\bcudaTextureType2D\b/hipTextureType2D/g; - $ft{'define'} += s/\bcudaTextureType2DLayered\b/hipTextureType2DLayered/g; - $ft{'define'} += s/\bcudaTextureType3D\b/hipTextureType3D/g; - $ft{'define'} += s/\bcudaTextureTypeCubemap\b/hipTextureTypeCubemap/g; - $ft{'define'} += s/\bcudaTextureTypeCubemapLayered\b/hipTextureTypeCubemapLayered/g; -} - -# CUDA Kernel Launch Syntax -sub transformKernelLaunch { - no warnings qw/uninitialized/; - my $k = 0; - - # Handle the kern<...><<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), $5, $6)/g; - # Handle the kern<<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL($1, dim3($2), dim3($3), $4, $5)/g; - - # Handle the kern<...><<>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), $5, $6, /g; - # Handle the kern<<>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL($1, dim3($2), dim3($3), $4, $5, /g; - - # Handle the kern<...><<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), $5, 0)/g; - # Handle the kern<<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL($1, dim3($2), dim3($3), $4, 0)/g; - - # Handle the kern<...><>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), $5, 0, /g; - # Handle the kern<<>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL($1, dim3($2), dim3($3), $4, 0, /g; - - # Handle the kern<...><<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), 0, 0)/g; - # Handle the kern<<>>() syntax with empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\((\s*)\)/hipLaunchKernelGGL($1, dim3($2), dim3($3), 0, 0)/g; - - # Handle the kern<...><<>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<(.+)>\s*<<<\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL(HIP_KERNEL_NAME($1<$2>), dim3($3), dim3($4), 0, 0, /g; - # Handle the kern<<>>(...) syntax with non-empty args: - $k += s/([:|\w]+)\s*<<<\s*(.+)\s*,\s*(.+)\s*>>>(\s*)\(/hipLaunchKernelGGL($1, dim3($2), dim3($3), 0, 0, /g; - - if ($k) { - $ft{'kernel_launch'} += $k; - $Tkernels{$1}++; - } -} - -sub transformCubNamespace { - my $k = 0; - $k += s/using\s*namespace\s*cub/using namespace hipcub/g; - $k += s/\bcub::\b/hipcub::/g; - return $k; -} - -sub transformHostFunctions { - my $k = 0; - foreach $func ( - "hipMemcpyToSymbol", - "hipMemcpyToSymbolAsync" - ) - { - $k += s/(?\($2\),/g - } - foreach $func ( - "hipFuncGetAttributes" - ) - { - $k += s/(?\($3\)$4/g; - } - return $k; -} - -sub countSupportedDeviceFunctions { - my $k = 0; - foreach $func ( - "__brev", - "__brevll", - "__byte_perm", - "__clz", - "__clzll", - "__cosf", - "__double2int_rz", - "__double2ll_rz", - "__double2uint_rz", - "__double2ull_rz", - "__exp10f", - "__expf", - "__fadd_rd", - "__fadd_rn", - "__fadd_ru", - "__fadd_rz", - "__fdiv_rd", - "__fdiv_rn", - "__fdiv_ru", - "__fdiv_rz", - "__fdividef", - "__ffs", - "__ffsll", - "__float22half2_rn", - "__float2half", - "__float2half2_rn", - "__float2half_rd", - "__float2half_rn", - "__float2half_ru", - "__float2half_rz", - "__float2int_rd", - "__float2int_rn", - "__float2int_ru", - "__float2int_rz", - "__float2ll_rd", - "__float2ll_rn", - "__float2ll_ru", - "__float2ll_rz", - "__float2uint_rd", - "__float2uint_rn", - "__float2uint_ru", - "__float2uint_rz", - "__float2ull_rd", - "__float2ull_rn", - "__float2ull_ru", - "__float2ull_rz", - "__float_as_int", - "__float_as_uint", - "__floats2half2_rn", - "__fmaf_rd", - "__fmaf_rn", - "__fmaf_ru", - "__fmaf_rz", - "__fmul_rd", - "__fmul_rn", - "__fmul_ru", - "__fmul_rz", - "__frcp_rd", - "__frcp_rn", - "__frcp_ru", - "__frcp_rz", - "__frsqrt_rn", - "__fsqrt_rd", - "__fsqrt_rn", - "__fsqrt_ru", - "__fsqrt_rz", - "__fsub_rd", - "__fsub_rn", - "__fsub_ru", - "__fsub_rz", - "__h2div", - "__hadd", - "__hadd2", - "__hadd2_sat", - "__hadd_sat", - "__half22float2", - "__half2float", - "__half2half2", - "__half2int_rd", - "__half2int_rn", - "__half2int_ru", - "__half2int_rz", - "__half2ll_rd", - "__half2ll_rn", - "__half2ll_ru", - "__half2ll_rz", - "__half2short_rd", - "__half2short_rn", - "__half2short_ru", - "__half2short_rz", - "__half2uint_rd", - "__half2uint_rn", - "__half2uint_ru", - "__half2uint_rz", - "__half2ull_rd", - "__half2ull_rn", - "__half2ull_ru", - "__half2ull_rz", - "__half2ushort_rd", - "__half2ushort_rn", - "__half2ushort_ru", - "__half2ushort_rz", - "__half_as_short", - "__half_as_ushort", - "__halves2half2", - "__hbeq2", - "__hbequ2", - "__hbge2", - "__hbgeu2", - "__hbgt2", - "__hbgtu2", - "__hble2", - "__hbleu2", - "__hblt2", - "__hbltu2", - "__hbne2", - "__hbneu2", - "__hdiv", - "__heq", - "__heq2", - "__hequ", - "__hequ2", - "__hfma", - "__hfma2", - "__hfma2_sat", - "__hfma_sat", - "__hge", - "__hge2", - "__hgeu", - "__hgeu2", - "__hgt", - "__hgt2", - "__hgtu", - "__hgtu2", - "__high2float", - "__high2half", - "__high2half2", - "__highs2half2", - "__hisinf", - "__hisnan", - "__hisnan2", - "__hle", - "__hle2", - "__hleu", - "__hleu2", - "__hlt", - "__hlt2", - "__hltu", - "__hltu2", - "__hmul", - "__hmul2", - "__hmul2_sat", - "__hmul_sat", - "__hne", - "__hne2", - "__hneg", - "__hneg2", - "__hneu", - "__hneu2", - "__hsub", - "__hsub2", - "__hsub2_sat", - "__hsub_sat", - "__int2float_rd", - "__int2float_rn", - "__int2float_ru", - "__int2float_rz", - "__int2half_rn", - "__int2half_ru", - "__int2half_rz", - "__int_as_float", - "__ldca", - "__ldcg", - "__ldcs", - "__ldg", - "__ll2float_rd", - "__ll2float_rn", - "__ll2float_ru", - "__ll2float_rz", - "__ll2half_rd", - "__ll2half_rn", - "__ll2half_ru", - "__ll2half_rz", - "__log10f", - "__log2f", - "__logf", - "__low2float", - "__low2half", - "__low2half2", - "__lowhigh2highlow", - "__lows2half2", - "__mul24", - "__mul64hi", - "__mulhi", - "__popc", - "__popcll", - "__powf", - "__rhadd", - "__sad", - "__saturatef", - "__short2half_rd", - "__short2half_rn", - "__short2half_ru", - "__short2half_rz", - "__short_as_half", - "__sincosf", - "__sinf", - "__syncthreads", - "__tanf", - "__threadfence", - "__threadfence_block", - "__uhadd", - "__uint2float_rd", - "__uint2float_rn", - "__uint2float_ru", - "__uint2float_rz", - "__uint2half_rd", - "__uint2half_rn", - "__uint2half_ru", - "__uint2half_rz", - "__uint_as_float", - "__ull2float_rd", - "__ull2float_rn", - "__ull2float_ru", - "__ull2float_rz", - "__ull2half_rd", - "__ull2half_rn", - "__ull2half_ru", - "__ull2half_rz", - "__umul24", - "__umul64hi", - "__umulhi", - "__urhadd", - "__usad", - "__ushort2half_rd", - "__ushort2half_rn", - "__ushort2half_ru", - "__ushort2half_rz", - "__ushort_as_half", - "abs", - "acos", - "acosf", - "acosh", - "acoshf", - "asin", - "asinf", - "asinh", - "asinhf", - "atan", - "atan2", - "atan2f", - "atanf", - "atanh", - "atanhf", - "atomicAdd", - "atomicAnd", - "atomicCAS", - "atomicDec", - "atomicExch", - "atomicInc", - "atomicMax", - "atomicMin", - "atomicOr", - "atomicSub", - "atomicXor", - "cbrt", - "cbrtf", - "ceil", - "ceilf", - "copysign", - "copysignf", - "cos", - "cosf", - "cosh", - "coshf", - "cospi", - "cospif", - "cyl_bessel_i0", - "cyl_bessel_i0f", - "cyl_bessel_i1", - "cyl_bessel_i1f", - "erf", - "erfc", - "erfcf", - "erfcinv", - "erfcinvf", - "erfcx", - "erfcxf", - "erff", - "erfinv", - "erfinvf", - "exp", - "exp10", - "exp10f", - "exp2", - "exp2f", - "expf", - "expm1", - "expm1f", - "fabs", - "fabsf", - "fdim", - "fdimf", - "fdivide", - "fdividef", - "floor", - "floorf", - "fma", - "fmaf", - "fmax", - "fmaxf", - "fmin", - "fminf", - "fmod", - "fmodf", - "frexp", - "frexpf", - "h2ceil", - "h2cos", - "h2exp", - "h2exp10", - "h2exp2", - "h2floor", - "h2log", - "h2log10", - "h2log2", - "h2rcp", - "h2rint", - "h2rsqrt", - "h2sin", - "h2sqrt", - "h2trunc", - "hceil", - "hcos", - "hexp", - "hexp10", - "hexp2", - "hfloor", - "hlog", - "hlog10", - "hlog2", - "hrcp", - "hrint", - "hrsqrt", - "hsin", - "hsqrt", - "htrunc", - "hypot", - "hypotf", - "ilogb", - "ilogbf", - "isfinite", - "isinf", - "isnan", - "j0", - "j0f", - "j1", - "j1f", - "jn", - "jnf", - "labs", - "ldexp", - "ldexpf", - "lgamma", - "lgammaf", - "llabs", - "llrint", - "llrintf", - "llround", - "llroundf", - "log", - "log10", - "log10f", - "log1p", - "log1pf", - "log2", - "log2f", - "logb", - "logbf", - "logf", - "lrint", - "lrintf", - "lround", - "lroundf", - "max", - "min", - "modf", - "modff", - "nan", - "nanf", - "nearbyint", - "nearbyintf", - "nextafter", - "nextafterf", - "norm", - "norm3d", - "norm3df", - "norm4d", - "norm4df", - "normcdf", - "normcdff", - "normcdfinv", - "normcdfinvf", - "normf", - "pow", - "powf", - "rcbrt", - "rcbrtf", - "remainder", - "remainderf", - "remquo", - "remquof", - "rhypot", - "rhypotf", - "rint", - "rintf", - "rnorm", - "rnorm3d", - "rnorm3df", - "rnorm4d", - "rnorm4df", - "rnormf", - "round", - "roundf", - "rsqrt", - "rsqrtf", - "scalbln", - "scalblnf", - "scalbn", - "scalbnf", - "signbit", - "sin", - "sincos", - "sincosf", - "sincospi", - "sincospif", - "sinf", - "sinh", - "sinhf", - "sinpi", - "sinpif", - "sqrt", - "sqrtf", - "tan", - "tanf", - "tanh", - "tanhf", - "tgamma", - "tgammaf", - "trunc", - "truncf", - "y0", - "y0f", - "y1", - "y1f", - "yn", - "ynf" - ) - { - # match device function from the list, except those, which have a namespace prefix (aka somenamespace::umin(...)); - # function with only global namespace qualifier '::' (aka ::umin(...)) should be treated as a device function (and warned as well as without such qualifier); - my $mt_namespace = m/(\w+)::($func)\s*\(\s*.*\s*\)/g; - my $mt = m/($func)\s*\(\s*.*\s*\)/g; - if ($mt && !$mt_namespace) { - $k += $mt; - } - } - return $k; -} - -sub warnUnsupportedDeviceFunctions { - my $line_num = shift; - my $k = 0; - foreach $func ( - "_Pow_int", - "__brkpt", - "__finite", - "__finitef", - "__finitel", - "__habs", - "__habs2", - "__isinf", - "__isinff", - "__isinfl", - "__isnan", - "__isnanf", - "__isnanl", - "__pm0", - "__pm1", - "__pm2", - "__pm3", - "__prof_trigger", - "__shfl_down_sync", - "__shfl_sync", - "__shfl_up_sync", - "__shfl_xor_sync", - "__signbit", - "__signbitf", - "__signbitl", - "__trap", - "__vabs2", - "__vabs4", - "__vabsdiffs2", - "__vabsdiffs4", - "__vabsdiffu2", - "__vabsdiffu4", - "__vabsss2", - "__vabsss4", - "__vadd2", - "__vadd4", - "__vaddss2", - "__vaddss4", - "__vaddus2", - "__vaddus4", - "__vavgs2", - "__vavgs4", - "__vavgu2", - "__vavgu4", - "__vcmpeq2", - "__vcmpeq4", - "__vcmpges2", - "__vcmpges4", - "__vcmpgeu2", - "__vcmpgeu4", - "__vcmpgts2", - "__vcmpgts4", - "__vcmpgtu2", - "__vcmpgtu4", - "__vcmples2", - "__vcmples4", - "__vcmpleu4", - "__vcmplts2", - "__vcmplts4", - "__vcmpltu2", - "__vcmpltu4", - "__vcmpne2", - "__vcmpne4", - "__vhaddu2", - "__vhaddu4", - "__vmaxs2", - "__vmaxs4", - "__vmaxu2", - "__vmaxu4", - "__vmins2", - "__vmins4", - "__vminu2", - "__vminu4", - "__vneg2", - "__vneg4", - "__vnegss2", - "__vnegss4", - "__vsads2", - "__vsads4", - "__vsadu2", - "__vsadu4", - "__vseteq2", - "__vseteq4", - "__vsetges2", - "__vsetges4", - "__vsetgeu2", - "__vsetgeu4", - "__vsetgts2", - "__vsetgts4", - "__vsetgtu4", - "__vsetles2", - "__vsetles4", - "__vsetleu2", - "__vsetleu4", - "__vsetlts2", - "__vsetlts4", - "__vsetltu2", - "__vsetltu4", - "__vsetne2", - "__vsetne4", - "__vsub2", - "__vsub4", - "__vsubss2", - "__vsubss4", - "__vsubus2", - "__vsubus4", - "_fdsign", - "_ldsign", - "float2int", - "float_as_int", - "float_as_uint", - "int2float", - "int_as_float", - "llmax", - "llmin", - "mul24", - "mul64hi", - "mulhi", - "saturate", - "uint2float", - "uint_as_float", - "ullmax", - "ullmin", - "umax", - "umin", - "umul24" - ) - { - # match device function from the list, except those, which have a namespace prefix (aka somenamespace::umin(...)); - # function with only global namespace qualifier '::' (aka ::umin(...)) should be treated as a device function (and warned as well as without such qualifier); - my $mt_namespace = m/(\w+)::($func)\s*\(\s*.*\s*\)/g; - my $mt = m/($func)\s*\(\s*.*\s*\)/g; - if ($mt && !$mt_namespace) { - $k += $mt; - print STDERR " warning: $fileName:$line_num: unsupported device function \"$func\": $_\n"; - } - } - return $k; -} - -# Count of transforms in all files -my %tt; -clearStats(\%tt, \@statNames); -$Twarnings = 0; -$TlineCount = 0; -my %TwarningTags; -my $fileCount = @ARGV; - -while (@ARGV) { - $fileName=shift (@ARGV); - if ($inplace) { - my $file_prehip = "$fileName" . ".prehip"; - my $infile; - my $outfile; - if (-e $file_prehip) { - $infile = $file_prehip; - $outfile = $fileName; - } else { - system ("cp $fileName $file_prehip"); - $infile = $file_prehip; - $outfile = $fileName; - } - open(INFILE,"<", $infile) or die "error: could not open $infile"; - open(OUTFILE,">", $outfile) or die "error: could not open $outfile"; - $OUTFILE = OUTFILE; - } else { - open(INFILE,"<", $fileName) or die "error: could not open $fileName"; - $OUTFILE = STDOUT; - } - # Count of transforms in this file - clearStats(\%ft, \@statNames); - my $countIncludes = 0; - my $countKeywords = 0; - my $warnings = 0; - my %warningTags; - my $lineCount = 0; - undef $/; - # Read whole file at once, so we can match newlines - while () { - $countKeywords += m/__global__/; - $countKeywords += m/__shared__/; - simpleSubstitutions(); - transformKernelLaunch(); - transformCubNamespace(); - if ($print_stats) { - while (/(\b(hip|HIP)([A-Z]|_)\w+\b)/g) { - $convertedTags{$1}++; - } - } - my $hasDeviceCode = $countKeywords + $ft{'device_function'}; - unless ($quiet_warnings) { - # Copy into array of lines, process line-by-line to show warnings - if ($hasDeviceCode or (/\bcu|CU/) or (/<<<.*>>>/)) { - my @lines = split /\n/, $_; - # Copy the whole file - my $tmp = $_; - my $line_num = 0; - foreach (@lines) { - $line_num++; - # Remove any whitelisted words - foreach $w (@whitelist) { - s/\b$w\b/ZAP/ - } - my $tag; - if ((/(\bcuda[A-Z]\w+)/) or (/<<<.*>>>/)) { - # Flag any remaining code that look like cuda API calls: may want to add these to hipify - $tag = (defined $1) ? $1 : "Launch"; - } - if (defined $tag) { - $warnings++; - $warningTags{$tag}++; - print STDERR " warning: $fileName:#$line_num : $_\n"; - } - $s = warnUnsupportedDeviceFunctions($line_num); - $warnings += $s; - } - $_ = $tmp; - } - } - if ($hasDeviceCode > 0) { - $ft{'device_function'} += countSupportedDeviceFunctions(); - } - transformHostFunctions(); - # TODO: would like to move this code outside loop but it uses $_ which contains the whole file - unless ($no_output) { - my $apiCalls = $ft{'error'} + $ft{'init'} + $ft{'version'} + $ft{'device'} + $ft{'context'} + $ft{'module'} + $ft{'memory'} + $ft{'virtual_memory'} + $ft{'addressing'} + $ft{'stream'} + $ft{'event'} + $ft{'external_resource_interop'} + $ft{'stream_memory'} + $ft{'execution'} + $ft{'graph'} + $ft{'occupancy'} + $ft{'texture'} + $ft{'surface'} + $ft{'peer'} + $ft{'graphics'} + $ft{'profiler'} + $ft{'openGL'} + $ft{'D3D9'} + $ft{'D3D10'} + $ft{'D3D11'} + $ft{'VDPAU'} + $ft{'EGL'} + $ft{'thread'} + $ft{'complex'} + $ft{'library'} + $ft{'device_library'} + $ft{'include'} + $ft{'include_cuda_main_header'} + $ft{'type'} + $ft{'literal'} + $ft{'numeric_literal'} + $ft{'define'}; - my $kernStuff = $hasDeviceCode + $ft{'kernel_launch'} + $ft{'device_function'}; - my $totalCalls = $apiCalls + $kernStuff; - $is_dos = m/\r\n$/; - if ($totalCalls and ($countIncludes == 0) and ($kernStuff != 0)) { - # TODO: implement hipify-clang's logic with header files AMAP - print $OUTFILE '#include "hip/hip_runtime.h"' . ($is_dos ? "\r\n" : "\n"); - } - print $OUTFILE "$_"; - } - $lineCount = $_ =~ tr/\n//; - } - my $totalConverted = totalStats(\%ft); - if (($totalConverted+$warnings) and $print_stats) { - printStats(" info: converted", \@statNames, \%ft, $warnings, $lineCount); - print STDERR " in '$fileName'\n"; - } - # Update totals for all files - addStats(\%tt, \%ft); - $Twarnings += $warnings; - $TlineCount += $lineCount; - foreach $key (keys %warningTags) { - $TwarningTags{$key} += $warningTags{$key}; - } -} -# Print total stats for all files processed: -if ($print_stats and ($fileCount > 1)) { - print STDERR "\n"; - printStats(" info: TOTAL-converted", \@statNames, \%tt, $Twarnings, $TlineCount); - print STDERR "\n"; - foreach my $key (sort { $TwarningTags{$b} <=> $TwarningTags{$a} } keys %TwarningTags) { - printf STDERR " warning: unconverted %s : %d\n", $key, $TwarningTags{$key}; - } - my $kernelCnt = keys %Tkernels; - printf STDERR " kernels (%d total) : ", $kernelCnt; - foreach my $key (sort { $Tkernels{$b} <=> $Tkernels{$a} } keys %Tkernels) { - printf STDERR " %s(%d)", $key, $Tkernels{$key}; - } - print STDERR "\n\n"; -} -if ($print_stats) { - foreach my $key (sort { $convertedTags{$b} <=> $convertedTags{$a} } keys %convertedTags) { - printf STDERR " %s %d\n", $key, $convertedTags{$key}; - } -} diff --git a/bin/hipvars.pm b/bin/hipvars.pm index 736f4b7e6c..4d79262ea0 100644 --- a/bin/hipvars.pm +++ b/bin/hipvars.pm @@ -60,7 +60,7 @@ sub can_run { } } -$isWindows = $^O eq 'MSWin32'; +$isWindows = ($^O eq 'MSWin32' or $^O eq 'msys'); # # TODO: Fix rpath LDFLAGS settings diff --git a/docs/markdown/hip_bugs.md b/docs/markdown/hip_bugs.md index 46dfa6d0d2..6f872ff89e 100644 --- a/docs/markdown/hip_bugs.md +++ b/docs/markdown/hip_bugs.md @@ -13,75 +13,160 @@ The language specification for HIP and CUDA forbid calling a differences in the strictness of this restriction, with HIP exhibiting a tighter adherence to the specification and thus less tolerant of infringing code. The solution is to ensure that all functions which are called in a -`__device__` context are correctly annotated to reflect it. An interesting case -where these differences emerge is shown below. This relies on a the common -[C++ Member Detector idiom][1], as it would be implemented pre C++11): +`__device__` context are correctly annotated to reflect it. -```c++ -#include +The following is an example of codes using the specification, +``` +#include #include +#include +#include "test_common.h" -struct aye { bool a[1]; }; -struct nay { bool a[2]; }; +static std::random_device dev; +static std::mt19937 rng(dev()); -// Dual restriction is necessary in HIP if the detector is to work for -// __device__ contexts as well as __host__ ones. NVCC is less strict. -template -__host__ __device__ -const T& cref_t(); - -template -struct Has_call_operator { - // Dual restriction is necessary in HIP if the detector is to work for - // __device__ contexts as well as __host__ ones. NVCC is less strict. - template - __host__ __device__ - static - aye test( - C const *, - typename std::enable_if< - (sizeof(cref_t().operator()()) > 0)>::type* = nullptr); - static - nay test(...); - - enum { value = sizeof(test(static_cast(0))) == sizeof(aye) }; -}; - -template::value> -struct Wrapper { - template - V f() const { return T{1}; } -}; - - -template -struct Wrapper { - template - V f() const { return T{10}; } -}; - -// This specialisation will yield a compile-time error, if selected. -template -struct Wrapper {}; - -template -struct Functor; - -template<> struct Functor { - __device__ - float operator()() const { return 42.0f; } -}; - -__device__ -void this_will_not_compile_if_detector_is_not_marked_device() -{ - float f = Wrapper>().f(); +template +__host__ __device__ inline constexpr int count() { + return sizeof(T) / sizeof(M); } -__host__ -void this_will_not_compile_if_detector_is_marked_device_only() -{ - float f = Wrapper>().f(); +inline float getRandomFloat(float min = 10, float max = 100) { + std::uniform_real_distribution gen(min, max); + return gen(rng); +} + +template +void fillMatrix(T* a, int size) { + for (int i = 0; i < size; i++) { + T t; + t.x = getRandomFloat(); + if constexpr (count() >= 2) t.y = getRandomFloat(); + if constexpr (count() >= 3) t.z = getRandomFloat(); + if constexpr (count() >= 4) t.w = getRandomFloat(); + + a[i] = t; + } +} + +// Test operations +template +__host__ __device__ void testOperations(T& a, T& b) { + a.x += b.x; + a.x++; + b.x++; + if constexpr (count() >= 2) { + a.y = b.x; + a.x = b.y; + } + if constexpr (count() >= 3) { + if (a.x > 0) b.x /= a.x; + a.x *= b.z; + a.y--; + } + if constexpr (count() >= 4) { + b.w = a.x; + a.w += (-b.y); + } +} + +template +__global__ void testOperationsGPU(T* d_a, T* d_b, int size) { + int id = threadIdx.x; + if (id > size) return; + T &a = d_a[id]; + T &b = d_b[id]; + + testOperations(a, b); +} + + +template +void dcopy(T* a, T* b, int size) { + for (int i = 0; i < size; i++) { + a[i] = b[i]; + } +} + +template +bool isEqual(T* a, T* b, int size) { + for (int i = 0; i < size; i++) { + if (a[i] != b[i]) { + return false; + } + } + return true; +} + +// Main function that tests type +// T = what you want to test +// D = pack of 1 i.e. float1 int1 +template +void testType(int msize) { + T *fa, *fb, *fc, *h_fa, *h_fb; + fa = new T[msize]; + fb = new T[msize]; + fc = new T[msize]; + h_fa = new T[msize]; + h_fb = new T[msize]; + + T *d_fa, *d_fb; + + constexpr int c = count(); + + if (c <= 0 || c >= 5) { + failed("Invalid Size\n"); + } + + fillMatrix(fa, msize); + dcopy(fb, fa, msize); + dcopy(h_fa, fa, msize); + dcopy(h_fb, fa, msize); + for (int i = 0; i < msize; i++) testOperations(h_fa[i], h_fb[i]); + + hipMalloc(&d_fa, sizeof(T) * msize); + hipMalloc(&d_fb, sizeof(T) * msize); + + hipMemcpy(d_fa, fa, sizeof(T) * msize, hipMemcpyHostToDevice); + hipMemcpy(d_fb, fb, sizeof(T) * msize, hipMemcpyHostToDevice); + + auto kernel = testOperationsGPU; + hipLaunchKernelGGL(kernel, 1, msize, 0, 0, d_fa, d_fb, msize); + + hipMemcpy(fc, d_fa, sizeof(T) * msize, hipMemcpyDeviceToHost); + + bool pass = true; + if (!isEqual(h_fa, fc, msize)) { + pass = false; + } + + delete[] fa; + delete[] fb; + delete[] fc; + delete[] h_fa; + delete[] h_fb; + hipFree(d_fa); + hipFree(d_fb); + + if (!pass) { + failed("Failed"); + } +} + +int main() { + const int msize = 100; + // double + testType(msize); + testType(msize); + testType(msize); + testType(msize); + + // floats + testType(msize); + testType(msize); + testType(msize); + testType(msize); + ... + passed(); } ``` -[1]: https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Member_Detector +For more details for the complete program, please refer to HIP test application at the link, https://github.com/ROCm-Developer-Tools/HIP/blob/main/tests/src/deviceLib/hip_floatnTM.cpp diff --git a/docs/markdown/hip_porting_guide.md b/docs/markdown/hip_porting_guide.md index 74c7fb77d0..4d9075f702 100644 --- a/docs/markdown/hip_porting_guide.md +++ b/docs/markdown/hip_porting_guide.md @@ -56,10 +56,10 @@ and provides practical suggestions on how to port CUDA code and work through com - Starting the port on a CUDA machine is often the easiest approach, since you can incrementally port pieces of the code to HIP while leaving the rest in CUDA. (Recall that on CUDA machines HIP is just a thin layer over CUDA, so the two code types can interoperate on nvcc platforms.) Also, the HIP port can be compared with the original CUDA code for function and performance. - Once the CUDA code is ported to HIP and is running on the CUDA machine, compile the HIP code using the HIP compiler on an AMD machine. - HIP ports can replace CUDA versions: HIP can deliver the same performance as a native CUDA implementation, with the benefit of portability to both Nvidia and AMD architectures as well as a path to future C++ standard support. You can handle platform-specific features through conditional compilation or by adding them to the open-source HIP infrastructure. -- Use **[bin/hipconvertinplace-perl.sh](https://github.com/ROCm-Developer-Tools/HIP/blob/master/bin/hipconvertinplace-perl.sh)** to hipify all code files in the CUDA source directory. +- Use **[hipconvertinplace-perl.sh](https://github.com/ROCm-Developer-Tools/HIPIFY/blob/master/bin/hipconvertinplace-perl.sh)** to hipify all code files in the CUDA source directory. ### Scanning existing CUDA code to scope the porting effort -The hipexamine-perl.sh tool will scan a source directory to determine which files contain CUDA code and how much of that code can be automatically hipified. +The **[hipexamine-perl.sh](https://github.com/ROCm-Developer-Tools/HIPIFY/blob/master/bin/hipexamine-perl.sh)** tool will scan a source directory to determine which files contain CUDA code and how much of that code can be automatically hipified. ``` > cd examples/rodinia_3.0/cuda/kmeans > $HIP_DIR/bin/hipexamine-perl.sh. @@ -113,7 +113,7 @@ For each input file FILE, this script will: This is useful for testing improvements to the hipify toolset. -The [hipconvertinplace-perl.sh](https://github.com/ROCm-Developer-Tools/HIP/blob/master/bin/hipconvertinplace-perl.sh) script will perform inplace conversion for all code files in the specified directory. +The [hipconvertinplace-perl.sh](https://github.com/ROCm-Developer-Tools/HIPIFY/blob/master/bin/hipconvertinplace-perl.sh) script will perform inplace conversion for all code files in the specified directory. This can be quite handy when dealing with an existing CUDA code base since the script preserves the existing directory structure and filenames - and includes work. After converting in-place, you can review the code to add additional parameters to directory names. diff --git a/docs/markdown/hip_programming_guide.md b/docs/markdown/hip_programming_guide.md index 94183bb6f9..f1c7e824da 100644 --- a/docs/markdown/hip_programming_guide.md +++ b/docs/markdown/hip_programming_guide.md @@ -121,7 +121,8 @@ hipRTC APIs accept HIP source files in character string format as input paramete For more details on hipRTC APIs, refer to HIP-API.pdf in GitHub (https://github.com/RadeonOpenCompute/ROCm). -The link here(https://github.com/ROCm-Developer-Tools/HIP/blob/main/tests/src/hiprtc/saxpy.cpp) shows an example how to program HIP application using runtime compilation mechanism. +The link here(https://github.com/ROCm-Developer-Tools/HIP/blob/main/tests/src/hiprtc/saxpy.cpp) shows an example how to program HIP application using runtime compilation mechanism, and detail hipRTC programming guide is also available in Github (https://github.com/ROCm-Developer-Tools/HIP/blob/main/docs/markdown/hip_rtc.md). + ## Device-Side Malloc diff --git a/docs/markdown/obj_tooling.md b/docs/markdown/obj_tooling.md index f3c728b197..a4e0d253f5 100644 --- a/docs/markdown/obj_tooling.md +++ b/docs/markdown/obj_tooling.md @@ -12,22 +12,22 @@ detailed overview, see the help text available with `roc-obj --help`. ### Examples: #### Extract all ROCm code objects from a list of executables - roc-obj executable... + roc-obj ... #### Extract all ROCm code objects from a list of executables, and disassemble them - roc-obj --disassemble executable... + roc-obj --disassemble ... # or - roc-obj -d executable... + roc-obj -d ... #### Extract all ROCm code objects from a list of executables into dir/ - roc-obj --outdir dir/ executable... + roc-obj --outdir dir/ ... # or - roc-obj -o dir/ executable... + roc-obj -o dir/ ... #### Extract only ROCm code objects matching regex over Target ID - roc-obj --grep gfx9 executable... + roc-obj --target-id gfx9 ... # or - roc-obj -g gfx9 executable... + roc-obj -t gfx9 ... ## Low-Level Tooling @@ -48,19 +48,19 @@ detailed overview, see the help text available with `roc-obj --help`. ### List available ROCm Code Objects: rocm-obj-ls - Use this tool to list available ROCm code objects. Code objects are listed using URI syntax. + Use this tool to list available ROCm code objects. Code objects are listed by bundle number, entry ID, and URI syntax. Usage: roc-obj-ls [-v|h] executable... List the URIs of the code objects embedded in the specfied host executables. - -v Verbose output (includes Entry ID) + -v Verbose output. Adds column headers for more human readable format -h Show this help message -### Extract ROCm Code Objects: rocm-obj-extract +### Extract ROCm Code Objects: roc-obj-extract Extracts available ROCm code objects from specified URI. - Usage: rocm-obj-extract [-o|v|h] URI... + Usage: roc-obj-extract [-o|v|h] URI... - URIs can be read from STDIN, one per line. - From the URIs specified, extracts code objects into files named: -[pid]-offset-size.co @@ -74,14 +74,11 @@ detailed overview, see the help text available with `roc-obj --help`. ### Examples: -#### Dump all code objects to current directory: - roc-obj-ls | roc-obj-extract - #### Dump the ISA for gfx906: - roc-obj-ls -v | awk '/gfx906/{print $2}' | roc-obj-extract -o - | llvm-objdump -d - > .gfx906.isa + roc-obj-ls -v | awk '/gfx906/{print $3}' | roc-obj-extract -o - | llvm-objdump -d - > .gfx906.isa #### Check the e_flags of the gfx908 code object: - roc-obj-ls -v | awk '/gfx908/{print $2}' | roc-obj-extract -o - | llvm-readelf -h - | grep Flags + roc-obj-ls -v | awk '/gfx908/{print $3}' | roc-obj-extract -o - | llvm-readelf -h - | grep Flags #### Disassemble the fourth code object: roc-obj-ls | sed -n 4p | roc-obj-extract -o - | llvm-objdump -d - @@ -90,6 +87,6 @@ detailed overview, see the help text available with `roc-obj --help`. for uri in $(roc-obj-ls ); do printf "%d: %s\n" "$(roc-obj-extract -o - "$uri" | wc -c)" "$uri"; done | sort -n #### Compare disassembly of gfx803 and gfx900 code objects: - dis() { roc-obj-ls -v | grep "$1" | awk '{print $2}' | roc-obj-extract -o - | llvm-objdump -d -; } + dis() { roc-obj-ls -v | grep "$1" | awk '{print $3}' | roc-obj-extract -o - | llvm-objdump -d -; } diff <(dis gfx803) <(dis gfx900) diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in index 9d3c9cc22a..5ef7eb24dd 100644 --- a/hip-lang-config.cmake.in +++ b/hip-lang-config.cmake.in @@ -87,6 +87,7 @@ endif() find_path(HSA_HEADER hsa/hsa.h PATHS "${_IMPORT_PREFIX}/../include" + "${ROCM_PATH}/include" /opt/rocm/include ) @@ -94,6 +95,15 @@ if (HSA_HEADER-NOTFOUND) message (FATAL_ERROR "HSA header not found! ROCM_PATH environment not set") endif() +file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${CMAKE_HIP_COMPILER}/../lib/clang/*/lib/*") +find_library(CLANGRT_BUILTINS + NAMES + clang_rt.builtins + clang_rt.builtins-x86_64 + PATHS + ${HIP_CLANGRT_LIB_SEARCH_PATHS} + ${HIP_CLANG_INCLUDE_PATH}/../lib/linux) + set_target_properties(hip-lang::device PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/../include;${HIP_CLANG_INCLUDE_PATH}>" INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/../include;${HIP_CLANG_INCLUDE_PATH}>" @@ -123,9 +133,13 @@ set_property(TARGET hip-lang::device APPEND PROPERTY ) # Add support for __fp16 and _Float16, explicitly link with compiler-rt -set_property(TARGET hip-lang::device APPEND PROPERTY - INTERFACE_LINK_LIBRARIES "$<$:${HIP_CLANG_INCLUDE_PATH}/lib/linux/libclang_rt.builtins-x86_64.a>" -) +if(CLANGRT_BUILTINS-NOTFOUND) + message(FATAL_ERROR "clangrt builtins lib not found") +else() + set_property(TARGET hip-lang::device APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "$<$:${CLANGRT_BUILTINS}>" + ) +endif() # Approved by CMake to use this name. This is used so that HIP can # change the name of the target and not require any modifications in CMake diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index 7718a8be4f..f5311e767d 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -3931,6 +3931,66 @@ hipError_t hipExtLaunchKernel(const void* function_address, dim3 numBlocks, dim3 * @{ * This section describes the texture management functions of HIP runtime API. */ +hipError_t hipBindTextureToMipmappedArray( + const textureReference* tex, + hipMipmappedArray_const_t mipmappedArray, + const hipChannelFormatDesc* desc); +hipError_t hipGetTextureReference( + const textureReference** texref, + const void* symbol); +hipError_t hipCreateTextureObject( + hipTextureObject_t* pTexObject, + const hipResourceDesc* pResDesc, + const hipTextureDesc* pTexDesc, + const struct hipResourceViewDesc* pResViewDesc); +hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject); +hipError_t hipGetChannelDesc( + hipChannelFormatDesc* desc, + hipArray_const_t array); +hipError_t hipGetTextureObjectResourceDesc( + hipResourceDesc* pResDesc, + hipTextureObject_t textureObject); +hipError_t hipGetTextureObjectResourceViewDesc( + struct hipResourceViewDesc* pResViewDesc, + hipTextureObject_t textureObject); +hipError_t hipGetTextureObjectTextureDesc( + hipTextureDesc* pTexDesc, + hipTextureObject_t textureObject); +hipError_t hipTexRefSetAddressMode( + textureReference* texRef, + int dim, + enum hipTextureAddressMode am); +hipError_t hipTexRefSetArray( + textureReference* tex, + hipArray_const_t array, + unsigned int flags); +hipError_t hipTexRefSetFilterMode( + textureReference* texRef, + enum hipTextureFilterMode fm); +hipError_t hipTexRefSetFlags( + textureReference* texRef, + unsigned int Flags); +hipError_t hipTexRefSetFormat( + textureReference* texRef, + hipArray_Format fmt, + int NumPackedComponents); +hipError_t hipTexObjectCreate( + hipTextureObject_t* pTexObject, + const HIP_RESOURCE_DESC* pResDesc, + const HIP_TEXTURE_DESC* pTexDesc, + const HIP_RESOURCE_VIEW_DESC* pResViewDesc); +hipError_t hipTexObjectDestroy( + hipTextureObject_t texObject); +hipError_t hipTexObjectGetResourceDesc( + HIP_RESOURCE_DESC* pResDesc, + hipTextureObject_t texObject); +hipError_t hipTexObjectGetResourceViewDesc( + HIP_RESOURCE_VIEW_DESC* pResViewDesc, + hipTextureObject_t texObject); +hipError_t hipTexObjectGetTextureDesc( + HIP_TEXTURE_DESC* pTexDesc, + hipTextureObject_t texObject); + /** * * @addtogroup TexturD Texture Management [Deprecated] @@ -3965,35 +4025,6 @@ hipError_t hipGetTextureAlignmentOffset( const textureReference* texref); DEPRECATED(DEPRECATED_MSG) hipError_t hipUnbindTexture(const textureReference* tex); -// doxygen end deprecated texture management -/** - * @} - */ -hipError_t hipBindTextureToMipmappedArray( - const textureReference* tex, - hipMipmappedArray_const_t mipmappedArray, - const hipChannelFormatDesc* desc); - hipError_t hipGetTextureReference( - const textureReference** texref, - const void* symbol); -hipError_t hipCreateTextureObject( - hipTextureObject_t* pTexObject, - const hipResourceDesc* pResDesc, - const hipTextureDesc* pTexDesc, - const struct hipResourceViewDesc* pResViewDesc); -hipError_t hipDestroyTextureObject(hipTextureObject_t textureObject); -hipError_t hipGetChannelDesc( - hipChannelFormatDesc* desc, - hipArray_const_t array); -hipError_t hipGetTextureObjectResourceDesc( - hipResourceDesc* pResDesc, - hipTextureObject_t textureObject); -hipError_t hipGetTextureObjectResourceViewDesc( - struct hipResourceViewDesc* pResViewDesc, - hipTextureObject_t textureObject); -hipError_t hipGetTextureObjectTextureDesc( - hipTextureDesc* pTexDesc, - hipTextureObject_t textureObject); DEPRECATED(DEPRECATED_MSG) hipError_t hipTexRefGetAddress( hipDeviceptr_t* dev_ptr, @@ -4049,49 +4080,23 @@ hipError_t hipTexRefSetAddress2D( const HIP_ARRAY_DESCRIPTOR* desc, hipDeviceptr_t dptr, size_t Pitch); -hipError_t hipTexRefSetAddressMode( - textureReference* texRef, - int dim, - enum hipTextureAddressMode am); -hipError_t hipTexRefSetArray( - textureReference* tex, - hipArray_const_t array, - unsigned int flags); -hipError_t hipTexRefSetFilterMode( - textureReference* texRef, - enum hipTextureFilterMode fm); -hipError_t hipTexRefSetFlags( - textureReference* texRef, - unsigned int Flags); -hipError_t hipTexRefSetFormat( - textureReference* texRef, - hipArray_Format fmt, - int NumPackedComponents); DEPRECATED(DEPRECATED_MSG) hipError_t hipTexRefSetMaxAnisotropy( textureReference* texRef, unsigned int maxAniso); -hipError_t hipTexObjectCreate( - hipTextureObject_t* pTexObject, - const HIP_RESOURCE_DESC* pResDesc, - const HIP_TEXTURE_DESC* pTexDesc, - const HIP_RESOURCE_VIEW_DESC* pResViewDesc); -hipError_t hipTexObjectDestroy( - hipTextureObject_t texObject); -hipError_t hipTexObjectGetResourceDesc( - HIP_RESOURCE_DESC* pResDesc, - hipTextureObject_t texObject); -hipError_t hipTexObjectGetResourceViewDesc( - HIP_RESOURCE_VIEW_DESC* pResViewDesc, - hipTextureObject_t texObject); -hipError_t hipTexObjectGetTextureDesc( - HIP_TEXTURE_DESC* pTexDesc, - hipTextureObject_t texObject); -// doxygen end Texture management +// doxygen end deprecated texture management /** * @} */ + // The following are not supported. +/** + * + * @addtogroup TextureU Texture Management [Not supported] + * @{ + * @ingroup Texture + * This section describes the texture management functions currently unsupported in HIP runtime. + */ DEPRECATED(DEPRECATED_MSG) hipError_t hipTexRefSetBorderColor( textureReference* texRef, @@ -4120,6 +4125,15 @@ hipError_t hipMipmappedArrayGetLevel( hipArray_t* pLevelArray, hipMipmappedArray_t hMipMappedArray, unsigned int level); +// doxygen end Texture management unsupported +/** + * @} + */ + +// doxygen end Texture management +/** + * @} + */ /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -4136,7 +4150,10 @@ hipError_t hipMipmappedArrayGetLevel( */ /** - * Callback/Activity API + * + * @defgroup Callback Callback Activity APIs + * @{ + * This section describes the callback/Activity of HIP runtime API. */ hipError_t hipRegisterApiCallback(uint32_t id, void* fun, void* arg); hipError_t hipRemoveApiCallback(uint32_t id); @@ -4147,6 +4164,10 @@ const char* hipKernelNameRef(const hipFunction_t f); const char* hipKernelNameRefByPtr(const void* hostFunction, hipStream_t stream); int hipGetStreamDeviceId(hipStream_t stream); +// doxygen end Callback +/** + * @} + */ /** *------------------------------------------------------------------------------------------------- *------------------------------------------------------------------------------------------------- @@ -5160,6 +5181,38 @@ hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraphExec, hipGraph * @} */ +/** + *------------------------------------------------------------------------------------------------- + *------------------------------------------------------------------------------------------------- + * @defgroup GL Interop + * @{ + * This section describes Stream Memory Wait and Write functions of HIP runtime API. + */ +typedef unsigned int GLuint; + +// Queries devices associated with GL Context. +hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, + unsigned int hipDeviceCount, hipGLDeviceList deviceList); +// Registers a GL Buffer for interop and returns corresponding graphics resource. +hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint buffer, + unsigned int flags); +// Maps a graphics resource for hip access. +hipError_t hipGraphicsMapResources(int count, hipGraphicsResource_t* resources, + hipStream_t stream __dparm(0) ); +// Gets device accessible address of a graphics resource. +hipError_t hipGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, + hipGraphicsResource_t resource); +// Unmaps a graphics resource for hip access. +hipError_t hipGraphicsUnmapResources(int count, hipGraphicsResource_t* resources, + hipStream_t stream __dparm(0)); +// Unregisters a graphics resource. +hipError_t hipGraphicsUnregisterResource(hipGraphicsResource_t resource); +// doxygen end GL Interop +/** + * @} + */ + + #ifdef __cplusplus } /* extern "c" */ #endif @@ -5331,37 +5384,6 @@ static inline hipError_t hipUnbindTexture( #endif // __cplusplus -/** - *------------------------------------------------------------------------------------------------- - *------------------------------------------------------------------------------------------------- - * @defgroup GL Interop - * @{ - * This section describes Stream Memory Wait and Write functions of HIP runtime API. - */ -typedef unsigned int GLuint; - -// Queries devices associated with GL Context. -hipError_t hipGLGetDevices(unsigned int* pHipDeviceCount, int* pHipDevices, - unsigned int hipDeviceCount, hipGLDeviceList deviceList); -// Registers a GL Buffer for interop and returns corresponding graphics resource. -hipError_t hipGraphicsGLRegisterBuffer(hipGraphicsResource** resource, GLuint buffer, - unsigned int flags); -// Maps a graphics resource for hip access. -hipError_t hipGraphicsMapResources(int count, hipGraphicsResource_t* resources, - hipStream_t stream __dparm(0) ); -// Gets device accessible address of a graphics resource. -hipError_t hipGraphicsResourceGetMappedPointer(void** devPtr, size_t* size, - hipGraphicsResource_t resource); -// Unmaps a graphics resource for hip access. -hipError_t hipGraphicsUnmapResources(int count, hipGraphicsResource_t* resources, - hipStream_t stream __dparm(0)); -// Unregisters a graphics resource. -hipError_t hipGraphicsUnregisterResource(hipGraphicsResource_t resource); -// doxygen end GL Interop -/** - * @} - */ - #ifdef __GNUC__ #pragma GCC visibility pop #endif diff --git a/samples/0_Intro/bit_extract/CMakeLists.txt b/samples/0_Intro/bit_extract/CMakeLists.txt index bffb2f1abe..166a8ccb79 100644 --- a/samples/0_Intro/bit_extract/CMakeLists.txt +++ b/samples/0_Intro/bit_extract/CMakeLists.txt @@ -26,12 +26,16 @@ if(NOT DEFINED __HIP_ENABLE_PCH) set(__HIP_ENABLE_PCH ON CACHE BOOL "enable/disable pre-compiled hip headers") endif() +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + if(${__HIP_ENABLE_PCH}) add_definitions(-D__HIP_ENABLE_PCH) endif() # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/0_Intro/bit_extract/Makefile b/samples/0_Intro/bit_extract/Makefile index 023259d24f..612c18ce3c 100644 --- a/samples/0_Intro/bit_extract/Makefile +++ b/samples/0_Intro/bit_extract/Makefile @@ -20,7 +20,8 @@ #Dependencies : [MYHIP]/bin must be in user's path. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/0_Intro/module_api/CMakeLists.txt b/samples/0_Intro/module_api/CMakeLists.txt index 2e389e210b..cefe6e2c79 100644 --- a/samples/0_Intro/module_api/CMakeLists.txt +++ b/samples/0_Intro/module_api/CMakeLists.txt @@ -22,8 +22,12 @@ project(module_api) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/0_Intro/module_api/Makefile b/samples/0_Intro/module_api/Makefile index b1baa1849c..ad78c1fd56 100644 --- a/samples/0_Intro/module_api/Makefile +++ b/samples/0_Intro/module_api/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/0_Intro/module_api_global/CMakeLists.txt b/samples/0_Intro/module_api_global/CMakeLists.txt index c4a8b01347..c3b147c60c 100644 --- a/samples/0_Intro/module_api_global/CMakeLists.txt +++ b/samples/0_Intro/module_api_global/CMakeLists.txt @@ -22,8 +22,12 @@ project(modile_api_global) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/0_Intro/module_api_global/Makefile b/samples/0_Intro/module_api_global/Makefile index 212bbae5ec..3d186d3fb0 100644 --- a/samples/0_Intro/module_api_global/Makefile +++ b/samples/0_Intro/module_api_global/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/0_Intro/square/CMakeLists.txt b/samples/0_Intro/square/CMakeLists.txt index 4bcc2ec158..104f828698 100644 --- a/samples/0_Intro/square/CMakeLists.txt +++ b/samples/0_Intro/square/CMakeLists.txt @@ -24,11 +24,15 @@ project(square) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # create square.cpp -execute_process(COMMAND sh -c "/opt/rocm/hip/bin/hipify-perl ../square.cu > ../square.cpp") +execute_process(COMMAND sh -c "${ROCM_PATH}/hip/bin/hipify-perl ../square.cu > ../square.cpp") # Find hip find_package(hip) diff --git a/samples/0_Intro/square/Makefile b/samples/0_Intro/square/Makefile index 3cefbe6d25..ec35c87e72 100644 --- a/samples/0_Intro/square/Makefile +++ b/samples/0_Intro/square/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/0_Intro/square/README.md b/samples/0_Intro/square/README.md index 38ca288b48..807f08754e 100644 --- a/samples/0_Intro/square/README.md +++ b/samples/0_Intro/square/README.md @@ -19,9 +19,9 @@ $ export HIP_PATH=[MYHIP] ``` $ cd ~/hip/samples/0_Intro/square $ make -/home/user/hip/bin/hipify-perl square.cu > square.cpp -/home/user/hip/bin/hipcc square.cpp -o square.out -/home/user/hip/bin/hipcc -use-staticlib square.cpp -o square.out.static +/opt/rocm/hip/bin/hipify-perl square.cu > square.cpp +/opt/rocm/hip/bin/hipcc square.cpp -o square.out +/opt/rocm/hip/bin/hipcc -use-staticlib square.cpp -o square.out.static ``` - Execute file ``` diff --git a/samples/1_Utils/hipBusBandwidth/CMakeLists.txt b/samples/1_Utils/hipBusBandwidth/CMakeLists.txt index 5ec0c2ff50..bfebb89e56 100644 --- a/samples/1_Utils/hipBusBandwidth/CMakeLists.txt +++ b/samples/1_Utils/hipBusBandwidth/CMakeLists.txt @@ -22,8 +22,12 @@ project(hipBusBandwidth) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/1_Utils/hipBusBandwidth/Makefile b/samples/1_Utils/hipBusBandwidth/Makefile index 8a45e5f130..8fa0b829fc 100644 --- a/samples/1_Utils/hipBusBandwidth/Makefile +++ b/samples/1_Utils/hipBusBandwidth/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/1_Utils/hipCommander/CMakeLists.txt b/samples/1_Utils/hipCommander/CMakeLists.txt index d071a84c40..2719619f36 100644 --- a/samples/1_Utils/hipCommander/CMakeLists.txt +++ b/samples/1_Utils/hipCommander/CMakeLists.txt @@ -22,8 +22,12 @@ project(hipCommander) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/1_Utils/hipCommander/Makefile b/samples/1_Utils/hipCommander/Makefile index 55dc844d1d..bb38a1f2b7 100644 --- a/samples/1_Utils/hipCommander/Makefile +++ b/samples/1_Utils/hipCommander/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/1_Utils/hipDispatchLatency/CMakeLists.txt b/samples/1_Utils/hipDispatchLatency/CMakeLists.txt index 096edae9bc..d0a453f1d5 100644 --- a/samples/1_Utils/hipDispatchLatency/CMakeLists.txt +++ b/samples/1_Utils/hipDispatchLatency/CMakeLists.txt @@ -22,8 +22,12 @@ project(hipDispatchLatency) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/1_Utils/hipDispatchLatency/Makefile b/samples/1_Utils/hipDispatchLatency/Makefile index 969557ae84..b93a530056 100644 --- a/samples/1_Utils/hipDispatchLatency/Makefile +++ b/samples/1_Utils/hipDispatchLatency/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/1_Utils/hipInfo/CMakeLists.txt b/samples/1_Utils/hipInfo/CMakeLists.txt index 2cfc0cb6ce..4314467527 100644 --- a/samples/1_Utils/hipInfo/CMakeLists.txt +++ b/samples/1_Utils/hipInfo/CMakeLists.txt @@ -22,8 +22,12 @@ project(hipInfo) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/1_Utils/hipInfo/Makefile b/samples/1_Utils/hipInfo/Makefile index d8cdf32188..09f717c7c2 100644 --- a/samples/1_Utils/hipInfo/Makefile +++ b/samples/1_Utils/hipInfo/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/1_Utils/hipInfo/hipInfo.cpp b/samples/1_Utils/hipInfo/hipInfo.cpp index 53c841280b..28128b6d33 100644 --- a/samples/1_Utils/hipInfo/hipInfo.cpp +++ b/samples/1_Utils/hipInfo/hipInfo.cpp @@ -75,7 +75,7 @@ void printDeviceProp(int deviceId) { << endl; cout << setw(w1) << "device#" << deviceId << endl; - hipDeviceProp_t props; + hipDeviceProp_t props = {0}; HIPCHECK(hipGetDeviceProperties(&props, deviceId)); cout << setw(w1) << "Name: " << props.name << endl; @@ -90,12 +90,8 @@ void printDeviceProp(int deviceId) { cout << setw(w1) << "memoryClockRate: " << (float)props.memoryClockRate / 1000.0 << " Mhz" << endl; cout << setw(w1) << "memoryBusWidth: " << props.memoryBusWidth << endl; - cout << setw(w1) << "clockInstructionRate: " << (float)props.clockInstructionRate / 1000.0 - << " Mhz" << endl; cout << setw(w1) << "totalGlobalMem: " << fixed << setprecision(2) << bytesToGB(props.totalGlobalMem) << " GB" << endl; - cout << setw(w1) << "maxSharedMemoryPerMultiProcessor: " << fixed << setprecision(2) - << bytesToKB(props.maxSharedMemoryPerMultiProcessor) << " KB" << endl; cout << setw(w1) << "totalConstMem: " << props.totalConstMem << endl; cout << setw(w1) << "sharedMemPerBlock: " << (float)props.sharedMemPerBlock / 1024.0 << " KB" << endl; @@ -116,6 +112,21 @@ void printDeviceProp(int deviceId) { cout << setw(w1) << "concurrentKernels: " << props.concurrentKernels << endl; cout << setw(w1) << "cooperativeLaunch: " << props.cooperativeLaunch << endl; cout << setw(w1) << "cooperativeMultiDeviceLaunch: " << props.cooperativeMultiDeviceLaunch << endl; + cout << setw(w1) << "isIntegrated: " << props.integrated << endl; + cout << setw(w1) << "maxTexture1D: " << props.maxTexture1D << endl; + cout << setw(w1) << "maxTexture2D.width: " << props.maxTexture2D[0] << endl; + cout << setw(w1) << "maxTexture2D.height: " << props.maxTexture2D[1] << endl; + cout << setw(w1) << "maxTexture3D.width: " << props.maxTexture3D[0] << endl; + cout << setw(w1) << "maxTexture3D.height: " << props.maxTexture3D[1] << endl; + cout << setw(w1) << "maxTexture3D.depth: " << props.maxTexture3D[2] << endl; + +#ifdef __HIP_PLATFORM_AMD__ + cout << setw(w1) << "isLargeBar: " << props.isLargeBar << endl; + cout << setw(w1) << "asicRevision: " << props.asicRevision << endl; + cout << setw(w1) << "maxSharedMemoryPerMultiProcessor: " << fixed << setprecision(2) + << bytesToKB(props.maxSharedMemoryPerMultiProcessor) << " KB" << endl; + cout << setw(w1) << "clockInstructionRate: " << (float)props.clockInstructionRate / 1000.0 + << " Mhz" << endl; cout << setw(w1) << "arch.hasGlobalInt32Atomics: " << props.arch.hasGlobalInt32Atomics << endl; cout << setw(w1) << "arch.hasGlobalFloatAtomicExch: " << props.arch.hasGlobalFloatAtomicExch << endl; @@ -136,16 +147,7 @@ void printDeviceProp(int deviceId) { cout << setw(w1) << "arch.has3dGrid: " << props.arch.has3dGrid << endl; cout << setw(w1) << "arch.hasDynamicParallelism: " << props.arch.hasDynamicParallelism << endl; cout << setw(w1) << "gcnArchName: " << props.gcnArchName << endl; - cout << setw(w1) << "isIntegrated: " << props.integrated << endl; - cout << setw(w1) << "maxTexture1D: " << props.maxTexture1D << endl; - cout << setw(w1) << "maxTexture2D.width: " << props.maxTexture2D[0] << endl; - cout << setw(w1) << "maxTexture2D.height: " << props.maxTexture2D[1] << endl; - cout << setw(w1) << "maxTexture3D.width: " << props.maxTexture3D[0] << endl; - cout << setw(w1) << "maxTexture3D.height: " << props.maxTexture3D[1] << endl; - cout << setw(w1) << "maxTexture3D.depth: " << props.maxTexture3D[2] << endl; - cout << setw(w1) << "isLargeBar: " << props.isLargeBar << endl; - cout << setw(w1) << "asicRevision: " << props.asicRevision << endl; - +#endif int deviceCnt; hipGetDeviceCount(&deviceCnt); cout << setw(w1) << "peers: "; diff --git a/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt b/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt index 6d12e24dc0..ae4735c1ae 100644 --- a/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt +++ b/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt @@ -22,8 +22,12 @@ project(MatrixTranspose) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/0_MatrixTranspose/Makefile b/samples/2_Cookbook/0_MatrixTranspose/Makefile index f691f5003e..4e829bde28 100644 --- a/samples/2_Cookbook/0_MatrixTranspose/Makefile +++ b/samples/2_Cookbook/0_MatrixTranspose/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/10_inline_asm/CMakeLists.txt b/samples/2_Cookbook/10_inline_asm/CMakeLists.txt index e4a8a4eb87..ac4e586772 100644 --- a/samples/2_Cookbook/10_inline_asm/CMakeLists.txt +++ b/samples/2_Cookbook/10_inline_asm/CMakeLists.txt @@ -22,8 +22,12 @@ project(inline_asm) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/10_inline_asm/Makefile b/samples/2_Cookbook/10_inline_asm/Makefile index fcdb849c87..516a120612 100644 --- a/samples/2_Cookbook/10_inline_asm/Makefile +++ b/samples/2_Cookbook/10_inline_asm/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/11_texture_driver/CMakeLists.txt b/samples/2_Cookbook/11_texture_driver/CMakeLists.txt index d8475b9c2f..f93b2e791e 100644 --- a/samples/2_Cookbook/11_texture_driver/CMakeLists.txt +++ b/samples/2_Cookbook/11_texture_driver/CMakeLists.txt @@ -22,8 +22,12 @@ project(texture2dDrv) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/11_texture_driver/Makefile b/samples/2_Cookbook/11_texture_driver/Makefile index ea284a8e1f..68d4d7f28c 100644 --- a/samples/2_Cookbook/11_texture_driver/Makefile +++ b/samples/2_Cookbook/11_texture_driver/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt index 04d327efc7..32f190b58f 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt @@ -19,10 +19,13 @@ # THE SOFTWARE. cmake_minimum_required(VERSION 2.8.3) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH "${ROCM_PATH}/hip" CACHE PATH "Path to which HIP has been installed") else() set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed") endif() @@ -36,7 +39,7 @@ find_package(HIP QUIET) if(HIP_FOUND) message(STATUS "Found HIP: " ${HIP_VERSION}) else() - message(FATAL_ERROR "Could not find HIP. Ensure that HIP is either installed in /opt/rocm/hip or the variable HIP_PATH is set to point to the right location.") + message(FATAL_ERROR "Could not find HIP. Ensure that HIP is either installed in ${ROCM_PATH}/hip or the variable HIP_PATH is set to point to the right location.") endif() set(MY_SOURCE_FILES MatrixTranspose.cpp) @@ -50,7 +53,7 @@ set_source_files_properties(${MY_SOURCE_FILES} PROPERTIES HIP_SOURCE_PROPERTY_FO hip_add_executable(${MY_TARGET_NAME} ${MY_SOURCE_FILES} HIPCC_OPTIONS ${MY_HIPCC_OPTIONS} HCC_OPTIONS ${MY_HCC_OPTIONS} CLANG_OPTIONS ${MY_CLANG_OPTIONS} NVCC_OPTIONS ${MY_NVCC_OPTIONS}) # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} ${ROCM_PATH}) find_package(hip QUIET) if(TARGET hip::host) message(STATUS "Found hip::host at ${hip_DIR}") diff --git a/samples/2_Cookbook/13_occupancy/CMakeLists.txt b/samples/2_Cookbook/13_occupancy/CMakeLists.txt index d69c22fd9b..481cf58b26 100644 --- a/samples/2_Cookbook/13_occupancy/CMakeLists.txt +++ b/samples/2_Cookbook/13_occupancy/CMakeLists.txt @@ -22,8 +22,12 @@ project(occupancy) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/13_occupancy/Makefile b/samples/2_Cookbook/13_occupancy/Makefile index bb19856d12..bfd5a8bb30 100644 --- a/samples/2_Cookbook/13_occupancy/Makefile +++ b/samples/2_Cookbook/13_occupancy/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt b/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt index 58c2f372d3..084f273096 100644 --- a/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt +++ b/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt @@ -22,8 +22,12 @@ project(gpuarch) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/14_gpu_arch/Makefile b/samples/2_Cookbook/14_gpu_arch/Makefile index eebb86d7ce..2e898a9e02 100644 --- a/samples/2_Cookbook/14_gpu_arch/Makefile +++ b/samples/2_Cookbook/14_gpu_arch/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/15_static_library/README.md b/samples/2_Cookbook/15_static_library/README.md index 3a347d2cf7..bf0123573d 100644 --- a/samples/2_Cookbook/15_static_library/README.md +++ b/samples/2_Cookbook/15_static_library/README.md @@ -74,7 +74,8 @@ hipcc hipMain1.cpp -L. -lHipOptLibrary -o test_emit_static_hipcc_linker.out ``` Using g++: ``` -g++ hipMain1.cpp -L. -lHipOptLibrary -L/opt/rocm/hip/lib -lamdhip64 -o test_emit_static_host_linker.out +ROCM_PATH is the path where ROCM is installed. default path is /opt/rocm. +g++ hipMain1.cpp -L. -lHipOptLibrary -L/hip/lib -lamdhip64 -o test_emit_static_host_linker.out ``` ## Static libraries with device functions diff --git a/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt b/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt index f73ba6766e..30a5928389 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt +++ b/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt @@ -2,8 +2,12 @@ project(static_lib) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip REQUIRED) @@ -23,7 +27,7 @@ add_library(HipDevice STATIC ${CPP_SOURCES}) target_compile_options(HipDevice PRIVATE -fgpu-rdc) target_link_libraries(HipDevice PRIVATE -fgpu-rdc) -target_include_directories(HipDevice PRIVATE /opt/rocm/hsa/include) +target_include_directories(HipDevice PRIVATE ${ROCM_PATH}/hsa/include) # Create test executable that uses libHipDevice.a set(TEST_SOURCES ${CMAKE_SOURCE_DIR}/hipMain2.cpp) diff --git a/samples/2_Cookbook/15_static_library/device_functions/Makefile b/samples/2_Cookbook/15_static_library/device_functions/Makefile index 26c9ed122f..74bade6359 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/Makefile +++ b/samples/2_Cookbook/15_static_library/device_functions/Makefile @@ -1,4 +1,5 @@ -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt b/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt index bbb738f0f1..347171ed9d 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt +++ b/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt @@ -2,8 +2,12 @@ project(static_lib) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip REQUIRED) diff --git a/samples/2_Cookbook/15_static_library/host_functions/Makefile b/samples/2_Cookbook/15_static_library/host_functions/Makefile index 4945075cad..645b26fbb1 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/Makefile +++ b/samples/2_Cookbook/15_static_library/host_functions/Makefile @@ -1,4 +1,5 @@ -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/16_assembly_to_executable/Makefile b/samples/2_Cookbook/16_assembly_to_executable/Makefile index f8117ffbf0..5732f37d01 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/Makefile +++ b/samples/2_Cookbook/16_assembly_to_executable/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/16_assembly_to_executable/README.md b/samples/2_Cookbook/16_assembly_to_executable/README.md index ef11329924..6a2ce15a10 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/README.md +++ b/samples/2_Cookbook/16_assembly_to_executable/README.md @@ -1,3 +1,4 @@ +ROCM_PATH is the path where ROCM is installed. default path is /opt/rocm. # Compile to assembly and create an executable from modified asm This sample shows how to generate the assembly code for a simple HIP source application, then re-compiling it and generating a valid HIP executable. @@ -7,8 +8,8 @@ This sample uses a previous HIP application sample, please see [0_Intro/square]( ## Compiling the HIP source into assembly Using HIP flags `-c -S` will help generate the host x86_64 and the device AMDGCN assembly code when paired with `--cuda-host-only` and `--cuda-device-only` respectively. In this sample we use these commands: ``` -/opt/rocm/hip/bin/hipcc -c -S --cuda-host-only -target x86_64-linux-gnu -o square_host.s square.cpp -/opt/rocm/hip/bin/hipcc -c -S --cuda-device-only --offload-arch=gfx900 --offload-arch=gfx906 square.cpp +/hip/bin/hipcc -c -S --cuda-host-only -target x86_64-linux-gnu -o square_host.s square.cpp +/hip/bin/hipcc -c -S --cuda-device-only --offload-arch=gfx900 --offload-arch=gfx906 square.cpp ``` The device assembly will be output into two separate files: @@ -22,22 +23,22 @@ You may modify `--offload-arch` flag to build other archs and choose to enable o ## Compiling the assembly into a valid HIP executable If valid, the modified host and device assembly may be compiled into a HIP executable. The host assembly can be compiled into an object using this command: ``` -/opt/rocm/hip/bin/hipcc -c square_host.s -o square_host.o +/hip/bin/hipcc -c square_host.s -o square_host.o ``` However, the device assembly code will require a few extra steps. The device assemblies needs to be compiled into device objects, then offload-bundled into a HIP fat binary using the clang-offload-bundler, then llvm-mc embeds the binary inside of a host object using the MC directives provided in `hip_obj_gen.mcin`. The output is a host object with an embedded device object. Here are the steps for device side compilation into an object: ``` -/opt/rocm/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx900 square-hip-amdgcn-amd-amdhsa-gfx900.s -o square-hip-amdgcn-amd-amdhsa-gfx900.o -/opt/rocm/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx906 square-hip-amdgcn-amd-amdhsa-gfx906.s -o square-hip-amdgcn-amd-amdhsa-gfx906.o -/opt/rocm/llvm/bin/clang-offload-bundler -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900,hip-amdgcn-amd-amdhsa-gfx906 -inputs=/dev/null,square-hip-amdgcn-amd-amdhsa-gfx900.o,square-hip-amdgcn-amd-amdhsa-gfx906.o -outputs=offload_bundle.hipfb -/opt/rocm/llvm/bin/llvm-mc -triple x86_64-unknown-linux-gnu hip_obj_gen.mcin -o square_device.o --filetype=obj +/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx900 square-hip-amdgcn-amd-amdhsa-gfx900.s -o square-hip-amdgcn-amd-amdhsa-gfx900.o +/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx906 square-hip-amdgcn-amd-amdhsa-gfx906.s -o square-hip-amdgcn-amd-amdhsa-gfx906.o +/llvm/bin/clang-offload-bundler -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900,hip-amdgcn-amd-amdhsa-gfx906 -inputs=/dev/null,square-hip-amdgcn-amd-amdhsa-gfx900.o,square-hip-amdgcn-amd-amdhsa-gfx906.o -outputs=offload_bundle.hipfb +/llvm/bin/llvm-mc -triple x86_64-unknown-linux-gnu hip_obj_gen.mcin -o square_device.o --filetype=obj ``` **Note:** Using option `-bundle-align=4096` only works on ROCm 4.0 and newer compilers. Also, the architecture must match the same arch as when compiling to assembly. Finally, using the system linker, hipcc, or clang, link the host and device objects into an executable: ``` -/opt/rocm/hip/bin/hipcc square_host.o square_device.o -o square_asm.out +/hip/bin/hipcc square_host.o square_device.o -o square_asm.out ``` If you haven't modified the GPU archs, this executable should run on both `gfx900` and `gfx906`. diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile index 722248a853..6299094b20 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/README.md b/samples/2_Cookbook/17_llvm_ir_to_executable/README.md index 4b1ea11dd5..45cd0cb7df 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/README.md +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/README.md @@ -1,3 +1,4 @@ +ROCM_PATH is the path where ROCM is installed. default path is /opt/rocm. # Compile to LLVM IR and create an executable from modified IR This sample shows how to generate the LLVM IR for a simple HIP source application, then re-compiling it and generating a valid HIP executable. @@ -7,8 +8,8 @@ This sample uses a previous HIP application sample, please see [0_Intro/square]( ## Compiling the HIP source into LLVM IR Using HIP flags `-c -emit-llvm` will help generate the host x86_64 and the device LLVM bitcode when paired with `--cuda-host-only` and `--cuda-device-only` respectively. In this sample we use these commands: ``` -/opt/rocm/hip/bin/hipcc -c -emit-llvm --cuda-host-only -target x86_64-linux-gnu -o square_host.bc square.cpp -/opt/rocm/hip/bin/hipcc -c -emit-llvm --cuda-device-only --offload-arch=gfx900 --offload-arch=gfx906 square.cpp +/hip/bin/hipcc -c -emit-llvm --cuda-host-only -target x86_64-linux-gnu -o square_host.bc square.cpp +/hip/bin/hipcc -c -emit-llvm --cuda-device-only --offload-arch=gfx900 --offload-arch=gfx906 square.cpp ``` The device LLVM IR bitcode will be output into two separate files: - square-hip-amdgcn-amd-amdhsa-gfx900.bc @@ -18,8 +19,8 @@ You may modify `--offload-arch` flag to build other archs and choose to enable o To transform the LLVM bitcode into human readable LLVM IR, use these commands: ``` -/opt/rocm/llvm/bin/llvm-dis square-hip-amdgcn-amd-amdhsa-gfx900.bc -o square-hip-amdgcn-amd-amdhsa-gfx900.ll -/opt/rocm/llvm/bin/llvm-dis square-hip-amdgcn-amd-amdhsa-gfx906.bc -o square-hip-amdgcn-amd-amdhsa-gfx906.ll +/llvm/bin/llvm-dis square-hip-amdgcn-amd-amdhsa-gfx900.bc -o square-hip-amdgcn-amd-amdhsa-gfx900.ll +/llvm/bin/llvm-dis square-hip-amdgcn-amd-amdhsa-gfx906.bc -o square-hip-amdgcn-amd-amdhsa-gfx906.ll ``` **Warning:** We cannot ensure any compiler besides the ROCm hipcc and clang will be compatible with this process. Also, there is no guarantee that the starting IR produced with `-x cl` will run with HIP runtime. Experimenting with other compilers or starting IR will be the responsibility of the developer. @@ -32,25 +33,25 @@ At this point, you may evaluate the LLVM IR and make modifications if you are fa ## Compiling the LLVM IR into a valid HIP executable If valid, the modified host and device IR may be compiled into a HIP executable. First, the readable IR must be compiled back in LLVM bitcode. The host IR can be compiled into an object using this command: ``` -/opt/rocm/llvm/bin/llvm-as square_host.ll -o square_host.bc -/opt/rocm/hip/bin/hipcc -c square_host.bc -o square_host.o +/llvm/bin/llvm-as square_host.ll -o square_host.bc +/hip/bin/hipcc -c square_host.bc -o square_host.o ``` However, the device IR will require a few extra steps. The device bitcodes needs to be compiled into device objects, then offload-bundled into a HIP fat binary using the clang-offload-bundler, then llvm-mc embeds the binary inside of a host object using the MC directives provided in `hip_obj_gen.mcin`. The output is a host object with an embedded device object. Here are the steps for device side compilation into an object: ``` -/opt/rocm/hip/../llvm/bin/llvm-as square-hip-amdgcn-amd-amdhsa-gfx900.ll -o square-hip-amdgcn-amd-amdhsa-gfx900.bc -/opt/rocm/hip/../llvm/bin/llvm-as square-hip-amdgcn-amd-amdhsa-gfx906.ll -o square-hip-amdgcn-amd-amdhsa-gfx906.bc -/opt/rocm/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx900 square-hip-amdgcn-amd-amdhsa-gfx900.bc -o square-hip-amdgcn-amd-amdhsa-gfx900.o -/opt/rocm/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx906 square-hip-amdgcn-amd-amdhsa-gfx906.bc -o square-hip-amdgcn-amd-amdhsa-gfx906.o -/opt/rocm/hip/../llvm/bin/clang-offload-bundler -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900,hip-amdgcn-amd-amdhsa-gfx906 -inputs=/dev/null,square-hip-amdgcn-amd-amdhsa-gfx900.o,square-hip-amdgcn-amd-amdhsa-gfx906.o -outputs=offload_bundle.hipfb -/opt/rocm/llvm/bin/llvm-mc hip_obj_gen.mcin -o square_device.o --filetype=obj +/hip/../llvm/bin/llvm-as square-hip-amdgcn-amd-amdhsa-gfx900.ll -o square-hip-amdgcn-amd-amdhsa-gfx900.bc +/hip/../llvm/bin/llvm-as square-hip-amdgcn-amd-amdhsa-gfx906.ll -o square-hip-amdgcn-amd-amdhsa-gfx906.bc +/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx900 square-hip-amdgcn-amd-amdhsa-gfx900.bc -o square-hip-amdgcn-amd-amdhsa-gfx900.o +/hip/../llvm/bin/clang -target amdgcn-amd-amdhsa -mcpu=gfx906 square-hip-amdgcn-amd-amdhsa-gfx906.bc -o square-hip-amdgcn-amd-amdhsa-gfx906.o +/hip/../llvm/bin/clang-offload-bundler -type=o -bundle-align=4096 -targets=host-x86_64-unknown-linux,hip-amdgcn-amd-amdhsa-gfx900,hip-amdgcn-amd-amdhsa-gfx906 -inputs=/dev/null,square-hip-amdgcn-amd-amdhsa-gfx900.o,square-hip-amdgcn-amd-amdhsa-gfx906.o -outputs=offload_bundle.hipfb +/llvm/bin/llvm-mc hip_obj_gen.mcin -o square_device.o --filetype=obj ``` **Note:** Using option `-bundle-align=4096` only works on ROCm 4.0 and newer compilers. Also, the architecture must match the same arch as when compiling to LLVM IR. Finally, using the system linker, hipcc, or clang, link the host and device objects into an executable: ``` -/opt/rocm/hip/bin/hipcc square_host.o square_device.o -o square_ir.out +/hip/bin/hipcc square_host.o square_device.o -o square_ir.out ``` If you haven't modified the GPU archs, this executable should run on both `gfx900` and `gfx906`. diff --git a/samples/2_Cookbook/1_hipEvent/CMakeLists.txt b/samples/2_Cookbook/1_hipEvent/CMakeLists.txt index f4b6029943..9ac1aba1ca 100644 --- a/samples/2_Cookbook/1_hipEvent/CMakeLists.txt +++ b/samples/2_Cookbook/1_hipEvent/CMakeLists.txt @@ -22,8 +22,12 @@ project(hipEvent) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/1_hipEvent/Makefile b/samples/2_Cookbook/1_hipEvent/Makefile index 563702e6fb..01655bde5b 100644 --- a/samples/2_Cookbook/1_hipEvent/Makefile +++ b/samples/2_Cookbook/1_hipEvent/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/3_shared_memory/CMakeLists.txt b/samples/2_Cookbook/3_shared_memory/CMakeLists.txt index 41fdd78250..f2f5196373 100644 --- a/samples/2_Cookbook/3_shared_memory/CMakeLists.txt +++ b/samples/2_Cookbook/3_shared_memory/CMakeLists.txt @@ -22,8 +22,12 @@ project(sharedMemory) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/3_shared_memory/Makefile b/samples/2_Cookbook/3_shared_memory/Makefile index 7227b9b9a6..ef8727c5ea 100644 --- a/samples/2_Cookbook/3_shared_memory/Makefile +++ b/samples/2_Cookbook/3_shared_memory/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/4_shfl/CMakeLists.txt b/samples/2_Cookbook/4_shfl/CMakeLists.txt index d0fd286ffe..394d5852fb 100644 --- a/samples/2_Cookbook/4_shfl/CMakeLists.txt +++ b/samples/2_Cookbook/4_shfl/CMakeLists.txt @@ -22,8 +22,12 @@ project(shfl) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/4_shfl/Makefile b/samples/2_Cookbook/4_shfl/Makefile index 1b470f1d57..76559c1cd2 100644 --- a/samples/2_Cookbook/4_shfl/Makefile +++ b/samples/2_Cookbook/4_shfl/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/5_2dshfl/CMakeLists.txt b/samples/2_Cookbook/5_2dshfl/CMakeLists.txt index 1fc362dedb..d0ab52859d 100644 --- a/samples/2_Cookbook/5_2dshfl/CMakeLists.txt +++ b/samples/2_Cookbook/5_2dshfl/CMakeLists.txt @@ -22,8 +22,12 @@ project(2dshfl) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/5_2dshfl/Makefile b/samples/2_Cookbook/5_2dshfl/Makefile index 9e67c3e589..57240697ee 100644 --- a/samples/2_Cookbook/5_2dshfl/Makefile +++ b/samples/2_Cookbook/5_2dshfl/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt b/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt index 8dba51a666..73c4fe621b 100644 --- a/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt +++ b/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt @@ -22,8 +22,12 @@ project(dynamic_shared) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/6_dynamic_shared/Makefile b/samples/2_Cookbook/6_dynamic_shared/Makefile index f35de1d0ec..71d4f135ab 100644 --- a/samples/2_Cookbook/6_dynamic_shared/Makefile +++ b/samples/2_Cookbook/6_dynamic_shared/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/7_streams/CMakeLists.txt b/samples/2_Cookbook/7_streams/CMakeLists.txt index 9aa963f870..2d95541905 100644 --- a/samples/2_Cookbook/7_streams/CMakeLists.txt +++ b/samples/2_Cookbook/7_streams/CMakeLists.txt @@ -22,8 +22,12 @@ project(stream) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/7_streams/Makefile b/samples/2_Cookbook/7_streams/Makefile index dcf679f9b8..814341b5c5 100644 --- a/samples/2_Cookbook/7_streams/Makefile +++ b/samples/2_Cookbook/7_streams/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/8_peer2peer/CMakeLists.txt b/samples/2_Cookbook/8_peer2peer/CMakeLists.txt index abcb2b7afd..ad34ee44df 100644 --- a/samples/2_Cookbook/8_peer2peer/CMakeLists.txt +++ b/samples/2_Cookbook/8_peer2peer/CMakeLists.txt @@ -22,8 +22,12 @@ project(peer2peer) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/8_peer2peer/Makefile b/samples/2_Cookbook/8_peer2peer/Makefile index 6b07f7fa87..555e92ec9f 100644 --- a/samples/2_Cookbook/8_peer2peer/Makefile +++ b/samples/2_Cookbook/8_peer2peer/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/2_Cookbook/9_unroll/CMakeLists.txt b/samples/2_Cookbook/9_unroll/CMakeLists.txt index 02f900f70e..258138f2b9 100644 --- a/samples/2_Cookbook/9_unroll/CMakeLists.txt +++ b/samples/2_Cookbook/9_unroll/CMakeLists.txt @@ -22,8 +22,12 @@ project(unroll) cmake_minimum_required(VERSION 3.10) +if (NOT DEFINED ROCM_PATH ) + set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." ) +endif () + # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) # Find hip find_package(hip) diff --git a/samples/2_Cookbook/9_unroll/Makefile b/samples/2_Cookbook/9_unroll/Makefile index 138d412050..d1e3321b4f 100644 --- a/samples/2_Cookbook/9_unroll/Makefile +++ b/samples/2_Cookbook/9_unroll/Makefile @@ -18,7 +18,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -HIP_PATH?= $(wildcard /opt/rocm/hip) +ROCM_PATH?= $(wildcard /opt/rocm/) +HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif diff --git a/samples/README.md b/samples/README.md index c54ec20b3a..ac4bd1ca94 100644 --- a/samples/README.md +++ b/samples/README.md @@ -24,7 +24,7 @@ cmake .. b. to build with static libs, run -cmake -DCMAKE_PREFIX_PATH="/opt/rocm/llvm/lib/cmake" .. +cmake -DCMAKE_PREFIX_PATH="/llvm/lib/cmake" .. Then run, diff --git a/tests/catch/ABM/AddKernels/CMakeLists.txt b/tests/catch/ABM/AddKernels/CMakeLists.txt index 543f01d7a7..776f0fa5f1 100644 --- a/tests/catch/ABM/AddKernels/CMakeLists.txt +++ b/tests/catch/ABM/AddKernels/CMakeLists.txt @@ -3,8 +3,6 @@ set(TEST_SRC add.cc ) -# Create shared lib of all tests -add_library(ABMAddKernels SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests ABMAddKernels) +hip_add_exe_to_target(NAME ABMAddKernels + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/CMakeLists.txt b/tests/catch/CMakeLists.txt index 4d17fc037b..a10d61a678 100644 --- a/tests/catch/CMakeLists.txt +++ b/tests/catch/CMakeLists.txt @@ -1,3 +1,19 @@ +cmake_minimum_required(VERSION 3.16.8) +project(hiptests) + +# Check if platform and compiler are set +if(HIP_PLATFORM STREQUAL "amd") + if(HIP_COMPILER STREQUAL "nvcc") + message(FATAL_ERROR "Unexpected HIP_COMPILER:${HIP_COMPILER} is set for HIP_PLATFOR:amd") + endif() +elseif(HIP_PLATFORM STREQUAL "nvidia") + if(NOT DEFINED HIP_COMPILER OR NOT HIP_COMPILER STREQUAL "nvcc") + message(FATAL_ERROR "Unexpected HIP_COMPILER: ${HIP_COMPILER} is set for HIP_PLATFORM:nvidia") + endif() +else() + message(FATAL_ERROR "Unexpected HIP_PLATFORM: " ${HIP_PLATFORM}) +endif() + # Set HIP Path if(NOT DEFINED HIP_PATH) if(DEFINED ENV{HIP_PATH}) @@ -8,7 +24,22 @@ if(NOT DEFINED HIP_PATH) endif() message(STATUS "HIP Path: ${HIP_PATH}") -set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc") +if(UNIX) + set(CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc") + set(CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc") +else() + # using cmake_path as it handles path correctly. + # Set both compilers else windows cmake complains of mismatch + cmake_path(SET CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc.bat") + cmake_path(SET CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc.bat") +endif() + + +if(NOT UNIX) + # In linux this reruns the cmake and fails with incorrect vars. + # so the project command is used only for windows + project(build_tests) +endif() if(NOT DEFINED CATCH2_PATH) if(DEFINED ENV{CATCH2_PATH}) @@ -102,10 +133,10 @@ add_subdirectory(unit) add_subdirectory(ABM) add_subdirectory(hipTestMain) add_subdirectory(stress) -add_subdirectory(TypeQualifiers) if(UNIX) add_subdirectory(multiproc) + add_subdirectory(TypeQualifiers) endif() cmake_policy(POP) diff --git a/tests/catch/TypeQualifiers/CMakeLists.txt b/tests/catch/TypeQualifiers/CMakeLists.txt index 3c60bdf411..0219c0021b 100644 --- a/tests/catch/TypeQualifiers/CMakeLists.txt +++ b/tests/catch/TypeQualifiers/CMakeLists.txt @@ -3,10 +3,6 @@ set(TEST_SRC hipManagedKeyword.cc ) - -# Create shared lib of all tests -add_library(TypeQualifiers SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests TypeQualifiers) - +hip_add_exe_to_target(NAME TypeQualifiers + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/external/Catch2/cmake/Catch2/Catch.cmake b/tests/catch/external/Catch2/cmake/Catch2/Catch.cmake index a388516203..38da2b8097 100644 --- a/tests/catch/external/Catch2/cmake/Catch2/Catch.cmake +++ b/tests/catch/external/Catch2/cmake/Catch2/Catch.cmake @@ -173,7 +173,7 @@ function(catch_discover_tests TARGET) "if(EXISTS \"${ctest_tests_file}\")\n" " include(\"${ctest_tests_file}\")\n" "else()\n" - " add_test(${TARGET}_NOT_BUILT-${args_hash} ${TARGET}_NOT_BUILT-${args_hash})\n" + " message(WARNING \"Test ${TARGET} not built yet.\")\n" "endif()\n" ) @@ -204,3 +204,44 @@ set(_CATCH_DISCOVER_TESTS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CatchAddTests.cmake CACHE INTERNAL "Catch2 full path to CatchAddTests.cmake helper file" ) + +############################################################################### +# function to be called by all tests +function(hip_add_exe_to_target) + set(options) + set(args NAME TEST_TARGET_NAME PLATFORM COMPILE_OPTIONS) + set(list_args TEST_SRC LINKER_LIBS PROPERTY) + cmake_parse_arguments( + PARSE_ARGV 0 + "" # variable prefix + "${options}" + "${args}" + "${list_args}" + ) + # Create shared lib of all tests + add_executable(${_NAME} EXCLUDE_FROM_ALL ${_TEST_SRC} $) + catch_discover_tests(${_NAME} PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") + if(UNIX) + set(_LINKER_LIBS ${_LINKER_LIBS} stdc++fs) + endif() + if(DEFINED _LINKER_LIBS) + target_link_libraries(${_NAME} ${_LINKER_LIBS}) + endif() + + # Add dependency on build_tests to build it on this custom target + add_dependencies(${_TEST_TARGET_NAME} ${_NAME}) + + if (DEFINED _PROPERTY) + set_property(TARGET ${_NAME} PROPERTY ${_PROPERTY}) + endif() + + if (DEFINED _COMPILE_OPTIONS) + target_compile_options(${_NAME} PUBLIC ${_COMPILE_OPTIONS}) + endif() + + foreach(arg IN LISTS _UNPARSED_ARGUMENTS) + message(WARNING "Unparsed arguments: ${arg}") + endforeach() +endfunction() + + diff --git a/tests/catch/hipTestMain/CMakeLists.txt b/tests/catch/hipTestMain/CMakeLists.txt index 84b716a393..13407032a8 100644 --- a/tests/catch/hipTestMain/CMakeLists.txt +++ b/tests/catch/hipTestMain/CMakeLists.txt @@ -22,83 +22,9 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$") add_definitions(-DHT_LOG_ENABLE) endif() -add_executable(UnitTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc) +add_library(Main_Object EXCLUDE_FROM_ALL OBJECT main.cc hip_test_context.cc) if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET UnitTests PROPERTY CXX_STANDARD 17) + set_property(TARGET Main_Object PROPERTY CXX_STANDARD 17) else() - target_compile_options(UnitTests PUBLIC -std=c++17) + target_compile_options(Main_Object PUBLIC -std=c++17) endif() - -target_link_libraries(UnitTests PRIVATE UnitDeviceTests - MemoryTest - StreamTest - EventTest - OccupancyTest - DeviceTest - RTC - printfTests - TextureTest - stdc++fs) - -if(HIP_PLATFORM MATCHES "nvidia") - target_link_libraries(UnitTests PRIVATE nvrtc) -endif() - -catch_discover_tests(UnitTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") - -# ABM exe -add_executable(ABMTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc) -if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET ABMTests PROPERTY CXX_STANDARD 17) -else() - target_compile_options(ABMTests PUBLIC -std=c++17) -endif() - -target_link_libraries(ABMTests PRIVATE ABMAddKernels - stdc++fs) - -catch_discover_tests(ABMTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") - -add_dependencies(build_tests UnitTests ABMTests) - -# Add Multiproc tests as seperate binary -if(UNIX) - add_executable(MultiProcTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc) - - if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET MultiProcTests PROPERTY CXX_STANDARD 17) - else() - target_compile_options(MultiProcTests PUBLIC -std=c++17) - endif() - - target_link_libraries(MultiProcTests PRIVATE MultiProc - stdc++fs) - catch_discover_tests(MultiProcTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") - add_dependencies(build_tests MultiProcTests) -endif() - -add_executable(StressTest EXCLUDE_FROM_ALL main.cc hip_test_context.cc) -add_custom_target(build_stress_test) -if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET StressTest PROPERTY CXX_STANDARD 17) -else() - target_compile_options(StressTest PUBLIC -std=c++17) -endif() -if(HIP_PLATFORM MATCHES "amd") -target_link_libraries(StressTest PRIVATE printf stream) -endif() -target_link_libraries(StressTest PRIVATE memory stdc++fs) -add_dependencies(build_stress_test StressTest) -add_custom_target(stress_test COMMAND StressTest) - -# Space Specifiers/Qualifiers exe -add_executable(TypeQualifierTests EXCLUDE_FROM_ALL main.cc hip_test_context.cc) -if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET TypeQualifierTests PROPERTY CXX_STANDARD 17) -else() - target_compile_options(TypeQualifierTests PUBLIC -std=c++17) -endif() -target_link_libraries(TypeQualifierTests PRIVATE TypeQualifiers stdc++fs) - -catch_discover_tests(TypeQualifierTests PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") -add_dependencies(build_tests TypeQualifierTests) diff --git a/tests/catch/hipTestMain/hip_test_context.cc b/tests/catch/hipTestMain/hip_test_context.cc index 7c8ec946ee..dd440ce153 100644 --- a/tests/catch/hipTestMain/hip_test_context.cc +++ b/tests/catch/hipTestMain/hip_test_context.cc @@ -2,18 +2,8 @@ #include #include #include - -#if __has_include() -#include -namespace fs = std::filesystem; -#elif __has_include() -#include -namespace fs = std::experimental::filesystem; -#else -#error "gg filesystem" -#endif - #include +#include "hip_test_filesystem.hh" void TestContext::detectOS() { #if (HT_WIN == 1) @@ -49,7 +39,7 @@ void TestContext::fillConfig() { if (config_path.has_parent_path() && config_path.has_filename()) { config_.json_file = config_str; } else if (config_path.has_parent_path()) { - config_.json_file = config_path / def_config_json; + config_.json_file = config_path.string() + def_config_json; } else { config_.json_file = exe_path + def_config_json; } diff --git a/tests/catch/include/hip_test_common.hh b/tests/catch/include/hip_test_common.hh index 9107740333..68817ef1c2 100644 --- a/tests/catch/include/hip_test_common.hh +++ b/tests/catch/include/hip_test_common.hh @@ -23,6 +23,7 @@ THE SOFTWARE. #pragma once #include "hip_test_context.hh" #include +#include #define HIP_PRINT_STATUS(status) INFO(hipGetErrorName(status) << " at line: " << __LINE__); @@ -104,4 +105,14 @@ static inline unsigned setNumBlocks(unsigned blocksPerCU, unsigned threadsPerBlo return blocks; } + +static inline int RAND_R(unsigned* rand_seed) +{ + #if defined(_WIN32) || defined(_WIN64) + srand(*rand_seed); + return rand(); + #else + return rand_r(rand_seed); + #endif +} } diff --git a/tests/catch/include/hip_test_filesystem.hh b/tests/catch/include/hip_test_filesystem.hh new file mode 100644 index 0000000000..fffda4146b --- /dev/null +++ b/tests/catch/include/hip_test_filesystem.hh @@ -0,0 +1,89 @@ + +/* +Copyright (c) 2021 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. +*/ + +#pragma once +// We haven't checked which filesystem to include yet +#ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL +// Check for feature test macro for +#if defined(__cpp_lib_filesystem) +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0 +// Check for feature test macro for +#elif defined(__cpp_lib_experimental_filesystem) +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1 +// We can't check if headers exist... +// Let's assume experimental to be safe +#elif !defined(__has_include) +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1 +// Check if the header "" exists +#elif __has_include() +// If we're compiling on Visual Studio and are not compiling with C++17, +// we need to use experimental +#ifdef _MSC_VER +// Check and include header that defines "_HAS_CXX17" +#if __has_include() +#include + +// Check for enabled C++17 support +#if defined(_HAS_CXX17) && _HAS_CXX17 +// We're using C++17, so let's use the normal version +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0 +#endif + +#endif + +// If the marco isn't defined yet, that means any of the other +// VS specific checks failed, so we need to use experimental +#ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1 +#endif + +// Not on Visual Studio. Let's use the normal version +#else // #ifdef _MSC_VER +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 0 +#endif + +// Check if the header "" exists +#elif __has_include() +#define INCLUDE_STD_FILESYSTEM_EXPERIMENTAL 1 + +// Fail if neither header is available with a nice error message +#else +#error Could not find system header "" || + "" +#endif + +// We priously determined that we need the exprimental version +#if INCLUDE_STD_FILESYSTEM_EXPERIMENTAL +// Include it +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 1; +#include +// We need the alias from std::experimental::filesystem to std::filesystem +namespace fs = std::experimental::filesystem; +// We have a decent compiler and can use the normal version +#else +// Include it +#include +namespace fs = std::filesystem; +#endif + +#endif // #ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL \ No newline at end of file diff --git a/tests/catch/include/hip_test_helper.hh b/tests/catch/include/hip_test_helper.hh index 0ea01021e3..04aec9318b 100644 --- a/tests/catch/include/hip_test_helper.hh +++ b/tests/catch/include/hip_test_helper.hh @@ -24,7 +24,10 @@ THE SOFTWARE. #include "hip_test_common.hh" #ifdef __linux__ -#include + #include +#else + #include + #include #endif namespace HipTest { diff --git a/tests/catch/include/hip_test_process.hh b/tests/catch/include/hip_test_process.hh index b345425405..665f5d6b97 100644 --- a/tests/catch/include/hip_test_process.hh +++ b/tests/catch/include/hip_test_process.hh @@ -29,16 +29,7 @@ THE SOFTWARE. #include #include #include - -#if __has_include() -#include -namespace fs = std::filesystem; -#elif __has_include() -#include -namespace fs = std::experimental::filesystem; -#else -#error "gg filesystem" -#endif +#include "hip_test_filesystem.hh" namespace hip { class SpawnProc { diff --git a/tests/catch/multiproc/CMakeLists.txt b/tests/catch/multiproc/CMakeLists.txt index 3e19d38ef9..78de21f674 100644 --- a/tests/catch/multiproc/CMakeLists.txt +++ b/tests/catch/multiproc/CMakeLists.txt @@ -11,14 +11,13 @@ set(LINUX_TEST_SRC hipIpcMemAccessTest.cc hipHostMallocTestsMproc.cc hipMallocConcurrencyMproc.cc + hipMemCoherencyTstMProc.cc ) if(UNIX) - # Create shared lib of all tests - add_library(MultiProc SHARED EXCLUDE_FROM_ALL ${LINUX_TEST_SRC}) - - target_link_libraries(MultiProc ${CMAKE_DL_LIBS}) - - # Add dependency on build_tests to build it on this custom target - add_dependencies(build_tests MultiProc) + # the last argument linker libraries is required for this test but optional to the function + hip_add_exe_to_target(NAME MultiProc + TEST_SRC ${LINUX_TEST_SRC} + TEST_TARGET_NAME build_tests + LINKER_LIBS ${CMAKE_DL_LIBS}) endif() diff --git a/tests/catch/multiproc/hipMemCoherencyTstMProc.cc b/tests/catch/multiproc/hipMemCoherencyTstMProc.cc new file mode 100644 index 0000000000..0f842464b9 --- /dev/null +++ b/tests/catch/multiproc/hipMemCoherencyTstMProc.cc @@ -0,0 +1,809 @@ +/* + Copyright (c) 2021 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. + */ + +/* Test Case Description: + Scenario 3: The test validates if fine grain + behavior is observed or not with memory allocated using malloc() + Scenario 4: The test validates if coarse grain memory + behavior is observed or not with memory allocated using malloc() + Scenario 5: The test validates if fine memory + behavior is observed or not with memory allocated using mmap() + Scenario 6: The test validates if coarse grain memory + behavior is observed or not with memory allocated using mmap() + Scenario:7 Test Case Description: The following test checks if the memory is + accessible when HIP_HOST_COHERENT is set to 0 + Scenario:8 Test Case Description: The following test checks if the memory + exhibits fine grain behavior when HIP_HOST_COHERENT is set to 1 + */ + +#include +#include +#include +#include +#include + +__global__ void CoherentTst(int *ptr, int PeakClk) { + // Incrementing the value by 1 + int64_t GpuFrq = (PeakClk * 1000); + int64_t StrtTck = clock64(); + atomicAdd(ptr, 1); + // The following while loop checks the value in ptr for around 3-4 seconds + while ((clock64() - StrtTck) <= (3 * GpuFrq)) { + if (*ptr == 3) { + atomicAdd(ptr, 1); + return; + } + } +} + +__global__ void SquareKrnl(int *ptr) { + // ptr value squared here + *ptr = (*ptr) * (*ptr); +} + + + +// The variable below will work as signal to decide pass/fail +static bool YES_COHERENT = false; + +// The function tests the coherency of allocated memory +static void TstCoherency(int *Ptr, bool HmmMem) { + int *Dptr = nullptr, peak_clk; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + // storing value 1 in the memory created above + *Ptr = 1; + // Getting gpu frequency + HIP_CHECK(hipDeviceGetAttribute(&peak_clk, hipDeviceAttributeClockRate, 0)); + if (!HmmMem) { + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&Dptr), Ptr, + 0)); + CoherentTst<<<1, 1, 0, strm>>>(Dptr, peak_clk); + } else { + CoherentTst<<<1, 1, 0, strm>>>(Ptr, peak_clk); + } + // looping until the value is 2 for 3 seconds + std::chrono::steady_clock::time_point start = + std::chrono::steady_clock::now(); + while (std::chrono::duration_cast( + std::chrono::steady_clock::now() - start).count() < 3) { + if (*Ptr == 2) { + *Ptr += 1; + break; + } + } + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 4) { + YES_COHERENT = true; + } +} + +/* Test case description: The following test validates if fine grain + behavior is observed or not with memory allocated using malloc()*/ +// The following test is failing on Nvidia platform hence disabled it for now +#if HT_AMD +TEST_CASE("Unit_malloc_CoherentTst") { + if ((setenv("HSA_XNACK", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + // The following code block is used to check for gfx906/8 so as to skip if + // any of the gpus available + int fd1[2]; // Used to store two ends of first pipe + pid_t p; + if (pipe(fd1) == -1) { + fprintf(stderr, "Pipe Failed"); + REQUIRE(false); + } + + /* GpuId[0] for gfx906 exists--> 1 for yes and 0 for no + GpuId[0] for gfx908 exists--> 1 for yes and 0 for no*/ + int GpuId[2] = {0, 0}; + p = fork(); + + if (p < 0) { + fprintf(stderr, "fork Failed"); + REQUIRE(false); + } else if (p > 0) { // parent process + close(fd1[1]); // Close writing end of first pipe + // Wait for child to send a string + wait(NULL); + // Read string from child and close reading end. + read(fd1[0], GpuId, 2 * sizeof(int)); + close(fd1[0]); + if ((GpuId[0] == 1) || (GpuId[0] == 1)) { + WARN("This test is not applicable on MI60 & MI100." + "Skipping the test!!"); + exit(0); + } + } else { // child process + close(fd1[0]); // Close read end of first pipe + hipDeviceProp_t prop; + HIPCHECK(hipGetDeviceProperties(&prop, 0)); + char *p = NULL; + p = strstr(prop.gcnArchName, "gfx906"); + if (p) { + WARN("gfx906 gpu found on this system!!"); + GpuId[0] = 1; + } + p = strstr(prop.gcnArchName, "gfx908"); + if (p) { + WARN("gfx908 gpu found on this system!!"); + GpuId[1] = 1; + } + // Write concatenated string and close writing end + write(fd1[1], GpuId, 2 * sizeof(int)); + close(fd1[1]); + exit(0); + } + + // Test Case execution begins from here + int stat = 0; + if (fork() == 0) { + int managed = 0; + HIPCHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, + 0)); + if (managed == 1) { + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = true; + YES_COHERENT = false; + // Allocating hipMallocManaged() memory + Ptr = reinterpret_cast(malloc(SIZE)); + TstCoherency(Ptr, HmmMem); + free(Ptr); + if (YES_COHERENT) { + // exit() with code 10 which indicates pass + exit(10); + } else { + // exit() with code 9 which indicates fail + exit(9); + } + } else { + SUCCEED("GPU 0 doesn't support hipDeviceAttributeManagedMemory " + "attribute. Hence skipping the testing with Pass result.\n"); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + + +/* Test case description: The following test validates if coarse grain memory + behavior is observed or not with memory allocated using malloc()*/ +// The following test is failing on Nvidia platform hence disabling it for now +#if HT_AMD +TEST_CASE("Unit_malloc_CoherentTstWthAdvise") { + if ((setenv("HSA_XNACK", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + // The following code block is used to check for gfx906/8 so as to skip if + // any of the gpus available + int fd1[2]; // Used to store two ends of first pipe + pid_t p; + if (pipe(fd1) == -1) { + fprintf(stderr, "Pipe Failed"); + REQUIRE(false); + } + + /* GpuId[0] for gfx906 exists--> 1 for yes and 0 for no + GpuId[0] for gfx908 exists--> 1 for yes and 0 for no*/ + int GpuId[2] = {0, 0}; + p = fork(); + + if (p < 0) { + fprintf(stderr, "fork Failed"); + REQUIRE(false); + } else if (p > 0) { // parent process + close(fd1[1]); // Close writing end of first pipe + // Wait for child to send a string + wait(NULL); + // Read string from child and close reading end. + read(fd1[0], GpuId, 2 * sizeof(int)); + close(fd1[0]); + if ((GpuId[0] == 1) || (GpuId[0] == 1)) { + WARN("This test is not applicable on MI60 & MI100." + "Skipping the test!!"); + exit(0); + } + } else { // child process + close(fd1[0]); // Close read end of first pipe + hipDeviceProp_t prop; + HIPCHECK(hipGetDeviceProperties(&prop, 0)); + char *p = NULL; + p = strstr(prop.gcnArchName, "gfx906"); + if (p) { + WARN("gfx906 gpu found on this system!!"); + GpuId[0] = 1; + } + p = strstr(prop.gcnArchName, "gfx908"); + if (p) { + WARN("gfx908 gpu found on this system!!"); + GpuId[1] = 1; + } + // Write concatenated string and close writing end + write(fd1[1], GpuId, 2 * sizeof(int)); + close(fd1[1]); + exit(0); + } + int stat = 0; + if (fork() == 0) { + int managed = 0; + HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, + 0)); + if (managed == 1) { + int *Ptr = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipMallocManaged() memory + Ptr = reinterpret_cast(malloc(SIZE)); + *Ptr = 4; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + SquareKrnl<<<1, 1, 0, strm>>>(Ptr); + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 16) { + // exit() with code 10 which indicates pass + free(Ptr); + exit(10); + } else { + // exit() with code 9 which indicates fail + free(Ptr); + exit(9); + } + } else { + SUCCEED("GPU 0 doesn't support hipDeviceAttributeManagedMemory " + "attribute. Hence skipping the testing with Pass result.\n"); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test case description: The following test validates if fine memory + behavior is observed or not with memory allocated using mmap()*/ +// The following test is failing on Nvidia platform hence disabling it for now +#if HT_AMD +TEST_CASE("Unit_mmap_CoherentTst") { + if ((setenv("HSA_XNACK", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + // The following code block is used to check for gfx906/8 so as to skip if + // any of the gpus available + int fd1[2]; // Used to store two ends of first pipe + pid_t p; + if (pipe(fd1) == -1) { + fprintf(stderr, "Pipe Failed"); + REQUIRE(false); + } + + /* GpuId[0] for gfx906 exists--> 1 for yes and 0 for no + GpuId[0] for gfx908 exists--> 1 for yes and 0 for no*/ + int GpuId[2] = {0, 0}; + p = fork(); + + if (p < 0) { + fprintf(stderr, "fork Failed"); + REQUIRE(false); + } else if (p > 0) { // parent process + close(fd1[1]); // Close writing end of first pipe + // Wait for child to send a string + wait(NULL); + // Read string from child and close reading end. + read(fd1[0], GpuId, 2 * sizeof(int)); + close(fd1[0]); + if ((GpuId[0] == 1) || (GpuId[0] == 1)) { + WARN("This test is not applicable on MI60 & MI100." + "Skipping the test!!"); + exit(0); + } + } else { // child process + close(fd1[0]); // Close read end of first pipe + hipDeviceProp_t prop; + HIPCHECK(hipGetDeviceProperties(&prop, 0)); + char *p = NULL; + p = strstr(prop.gcnArchName, "gfx906"); + if (p) { + WARN("gfx906 gpu found on this system!!"); + GpuId[0] = 1; + } + p = strstr(prop.gcnArchName, "gfx908"); + if (p) { + WARN("gfx908 gpu found on this system!!"); + GpuId[1] = 1; + } + // Write concatenated string and close writing end + write(fd1[1], GpuId, 2 * sizeof(int)); + close(fd1[1]); + exit(0); + } + int stat = 0; + if (fork() == 0) { + int managed = 0; + HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, + 0)); + if (managed == 1) { + bool HmmMem = true; + int *Ptr = reinterpret_cast(mmap(NULL, sizeof(int), + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0)); + if (Ptr == MAP_FAILED) { + WARN("Mapping Failed\n"); + REQUIRE(false); + } + // Initializing the value with 1 + *Ptr = 1; + TstCoherency(Ptr, HmmMem); + int err = munmap(Ptr, sizeof(int)); + if (err != 0) { + WARN("munmap failed\n"); + } + if (YES_COHERENT) { + exit(10); + } else { + exit(9); + } + } else { + SUCCEED("GPU 0 doesn't support hipDeviceAttributeManagedMemory " + "attribute. Hence skipping the testing with Pass result.\n"); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test case description: The following test validates if coarse grain memory + behavior is observed or not with memory allocated using mmap()*/ +// The following test is failing on Nvidia platform hence disabling it for now +#if HT_AMD +TEST_CASE("Unit_mmap_CoherentTstWthAdvise") { + if ((setenv("HSA_XNACK", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + // The following code block is used to check for gfx906/8 so as to skip if + // any of the gpus available + int fd1[2]; // Used to store two ends of first pipe + pid_t p; + if (pipe(fd1) == -1) { + fprintf(stderr, "Pipe Failed"); + REQUIRE(false); + } + + /* GpuId[0] for gfx906 exists--> 1 for yes and 0 for no + GpuId[0] for gfx908 exists--> 1 for yes and 0 for no*/ + int GpuId[2] = {0, 0}; + p = fork(); + + if (p < 0) { + fprintf(stderr, "fork Failed"); + REQUIRE(false); + } else if (p > 0) { // parent process + close(fd1[1]); // Close writing end of first pipe + // Wait for child to send a string + wait(NULL); + // Read string from child and close reading end. + read(fd1[0], GpuId, 2 * sizeof(int)); + close(fd1[0]); + if ((GpuId[0] == 1) || (GpuId[0] == 1)) { + WARN("This test is not applicable on MI60 & MI100." + "Skipping the test!!"); + exit(0); + } + } else { // child process + close(fd1[0]); // Close read end of first pipe + hipDeviceProp_t prop; + HIPCHECK(hipGetDeviceProperties(&prop, 0)); + char *p = NULL; + p = strstr(prop.gcnArchName, "gfx906"); + if (p) { + WARN("gfx906 gpu found on this system!!"); + GpuId[0] = 1; + } + p = strstr(prop.gcnArchName, "gfx908"); + if (p) { + WARN("gfx908 gpu found on this system!!"); + GpuId[1] = 1; + } + // Write concatenated string and close writing end + write(fd1[1], GpuId, 2 * sizeof(int)); + close(fd1[1]); + exit(0); + } + int stat = 0; + if (fork() == 0) { + int managed = 0; + HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, + 0)); + if (managed == 1) { + int SIZE = sizeof(int); + int *Ptr = reinterpret_cast(mmap(NULL, SIZE, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, 0, 0)); + if (Ptr == MAP_FAILED) { + WARN("Mapping Failed\n"); + REQUIRE(false); + } + HIP_CHECK(hipMemAdvise(Ptr, SIZE, hipMemAdviseSetCoarseGrain, 0)); + // Initializing the value with 9 + *Ptr = 9; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + SquareKrnl<<<1, 1, 0, strm>>>(Ptr); + HIP_CHECK(hipStreamSynchronize(strm)); + bool IfTstPassed = false; + if (*Ptr == 81) { + IfTstPassed = true; + } + int err = munmap(Ptr, SIZE); + if (err != 0) { + WARN("munmap failed\n"); + } + if (IfTstPassed) { + exit(10); + } else { + exit(9); + } + } else { + SUCCEED("GPU 0 doesn't support hipDeviceAttributeManagedMemory " + "attribute. Hence skipping the testing with Pass result.\n"); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test Case Description: The following test checks if the memory is + accessible when HIP_HOST_COHERENT is set to 0*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg1") { + if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { + int *Ptr = nullptr, *PtrD = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocPortable)); + *Ptr = 4; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&PtrD), Ptr, 0)); + SquareKrnl<<<1, 1, 0, strm>>>(PtrD); + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 16) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test Case Description: The following test checks if the memory is + accessible when HIP_HOST_COHERENT is set to 0*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg2") { + if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { + int *Ptr = nullptr, *PtrD = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocWriteCombined)); + *Ptr = 4; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&PtrD), Ptr, 0)); + SquareKrnl<<<1, 1, 0, strm>>>(PtrD); + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 16) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test Case Description: The following test checks if the memory is + accessible when HIP_HOST_COHERENT is set to 0*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg3") { + if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { + int *Ptr = nullptr, *PtrD = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocNumaUser)); + *Ptr = 4; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&PtrD), Ptr, 0)); + SquareKrnl<<<1, 1, 0, strm>>>(PtrD); + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 16) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test Case Description: The following test checks if the memory is + accessible when HIP_HOST_COHERENT is set to 0*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg4") { + if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { + int *Ptr = nullptr, *PtrD = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocNonCoherent)); + *Ptr = 4; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&PtrD), Ptr, 0)); + SquareKrnl<<<1, 1, 0, strm>>>(PtrD); + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 16) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + + +/* Test Case Description: The following test checks if the memory exhibits + fine grain behavior when HIP_HOST_COHERENT is set to 1*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv1") { + if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { // child process + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = false; + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE)); + *Ptr = 4; + TstCoherency(Ptr, HmmMem); + if (YES_COHERENT) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { // parent process + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + + +/* Test Case Description: The following test checks if the memory exhibits + fine grain behavior when HIP_HOST_COHERENT is set to 1*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg1") { + if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { // child process + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = false; + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocPortable)); + *Ptr = 1; + TstCoherency(Ptr, HmmMem); + if (YES_COHERENT) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { // parent process + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + +/* Test Case Description: The following test checks if the memory exhibits + fine grain behavior when HIP_HOST_COHERENT is set to 1*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg2") { + if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { // child process + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = false; + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocWriteCombined)); + *Ptr = 4; + TstCoherency(Ptr, HmmMem); + if (YES_COHERENT) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { // parent process + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + + +/* Test Case Description: The following test checks if the memory exhibits + fine grain behavior when HIP_HOST_COHERENT is set to 1*/ +// The following test is AMD specific test hence skipping for Nvidia +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg3") { + if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { + WARN("Unable to turn on HSA_XNACK, hence terminating the Test case!"); + REQUIRE(false); + } + int stat = 0; + if (fork() == 0) { // child process + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = false; + YES_COHERENT = false; + // Allocating hipHostMalloc() memory + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocNumaUser)); + *Ptr = 1; + TstCoherency(Ptr, HmmMem); + if (YES_COHERENT) { + // exit() with code 10 which indicates pass + HIP_CHECK(hipHostFree(Ptr)); + exit(10); + } else { + // exit() with code 9 which indicates fail + HIP_CHECK(hipHostFree(Ptr)); + exit(9); + } + } else { // parent process + wait(&stat); + int Result = WEXITSTATUS(stat); + if (Result != 10) { + REQUIRE(false); + } + } +} +#endif + + diff --git a/tests/catch/stress/CMakeLists.txt b/tests/catch/stress/CMakeLists.txt index 00e12f2c2c..2b022bf481 100644 --- a/tests/catch/stress/CMakeLists.txt +++ b/tests/catch/stress/CMakeLists.txt @@ -1,3 +1,5 @@ +add_custom_target(stress_test COMMAND "${CMAKE_CTEST_COMMAND}" -R "Stress_") + add_subdirectory(memory) if(HIP_PLATFORM MATCHES "amd") add_subdirectory(printf) diff --git a/tests/catch/stress/memory/CMakeLists.txt b/tests/catch/stress/memory/CMakeLists.txt index 5afd69ee11..0c2d3fc6aa 100644 --- a/tests/catch/stress/memory/CMakeLists.txt +++ b/tests/catch/stress/memory/CMakeLists.txt @@ -2,10 +2,9 @@ set(TEST_SRC memcpy.cc hipMemcpyMThreadMSize.cc + hipMallocManagedStress.cc ) -# Create shared lib of all tests -add_library(memory SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_stress_test memory) +hip_add_exe_to_target(NAME memory + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME stress_test) diff --git a/tests/catch/stress/memory/hipMallocManagedStress.cc b/tests/catch/stress/memory/hipMallocManagedStress.cc new file mode 100644 index 0000000000..0e7d80edb6 --- /dev/null +++ b/tests/catch/stress/memory/hipMallocManagedStress.cc @@ -0,0 +1,106 @@ +/* + Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR + IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +// The following test case allocation, host access, device access of HMM +// memory from size 1 to 10KB + +#include +#include + +#define INCRMNT 10 +// Kernel function +__global__ void KrnlWth2MemTypesC(unsigned char *Hmm, unsigned char *Dptr, + size_t n) { + size_t index = blockIdx.x * blockDim.x + threadIdx.x; + size_t stride = blockDim.x * gridDim.x; + for (size_t i = index; i < n; i += stride) { + Hmm[i] = Dptr[i] + INCRMNT; + } +} +static bool IfTestPassed = true; + +static int HmmAttrPrint() { + int managed = 0; + INFO("The following are the attribute values related to HMM for" + " device 0:\n"); + HIP_CHECK(hipDeviceGetAttribute(&managed, + hipDeviceAttributeDirectManagedMemAccessFromHost, 0)); + INFO("hipDeviceAttributeDirectManagedMemAccessFromHost: " << managed); + HIP_CHECK(hipDeviceGetAttribute(&managed, + hipDeviceAttributeConcurrentManagedAccess, 0)); + INFO("hipDeviceAttributeConcurrentManagedAccess: " << managed); + HIP_CHECK(hipDeviceGetAttribute(&managed, + hipDeviceAttributePageableMemoryAccess, 0)); + INFO("hipDeviceAttributePageableMemoryAccess: " << managed); + HIP_CHECK(hipDeviceGetAttribute(&managed, + hipDeviceAttributePageableMemoryAccessUsesHostPageTables, 0)); + INFO("hipDeviceAttributePageableMemoryAccessUsesHostPageTables:" + << managed); + + HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, + 0)); + INFO("hipDeviceAttributeManagedMemory: " << managed); + return managed; +} +// The following test case allocation, host access, device access of HMM +// memory from size 1 to 10KB + +TEST_CASE("Unit_hipMallocManaged_MultiSize") { + IfTestPassed = true; + int managed = HmmAttrPrint(); + if (managed == 1) { + unsigned char *Hmm1 = nullptr, *Hmm2 = nullptr; + int InitVal = 100, blockSize = 64, DataMismatch = 0; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + dim3 dimBlock(blockSize, 1, 1); + for (int i = 1; i < (1024*1024); ++i) { + HIP_CHECK(hipMallocManaged(&Hmm1, i)); + HIP_CHECK(hipMallocManaged(&Hmm2, i)); + for (int j = 0; j < i; ++j) { + Hmm1[j] = InitVal; + } + dim3 dimGrid((i + blockSize -1)/blockSize, 1, 1); + KrnlWth2MemTypesC<<>>(Hmm2, Hmm1, i); + HIP_CHECK(hipStreamSynchronize(strm)); + // Verifying the results + for (int k = 0; k < i; ++k) { + if (Hmm2[k] != (InitVal + INCRMNT)) { + DataMismatch++; + } + } + if (DataMismatch != 0) { + WARN("DataMismatch observed!\n"); + IfTestPassed = false; + } + DataMismatch = 0; + HIP_CHECK(hipFree(Hmm1)); + HIP_CHECK(hipFree(Hmm2)); + if (IfTestPassed == false) { + HIP_CHECK(hipStreamDestroy(strm)); + REQUIRE(false); + } + } + HIP_CHECK(hipStreamDestroy(strm)); + } else { + SUCCEED("GPU 0 doesn't support hipDeviceAttributeManagedMemory " + "attribute. Hence skipping the testing with Pass result.\n"); + } +} + diff --git a/tests/catch/stress/memory/hipMemcpyMThreadMSize.cc b/tests/catch/stress/memory/hipMemcpyMThreadMSize.cc index 791f15154e..3b0e8b7ee1 100644 --- a/tests/catch/stress/memory/hipMemcpyMThreadMSize.cc +++ b/tests/catch/stress/memory/hipMemcpyMThreadMSize.cc @@ -261,7 +261,7 @@ void Memcpy_And_verify(int NUM_ELM) { } } -TEMPLATE_TEST_CASE("Unit_hipMemcpy_multiDevice-AllAPIs", "", +TEMPLATE_TEST_CASE("Stress_hipMemcpy_multiDevice-AllAPIs", "", char, int, size_t, long double) { auto diff_size = GENERATE(1, 5, 10, 100, 1024, 10*1024, 100*1024, 1024*1024, 10*1024*1024, 100*1024*1024, diff --git a/tests/catch/stress/memory/memcpy.cc b/tests/catch/stress/memory/memcpy.cc index 59b8baa233..21957e0fdb 100644 --- a/tests/catch/stress/memory/memcpy.cc +++ b/tests/catch/stress/memory/memcpy.cc @@ -1,6 +1,6 @@ #include -TEST_CASE("hipMalloc", "DifferentSizes") { +TEST_CASE("Stress_hipMalloc", "DifferentSizes") { int* d_a = nullptr; SECTION("Size 10") { auto res = hipMalloc(&d_a, sizeof(10)); diff --git a/tests/catch/stress/printf/CMakeLists.txt b/tests/catch/stress/printf/CMakeLists.txt index 4a7a915658..1977d293f2 100644 --- a/tests/catch/stress/printf/CMakeLists.txt +++ b/tests/catch/stress/printf/CMakeLists.txt @@ -4,8 +4,6 @@ set(TEST_SRC Stress_printf_SimpleKernels.cc ) -# Create shared lib of all tests -add_library(printf SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_stress_test printf) +hip_add_exe_to_target(NAME printf + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME stress_test) diff --git a/tests/catch/stress/stream/CMakeLists.txt b/tests/catch/stress/stream/CMakeLists.txt index e2b5ea0c5d..357c3e5e36 100644 --- a/tests/catch/stress/stream/CMakeLists.txt +++ b/tests/catch/stress/stream/CMakeLists.txt @@ -3,8 +3,6 @@ set(TEST_SRC Stress_hipStreamCreate.cc ) -# Create shared lib of all tests -add_library(stream SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_stress_test stream) +hip_add_exe_to_target(NAME stream + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME stress_test) diff --git a/tests/catch/unit/CMakeLists.txt b/tests/catch/unit/CMakeLists.txt index 55a6664b53..b81a588d00 100644 --- a/tests/catch/unit/CMakeLists.txt +++ b/tests/catch/unit/CMakeLists.txt @@ -28,3 +28,4 @@ add_subdirectory(rtc) add_subdirectory(printf) add_subdirectory(printfExe) add_subdirectory(texture) +add_subdirectory(graph) diff --git a/tests/catch/unit/device/CMakeLists.txt b/tests/catch/unit/device/CMakeLists.txt index 0f0771994b..778cd199dc 100644 --- a/tests/catch/unit/device/CMakeLists.txt +++ b/tests/catch/unit/device/CMakeLists.txt @@ -17,9 +17,6 @@ set(TEST_SRC hipSetGetDevice.cc ) - -# Create shared lib of all tests -add_library(DeviceTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests DeviceTest) +hip_add_exe_to_target(NAME DeviceTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/unit/deviceLib/CMakeLists.txt b/tests/catch/unit/deviceLib/CMakeLists.txt index 191553ca99..347e6d73c9 100644 --- a/tests/catch/unit/deviceLib/CMakeLists.txt +++ b/tests/catch/unit/deviceLib/CMakeLists.txt @@ -9,12 +9,18 @@ set(TEST_SRC brev.cc popc.cc ldg.cc - syncthreadsand.cc - syncthreadscount.cc - syncthreadsor.cc threadfence_system.cc ) +# skipped for windows compiler issue - Illegal instruction detected +if(UNIX) + set(TEST_SRC ${TEST_SRC} + syncthreadsand.cc + syncthreadscount.cc + syncthreadsor.cc) +endif() + + # AMD only tests set(AMD_TEST_SRC unsafeAtomicAdd.cc @@ -28,15 +34,12 @@ set(AMD_TEST_SRC if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) set_source_files_properties(floatTM.cc PROPERTIES COMPILE_FLAGS -std=c++17) + hip_add_exe_to_target(NAME UnitDeviceTests + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) +elseif(HIP_PLATFORM MATCHES "nvidia") + hip_add_exe_to_target(NAME UnitDeviceTests + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests + COMPILE_OPTIONS --Wno-deprecated-declarations) endif() - - -# Create shared lib of all tests -add_library(UnitDeviceTests SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -if(HIP_PLATFORM MATCHES "nvidia") - target_compile_options(UnitDeviceTests PUBLIC --Wno-deprecated-declarations) -endif() - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests UnitDeviceTests) diff --git a/tests/catch/unit/event/CMakeLists.txt b/tests/catch/unit/event/CMakeLists.txt index a2fdc1cdd7..6b6ef7c3c4 100644 --- a/tests/catch/unit/event/CMakeLists.txt +++ b/tests/catch/unit/event/CMakeLists.txt @@ -3,12 +3,15 @@ set(TEST_SRC Unit_hipEvent_Negative.cc Unit_hipEvent.cc Unit_hipEventElapsedTime.cc - Unit_hipEventRecord.cc - Unit_hipEventIpc.cc ) -# Create shared lib of all tests -add_library(EventTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) +# skipped for windows due to duplicate symbols +if(UNIX) + set(TEST_SRC ${TEST_SRC} + Unit_hipEventRecord.cc + Unit_hipEventIpc.cc) +endif() -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests EventTest) +hip_add_exe_to_target(NAME EventTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/bin/hipexamine-perl.sh b/tests/catch/unit/graph/CMakeLists.txt old mode 100755 new mode 100644 similarity index 69% rename from bin/hipexamine-perl.sh rename to tests/catch/unit/graph/CMakeLists.txt index 1285017907..80fb448618 --- a/bin/hipexamine-perl.sh +++ b/tests/catch/unit/graph/CMakeLists.txt @@ -1,5 +1,4 @@ -#!/bin/bash -# Copyright (c) 2017 - 2021 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2021 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 @@ -19,13 +18,17 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -#usage : hipexamine-perl.sh DIRNAME [hipify-perl options] +# Common Tests - Test independent of all platforms +set(TEST_SRC + hipGraphAddEmptyNode.cc + hipGraphAddDependencies.cc + hipGraph.cc + hipSimpleGraphWithKernel.cc + hipGraphAddMemcpyNode.cc +) -# Generate HIP stats (LOC, CUDA->API conversions, missing functionality) for all the code files -# in the specified directory. +# Create shared lib of all tests +add_library(GraphsTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -SCRIPT_DIR=`dirname $0` -SEARCH_DIR=$1 -shift -$SCRIPT_DIR/hipify-perl -no-output -print-stats "$@" `$SCRIPT_DIR/findcode.sh $SEARCH_DIR` +# Add dependency on build_tests to build it on this custom target +add_dependencies(build_tests GraphsTest) diff --git a/tests/catch/unit/graph/hipGraph.cc b/tests/catch/unit/graph/hipGraph.cc new file mode 100644 index 0000000000..d7c07149ff --- /dev/null +++ b/tests/catch/unit/graph/hipGraph.cc @@ -0,0 +1,346 @@ +/* +Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/** +Testcase Scenarios : + 1) Execution Without HIPGraphs : Regular procedure of using stream with async api calls. + 2) Manual HIPGraph : Manual procedure of adding nodes to graphs and mapping dependencies. + 3) HIPGraphs Using StreamCapture : Capturing sequence of operations in stream and launching + graph with the nodes automatically added. +*/ + +#include + +#define THREADS_PER_BLOCK 512 +#define GRAPH_LAUNCH_ITERATIONS 1000 + +static __global__ void reduce(float* d_in, double* d_out) { + int myId = threadIdx.x + blockDim.x * blockIdx.x; + int tid = threadIdx.x; + for (int s = blockDim.x / 2; s > 0; s >>= 1) { + if (tid < s) { + d_in[myId] += d_in[myId + s]; + } + __syncthreads(); + } + if (tid == 0) { + d_out[blockIdx.x] = d_in[myId]; + } +} + +static __global__ void reduceFinal(double* d_in, double* d_out) { + int myId = threadIdx.x + blockDim.x * blockIdx.x; + int tid = threadIdx.x; + for (int s = blockDim.x / 2; s > 0; s >>= 1) { + if (tid < s) { + d_in[myId] += d_in[myId + s]; + } + __syncthreads(); + } + if (tid == 0) { + *d_out = d_in[myId]; + } +} + +static void init_input(float* a, size_t size) { + unsigned int seed = time(nullptr); + for (size_t i = 0; i < size; i++) { + a[i] = (rand_r(&seed) & 0xFF) / static_cast(RAND_MAX); + } +} + +/** + * Regular procedure of using stream with async api calls + */ +static void hipWithoutGraphs(float* inputVec_h, float* inputVec_d, + double* outputVec_d, double* result_d, size_t inputSize, size_t numOfBlocks) { + hipStream_t stream1, stream2, stream3; + hipEvent_t forkStreamEvent, memsetEvent1, memsetEvent2; + double result_h = 0.0; + HIP_CHECK(hipStreamCreate(&stream1)); + HIP_CHECK(hipStreamCreate(&stream2)); + HIP_CHECK(hipStreamCreate(&stream3)); + HIP_CHECK(hipEventCreate(&forkStreamEvent)); + HIP_CHECK(hipEventCreate(&memsetEvent1)); + HIP_CHECK(hipEventCreate(&memsetEvent2)); + auto start = std::chrono::high_resolution_clock::now(); + for (int i = 0; i < GRAPH_LAUNCH_ITERATIONS; i++) { + HIP_CHECK(hipMemcpyAsync(inputVec_d, inputVec_h, sizeof(float) * inputSize, + hipMemcpyDefault, stream1)); + HIP_CHECK(hipMemsetAsync(outputVec_d, 0, sizeof(double) * numOfBlocks, + stream2)); + HIP_CHECK(hipEventRecord(memsetEvent1, stream2)); + HIP_CHECK(hipMemsetAsync(result_d, 0, sizeof(double), stream3)); + HIP_CHECK(hipEventRecord(memsetEvent2, stream3)); + HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent1, 0)); + hipLaunchKernelGGL(reduce, dim3(inputSize / THREADS_PER_BLOCK, 1, 1), + dim3(THREADS_PER_BLOCK, 1, 1), 0, stream1, inputVec_d, + outputVec_d); + HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent2, 0)); + hipLaunchKernelGGL(reduceFinal, dim3(1, 1, 1), + dim3(THREADS_PER_BLOCK, 1, 1), 0, stream1, + outputVec_d, result_d); + HIP_CHECK(hipMemcpyAsync(&result_h, result_d, sizeof(double), + hipMemcpyDefault, stream1)); + HIP_CHECK(hipStreamSynchronize(stream1)); + } + auto stop = std::chrono::high_resolution_clock::now(); + auto result = std::chrono::duration(stop - start); + INFO("Time taken for hipWithoutGraphs : " + << std::chrono::duration_cast(result).count() + << " millisecs "); + HIP_CHECK(hipStreamDestroy(stream1)); + HIP_CHECK(hipStreamDestroy(stream2)); + HIP_CHECK(hipStreamDestroy(stream3)); + double result_h_cpu = 0.0; + for (size_t i = 0; i < inputSize; i++) { + result_h_cpu += inputVec_h[i]; + } + + REQUIRE(result_h_cpu == result_h); +} + +/** + * Capturing sequence of operations in stream and launching graph + * with the nodes automatically added. + */ +static void hipGraphsUsingStreamCapture(float* inputVec_h, float* inputVec_d, + double* outputVec_d, double* result_d, + size_t inputSize, size_t numOfBlocks) { + hipStream_t stream1, stream2, stream3, streamForGraph; + hipEvent_t forkStreamEvent, memsetEvent1, memsetEvent2; + hipGraph_t graph; + double result_h = 0.0; + HIP_CHECK(hipStreamCreate(&stream1)); + HIP_CHECK(hipStreamCreate(&stream2)); + HIP_CHECK(hipStreamCreate(&stream3)); + HIP_CHECK(hipStreamCreate(&streamForGraph)); + HIP_CHECK(hipEventCreate(&forkStreamEvent)); + HIP_CHECK(hipEventCreate(&memsetEvent1)); + HIP_CHECK(hipEventCreate(&memsetEvent2)); + auto start = std::chrono::high_resolution_clock::now(); + HIP_CHECK(hipStreamBeginCapture(stream1, hipStreamCaptureModeGlobal)); + HIP_CHECK(hipEventRecord(forkStreamEvent, stream1)); + HIP_CHECK(hipStreamWaitEvent(stream2, forkStreamEvent, 0)); + HIP_CHECK(hipStreamWaitEvent(stream3, forkStreamEvent, 0)); + HIP_CHECK(hipMemcpyAsync(inputVec_d, inputVec_h, sizeof(float) * inputSize, + hipMemcpyDefault, stream1)); + HIP_CHECK(hipMemsetAsync(outputVec_d, 0, sizeof(double) * numOfBlocks, + stream2)); + HIP_CHECK(hipEventRecord(memsetEvent1, stream2)); + HIP_CHECK(hipMemsetAsync(result_d, 0, sizeof(double), stream3)); + HIP_CHECK(hipEventRecord(memsetEvent2, stream3)); + HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent1, 0)); + hipLaunchKernelGGL(reduce, dim3(inputSize / THREADS_PER_BLOCK, 1, 1), + dim3(THREADS_PER_BLOCK, 1, 1), 0, stream1, + inputVec_d, outputVec_d); + HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent2, 0)); + hipLaunchKernelGGL(reduceFinal, dim3(1, 1, 1), dim3(THREADS_PER_BLOCK, 1, 1), + 0, stream1, outputVec_d, result_d); + HIP_CHECK(hipMemcpyAsync(&result_h, result_d, sizeof(double), + hipMemcpyDefault, stream1)); + HIP_CHECK(hipStreamEndCapture(stream1, &graph)); + hipGraphNode_t* nodes{nullptr}; + size_t numNodes = 0; + HIP_CHECK(hipGraphGetNodes(graph, nodes, &numNodes)); + INFO("Num of nodes in the graph created using stream capture API" + << numNodes); + HIP_CHECK(hipGraphGetRootNodes(graph, nodes, &numNodes)); + INFO("Num of root nodes in the graph created using" + " stream capture API" << numNodes); + hipGraphExec_t graphExec; + + HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); + auto start1 = std::chrono::high_resolution_clock::now(); + for (int i = 0; i < GRAPH_LAUNCH_ITERATIONS; i++) { + HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); + } + HIP_CHECK(hipStreamSynchronize(streamForGraph)); + auto stop = std::chrono::high_resolution_clock::now(); + auto withInit = + std::chrono::duration(stop - start); + auto withoutInit = + std::chrono::duration(stop - start1); + INFO("Time taken for hipGraphsUsingStreamCapture with Init: " + << std::chrono::duration_cast(withInit).count() + << " milliseconds without Init:" + << std::chrono::duration_cast(withoutInit).count() + << " milliseconds "); + + HIP_CHECK(hipGraphExecDestroy(graphExec)); + HIP_CHECK(hipGraphDestroy(graph)); + HIP_CHECK(hipStreamDestroy(stream1)); + HIP_CHECK(hipStreamDestroy(stream2)); + HIP_CHECK(hipStreamDestroy(stream3)); + HIP_CHECK(hipStreamDestroy(streamForGraph)); + double result_h_cpu = 0.0; + for (size_t i = 0; i < inputSize; i++) { + result_h_cpu += inputVec_h[i]; + } + + REQUIRE(result_h_cpu == result_h); +} + +/** + * Manual procedure of adding nodes to graphs and mapping dependencies. + */ +static void hipGraphsManual(float* inputVec_h, float* inputVec_d, + double* outputVec_d, double* result_d, size_t inputSize, + size_t numOfBlocks) { + hipStream_t streamForGraph; + hipGraph_t graph; + std::vector nodeDependencies; + hipGraphNode_t memcpyNode, kernelNode, memsetNode; + double result_h = 0.0; + HIP_CHECK(hipStreamCreate(&streamForGraph)); + auto start = std::chrono::high_resolution_clock::now(); + hipKernelNodeParams kernelNodeParams{}; + hipMemsetParams memsetParams{}; + memsetParams.dst = reinterpret_cast(outputVec_d); + memsetParams.value = 0; + memsetParams.pitch = 0; + memsetParams.elementSize = sizeof(float); + memsetParams.width = numOfBlocks * 2; + memsetParams.height = 1; + HIP_CHECK(hipGraphCreate(&graph, 0)); + HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyNode, graph, nullptr, 0, inputVec_d, + inputVec_h, sizeof(float) * inputSize, hipMemcpyHostToDevice)); + HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, + 0, &memsetParams)); + nodeDependencies.push_back(memsetNode); + nodeDependencies.push_back(memcpyNode); + void* kernelArgs[4] = {reinterpret_cast(&inputVec_d), + reinterpret_cast(&outputVec_d), &inputSize, + &numOfBlocks}; + kernelNodeParams.func = reinterpret_cast(reduce); + kernelNodeParams.gridDim = dim3(inputSize / THREADS_PER_BLOCK, 1, 1); + kernelNodeParams.blockDim = dim3(THREADS_PER_BLOCK, 1, 1); + kernelNodeParams.sharedMemBytes = 0; + kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs); + kernelNodeParams.extra = nullptr; + HIP_CHECK(hipGraphAddKernelNode(&kernelNode, graph, nodeDependencies.data(), + nodeDependencies.size(), &kernelNodeParams)); + nodeDependencies.clear(); + nodeDependencies.push_back(kernelNode); + memset(&memsetParams, 0, sizeof(memsetParams)); + memsetParams.dst = result_d; + memsetParams.value = 0; + memsetParams.elementSize = sizeof(float); + memsetParams.width = 2; + memsetParams.height = 1; + HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, + &memsetParams)); + nodeDependencies.push_back(memsetNode); + memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); + kernelNodeParams.func = reinterpret_cast(reduceFinal); + kernelNodeParams.gridDim = dim3(1, 1, 1); + kernelNodeParams.blockDim = dim3(THREADS_PER_BLOCK, 1, 1); + kernelNodeParams.sharedMemBytes = 0; + void* kernelArgs2[3] = {reinterpret_cast(&outputVec_d), + reinterpret_cast(&result_d), &numOfBlocks}; + kernelNodeParams.kernelParams = kernelArgs2; + kernelNodeParams.extra = nullptr; + HIP_CHECK(hipGraphAddKernelNode(&kernelNode, graph, nodeDependencies.data(), + nodeDependencies.size(), &kernelNodeParams)); + nodeDependencies.clear(); + nodeDependencies.push_back(kernelNode); + HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyNode, graph, + nodeDependencies.data(), nodeDependencies.size(), &result_h, + result_d, sizeof(double), hipMemcpyDeviceToHost)); + nodeDependencies.clear(); + nodeDependencies.push_back(memcpyNode); + hipGraphExec_t graphExec; + hipGraphNode_t* nodes{nullptr}; + size_t numNodes{}; + HIP_CHECK(hipGraphGetNodes(graph, nodes, &numNodes)); + INFO("Num of nodes in the graph created using hipGraphs Manual" + << numNodes); + HIP_CHECK(hipGraphGetRootNodes(graph, nodes, &numNodes)); + INFO("Num of root nodes in the graph created using" + " hipGraphs Manual" << numNodes); + HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); + auto start1 = std::chrono::high_resolution_clock::now(); + for (int i = 0; i < GRAPH_LAUNCH_ITERATIONS; i++) { + HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); + } + HIP_CHECK(hipStreamSynchronize(streamForGraph)); + auto stop = std::chrono::high_resolution_clock::now(); + auto withInit = + std::chrono::duration(stop - start); + auto withoutInit = + std::chrono::duration(stop - start1); + + INFO("Time taken for hipGraphsManual with Init: " + << std::chrono::duration_cast(withInit).count() + << " milliseconds without Init:" + << std::chrono::duration_cast(withoutInit).count() + << " milliseconds "); + + HIP_CHECK(hipGraphExecDestroy(graphExec)); + HIP_CHECK(hipGraphDestroy(graph)); + HIP_CHECK(hipStreamDestroy(streamForGraph)); + double result_h_cpu = 0.0; + for (size_t i = 0; i < inputSize; i++) { + result_h_cpu += inputVec_h[i]; + } + + REQUIRE(result_h_cpu == result_h); +} + +/** + * Tests basic functionality of hipGraph APIs by + * Execution Without HIPGraphs, Manual HIPGraph, HIPGraphs Using StreamCapture. + */ +TEST_CASE("Unit_hipGraph_BasicFunctional") { + constexpr size_t size = 1 << 12; + constexpr size_t maxBlocks = 512; + float *inputVec_d{nullptr}, *inputVec_h{nullptr}; + double *outputVec_d{nullptr}, *result_d{nullptr}; + + INFO("Elements : " << size << " ThreadsPerBlock : " << THREADS_PER_BLOCK); + INFO("Graph Launch iterations = " << GRAPH_LAUNCH_ITERATIONS); + + hipSetDevice(0); + inputVec_h = reinterpret_cast(malloc(sizeof(float) * size)); + REQUIRE(inputVec_h != nullptr); + HIP_CHECK(hipMalloc(&inputVec_d, sizeof(float) * size)); + HIP_CHECK(hipMalloc(&outputVec_d, sizeof(double) * maxBlocks)); + HIP_CHECK(hipMalloc(&result_d, sizeof(double))); + init_input(inputVec_h, size); + + SECTION("Execution Without HIPGraphs") { + hipWithoutGraphs(inputVec_h, inputVec_d, outputVec_d, + result_d, size, maxBlocks); + } + + SECTION("Manual HIPGraph") { + hipGraphsManual(inputVec_h, inputVec_d, outputVec_d, + result_d, size, maxBlocks); + } + + SECTION("HIPGraphs Using StreamCapture") { + hipGraphsUsingStreamCapture(inputVec_h, inputVec_d, + outputVec_d, result_d, size, maxBlocks); + } + + HIP_CHECK(hipFree(inputVec_d)); + HIP_CHECK(hipFree(outputVec_d)); + HIP_CHECK(hipFree(result_d)); + free(inputVec_h); +} diff --git a/tests/catch/unit/graph/hipGraphAddDependencies.cc b/tests/catch/unit/graph/hipGraphAddDependencies.cc new file mode 100644 index 0000000000..c84485a841 --- /dev/null +++ b/tests/catch/unit/graph/hipGraphAddDependencies.cc @@ -0,0 +1,127 @@ +/* +Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/** +Testcase Scenarios : + 1) Add different kinds of nodes to graph and add dependencies to nodes. + Verify sequence of graph execution is based on dependencies created. +*/ + +#include +#include +#include + +/** + * Functional Test for adding dependencies in graph and verifying execution. + */ +TEST_CASE("Unit_hipGraphAddDependencies_Functional") { + constexpr size_t N = 1024; + constexpr size_t Nbytes = N * sizeof(int); + constexpr auto blocksPerCU = 6; // to hide latency + constexpr auto threadsPerBlock = 256; + hipGraph_t graph; + hipGraphNode_t memset_A, memset_B, memsetKer_C; + hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_C; + hipGraphNode_t kernel_vecAdd; + hipKernelNodeParams kernelNodeParams{}; + hipStream_t streamForGraph; + int *A_d, *B_d, *C_d; + int *A_h, *B_h, *C_h; + hipGraphExec_t graphExec; + hipMemsetParams memsetParams{}; + int memsetVal{}; + size_t NElem{N}; + + HIP_CHECK(hipStreamCreate(&streamForGraph)); + HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); + unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); + + HIP_CHECK(hipGraphCreate(&graph, 0)); + + memset(&memsetParams, 0, sizeof(memsetParams)); + memsetParams.dst = reinterpret_cast(A_d); + memsetParams.value = 0; + memsetParams.pitch = 0; + memsetParams.elementSize = sizeof(char); + memsetParams.width = Nbytes; + memsetParams.height = 1; + HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, + &memsetParams)); + + memset(&memsetParams, 0, sizeof(memsetParams)); + memsetParams.dst = reinterpret_cast(B_d); + memsetParams.value = 0; + memsetParams.pitch = 0; + memsetParams.elementSize = sizeof(char); + memsetParams.width = Nbytes; + memsetParams.height = 1; + HIP_CHECK(hipGraphAddMemsetNode(&memset_B, graph, nullptr, 0, + &memsetParams)); + + void* kernelArgs1[] = {&C_d, &memsetVal, reinterpret_cast(&NElem)}; + kernelNodeParams.func = + reinterpret_cast(HipTest::memsetReverse); + kernelNodeParams.gridDim = dim3(blocks); + kernelNodeParams.blockDim = dim3(threadsPerBlock); + kernelNodeParams.sharedMemBytes = 0; + kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); + kernelNodeParams.extra = nullptr; + HIP_CHECK(hipGraphAddKernelNode(&memsetKer_C, graph, nullptr, 0, + &kernelNodeParams)); + + HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, + Nbytes, hipMemcpyHostToDevice)); + + HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_B, graph, nullptr, 0, B_d, B_h, + Nbytes, hipMemcpyHostToDevice)); + + HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_C, graph, nullptr, 0, C_h, C_d, + Nbytes, hipMemcpyDeviceToHost)); + + void* kernelArgs2[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; + kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); + kernelNodeParams.gridDim = dim3(blocks); + kernelNodeParams.blockDim = dim3(threadsPerBlock); + kernelNodeParams.sharedMemBytes = 0; + kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); + kernelNodeParams.extra = nullptr; + HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nullptr, 0, + &kernelNodeParams)); + + // Create dependencies + HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); + HIP_CHECK(hipGraphAddDependencies(graph, &memset_B, &memcpyH2D_B, 1)); + HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); + HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); + HIP_CHECK(hipGraphAddDependencies(graph, &memsetKer_C, &kernel_vecAdd, 1)); + HIP_CHECK(hipGraphAddDependencies(graph, &kernel_vecAdd, &memcpyD2H_C, 1)); + + // Instantiate and launch the graph + HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); + HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); + HIP_CHECK(hipStreamSynchronize(streamForGraph)); + + // Verify graph execution result + HipTest::checkVectorADD(A_h, B_h, C_h, N); + + HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); + HIP_CHECK(hipGraphExecDestroy(graphExec)); + HIP_CHECK(hipGraphDestroy(graph)); + HIP_CHECK(hipStreamDestroy(streamForGraph)); +} diff --git a/tests/catch/unit/graph/hipGraphAddEmptyNode.cc b/tests/catch/unit/graph/hipGraphAddEmptyNode.cc new file mode 100644 index 0000000000..5e30c1a07b --- /dev/null +++ b/tests/catch/unit/graph/hipGraphAddEmptyNode.cc @@ -0,0 +1,57 @@ +/* +Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/** +Testcase Scenarios : + 1) Create and add empty node to graph and verify addition is successful. +*/ + +#include + +/** + * Functional Test to add empty node with dependencies + */ +TEST_CASE("Unit_hipGraphAddEmptyNode_Functional") { + char *pOutBuff_d{}; + constexpr size_t size = 1024; + hipGraph_t graph{}; + hipGraphNode_t memsetNode{}, emptyNode{}; + std::vector dependencies; + + HIP_CHECK(hipMalloc(&pOutBuff_d, size)); + hipMemsetParams memsetParams{}; + memsetParams.dst = reinterpret_cast(pOutBuff_d); + memsetParams.value = 0; + memsetParams.pitch = 0; + memsetParams.elementSize = sizeof(char); + memsetParams.width = size * sizeof(char); + memsetParams.height = 1; + HIP_CHECK(hipGraphCreate(&graph, 0)); + HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, + &memsetParams)); + dependencies.push_back(memsetNode); + + // Create emptyNode and add it to graph with dependency + HIP_CHECK(hipGraphAddEmptyNode(&emptyNode, graph, dependencies.data(), + dependencies.size())); + + REQUIRE(emptyNode != nullptr); + HIP_CHECK(hipFree(pOutBuff_d)); + HIP_CHECK(hipGraphDestroy(graph)); +} diff --git a/tests/catch/unit/graph/hipGraphAddMemcpyNode.cc b/tests/catch/unit/graph/hipGraphAddMemcpyNode.cc new file mode 100644 index 0000000000..5fcf1ccc40 --- /dev/null +++ b/tests/catch/unit/graph/hipGraphAddMemcpyNode.cc @@ -0,0 +1,128 @@ +/* +Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/** +Testcase Scenarios : + 1) Add multiple Memcpy nodes to graph and verify node execution is + working as expected. +*/ + +#include +#include + +/** + * Functional Test adds memcpy nodes of types H2D, D2D and D2H to graph + * and verifies execution sequence by launching graph. + */ +TEST_CASE("Unit_hipGraphAddMemcpyNode_Functional") { + constexpr int width{10}, height{10}, depth{10}; + hipArray *devArray1, *devArray2; + hipChannelFormatKind formatKind = hipChannelFormatKindSigned; + hipMemcpy3DParms myparams; + uint32_t size = width * height * depth * sizeof(int); + hipGraph_t graph; + hipGraphNode_t memcpyNode; + std::vector dependencies; + hipStream_t streamForGraph; + hipGraphExec_t graphExec; + + int *hData = reinterpret_cast(malloc(size)); + int *hOutputData = reinterpret_cast(malloc(size)); + + REQUIRE(hData != nullptr); + REQUIRE(hOutputData != nullptr); + memset(hData, 0, size); + memset(hOutputData, 0, size); + + HIP_CHECK(hipStreamCreate(&streamForGraph)); + + // Initialize host buffer + for (int i = 0; i < depth; i++) { + for (int j = 0; j < height; j++) { + for (int k = 0; k < width; k++) { + hData[i*width*height + j*width + k] = i*width*height + j*width + k; + } + } + } + + hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int)*8, + 0, 0, 0, formatKind); + HIP_CHECK(hipMalloc3DArray(&devArray1, &channelDesc, + make_hipExtent(width, height, depth), hipArrayDefault)); + HIP_CHECK(hipMalloc3DArray(&devArray2, &channelDesc, + make_hipExtent(width, height, depth), hipArrayDefault)); + HIP_CHECK(hipGraphCreate(&graph, 0)); + + // Host to Device + memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); + myparams.srcPos = make_hipPos(0, 0, 0); + myparams.dstPos = make_hipPos(0, 0, 0); + myparams.extent = make_hipExtent(width , height, depth); + myparams.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), + width, height); + myparams.dstArray = devArray1; + myparams.kind = hipMemcpyHostToDevice; + + + HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams)); + dependencies.push_back(memcpyNode); + + // Device to Device + memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); + myparams.srcPos = make_hipPos(0, 0, 0); + myparams.dstPos = make_hipPos(0, 0, 0); + myparams.srcArray = devArray1; + myparams.dstArray = devArray2; + myparams.extent = make_hipExtent(width, height, depth); + myparams.kind = hipMemcpyDeviceToDevice; + + HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), + dependencies.size(), &myparams)); + dependencies.clear(); + dependencies.push_back(memcpyNode); + + // Device to host + memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); + myparams.srcPos = make_hipPos(0, 0, 0); + myparams.dstPos = make_hipPos(0, 0, 0); + myparams.dstPtr = make_hipPitchedPtr(hOutputData, width * sizeof(int), + width, height); + myparams.srcArray = devArray2; + myparams.extent = make_hipExtent(width, height, depth); + myparams.kind = hipMemcpyDeviceToHost; + + HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), + dependencies.size(), &myparams)); + + // Instantiate and launch the graph + HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); + HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); + HIP_CHECK(hipStreamSynchronize(streamForGraph)); + + // Check result + HipTest::checkArray(hData, hOutputData, width, height, depth); + + HIP_CHECK(hipGraphExecDestroy(graphExec)); + HIP_CHECK(hipGraphDestroy(graph)); + HIP_CHECK(hipStreamDestroy(streamForGraph)); + hipFreeArray(devArray1); + hipFreeArray(devArray2); + free(hData); + free(hOutputData); +} diff --git a/tests/catch/unit/graph/hipSimpleGraphWithKernel.cc b/tests/catch/unit/graph/hipSimpleGraphWithKernel.cc new file mode 100644 index 0000000000..48cbb9a42c --- /dev/null +++ b/tests/catch/unit/graph/hipSimpleGraphWithKernel.cc @@ -0,0 +1,160 @@ +/* +Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +/** + Simple test to demonstrate usage of graph. + Compares implementation with and without using graphs. +*/ + +#include + +#define N 1024 * 1024 +#define NSTEP 1000 +#define NKERNEL 25 +#define CONSTANT 5.34 + +static __global__ void simpleKernel(float* out_d, float* in_d) { + int idx = blockIdx.x * blockDim.x + threadIdx.x; + if (idx < N) out_d[idx] = CONSTANT * in_d[idx]; +} + +static void hipTestWithGraph() { + int deviceId; + HIP_CHECK(hipGetDevice(&deviceId)); + hipDeviceProp_t props; + HIP_CHECK(hipGetDeviceProperties(&props, deviceId)); + + hipStream_t stream; + HIP_CHECK(hipStreamCreate(&stream)); + + float *in_h, *out_h; + in_h = new float[N]; + out_h = new float[N]; + for (int i = 0; i < N; i++) { + in_h[i] = i; + } + + float *in_d, *out_d; + HIP_CHECK(hipMalloc(&in_d, N * sizeof(float))); + HIP_CHECK(hipMalloc(&out_d, N * sizeof(float))); + HIP_CHECK(hipMemcpy(in_d, in_h, N * sizeof(float), hipMemcpyHostToDevice)); + + auto start = std::chrono::high_resolution_clock::now(); + // start CPU wallclock timer + hipGraph_t graph; + hipGraphExec_t instance; + + hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal); + for (int ikrnl = 0; ikrnl < NKERNEL; ikrnl++) { + simpleKernel<<>>(out_d, in_d); + } + hipStreamEndCapture(stream, &graph); + hipGraphInstantiate(&instance, graph, nullptr, nullptr, 0); + + auto start1 = std::chrono::high_resolution_clock::now(); + for (int istep = 0; istep < NSTEP; istep++) { + hipGraphLaunch(instance, stream); + hipStreamSynchronize(stream); + } + auto stop = std::chrono::high_resolution_clock::now(); + auto withInit = std::chrono::duration(stop - start); + auto withoutInit = std::chrono::duration(stop - start1); + + INFO("Time taken for graph with Init: " + << std::chrono::duration_cast(withInit).count() + << " milliseconds without Init:" + << std::chrono::duration_cast(withoutInit).count() + << " milliseconds "); + + HIP_CHECK(hipMemcpy(out_h, out_d, N * sizeof(float), hipMemcpyDeviceToHost)); + for (int i = 0; i < N; i++) { + if (static_cast(in_h[i] * CONSTANT) != out_h[i]) { + INFO("Mismatch at indx:" << i << " " << in_h[i] << " " << out_h[i]); + REQUIRE(false); + } + } + delete[] in_h; + delete[] out_h; + HIP_CHECK(hipFree(in_d)); + HIP_CHECK(hipFree(out_d)); +} + +static void hipTestWithoutGraph() { + int deviceId; + HIP_CHECK(hipGetDevice(&deviceId)); + hipDeviceProp_t props; + HIP_CHECK(hipGetDeviceProperties(&props, deviceId)); + INFO("Info: running on device " << deviceId << props.name); + + hipStream_t stream; + HIP_CHECK(hipStreamCreate(&stream)); + + float *in_h, *out_h; + in_h = new float[N]; + out_h = new float[N]; + for (int i = 0; i < N; i++) { + in_h[i] = i; + } + + float *in_d, *out_d; + HIP_CHECK(hipMalloc(&in_d, N * sizeof(float))); + HIP_CHECK(hipMalloc(&out_d, N * sizeof(float))); + HIP_CHECK(hipMemcpy(in_d, in_h, N * sizeof(float), hipMemcpyHostToDevice)); + + // start CPU wallclock timer + auto start = std::chrono::high_resolution_clock::now(); + for (int istep = 0; istep < NSTEP; istep++) { + for (int ikrnl = 0; ikrnl < NKERNEL; ikrnl++) { + simpleKernel<<>>(out_d, in_d); + } + HIP_CHECK(hipStreamSynchronize(stream)); + } + auto stop = std::chrono::high_resolution_clock::now(); + auto result = std::chrono::duration(stop - start); + INFO("Time taken for test without graph: " + << std::chrono::duration_cast(result).count() + << " millisecs "); + HIP_CHECK(hipMemcpy(out_h, out_d, N * sizeof(float), hipMemcpyDeviceToHost)); + for (int i = 0; i < N; i++) { + if (static_cast(in_h[i] * CONSTANT) != out_h[i]) { + INFO("Mismatch at indx:" << i << " " << in_h[i] << " " << out_h[i]); + REQUIRE(false); + } + } + delete[] in_h; + delete[] out_h; + HIP_CHECK(hipFree(in_d)); + HIP_CHECK(hipFree(out_d)); +} + +/** + * Simple test to demonstrate usage of graph. + */ +TEST_CASE("Unit_hipGraph_SimpleGraphWithKernel") { + // Sections run test with and without graph. + SECTION("Run Test Without Graph") { + hipTestWithoutGraph(); + } + + SECTION("Run Test With Graph") { + hipTestWithGraph(); + } +} diff --git a/tests/catch/unit/memory/CMakeLists.txt b/tests/catch/unit/memory/CMakeLists.txt index 4775e1c16b..b450921321 100644 --- a/tests/catch/unit/memory/CMakeLists.txt +++ b/tests/catch/unit/memory/CMakeLists.txt @@ -5,8 +5,6 @@ set(TEST_SRC malloc.cc hipMemcpy2DToArray.cc hipMemcpy2DToArrayAsync.cc - hipMemcpyPeer.cc - hipMemcpyPeerAsync.cc hipMemcpy3D.cc hipMemcpy3DAsync.cc hipMemcpyParam2D.cc @@ -17,37 +15,26 @@ set(TEST_SRC hipMemcpy2DFromArrayAsync.cc hipMemcpyAtoH.cc hipMemcpyHtoA.cc - hipMemcpyDtoD.cc - hipMemcpyDtoDAsync.cc - hipMemcpyAsync.cc - hipMemcpy.cc - hipMemcpyWithStream.cc hipMemcpyAllApiNegative.cc - hipMemcpyWithStreamMultiThread.cc hipMemcpy_MultiThread.cc - hipHostMalloc.cc hipHostRegister.cc hipMemPtrGetInfo.cc hipPointerGetAttributes.cc hipHostGetFlags.cc - hipMemoryAllocateCoherent.cc hipMallocManaged_MultiScenario.cc hipMemsetInvalidPtr.cc hipMemset.cc hipMemsetAsyncMultiThread.cc - hipMemsetAsyncAndKernel.cc hipMemset3D.cc hipMemset2D.cc - hipMemset2DAsyncMultiThreadAndKernel.cc hipHostMallocTests.cc - hipMallocConcurrency.cc hipMemset3DFunctional.cc hipMemset3DNegative.cc hipMemset3DRegressMultiThread.cc hipMallocManagedFlagsTst.cc hipMemPrefetchAsyncExtTsts.cc hipMemAdviseMmap.cc - hipMallocManaged.cc + hipMemCoherencyTst.cc ) else() set(TEST_SRC @@ -55,8 +42,6 @@ set(TEST_SRC malloc.cc hipMemcpy2DToArray.cc hipMemcpy2DToArrayAsync.cc - hipMemcpyPeer.cc - hipMemcpyPeerAsync.cc hipMemcpy3D.cc hipMemcpy3DAsync.cc hipMemcpyParam2D.cc @@ -67,39 +52,45 @@ set(TEST_SRC hipMemcpy2DFromArrayAsync.cc hipMemcpyAtoH.cc hipMemcpyHtoA.cc - hipMemcpyDtoD.cc - hipMemcpyDtoDAsync.cc - hipMemcpyAsync.cc - hipMemcpy.cc - hipMemcpyWithStream.cc hipMemcpyAllApiNegative.cc - hipMemcpyWithStreamMultiThread.cc hipMemcpy_MultiThread.cc - hipHostMalloc.cc hipHostRegister.cc hipHostGetFlags.cc - hipMemoryAllocateCoherent.cc hipMallocManaged_MultiScenario.cc hipMemsetInvalidPtr.cc hipMemset.cc hipMemsetAsyncMultiThread.cc - hipMemsetAsyncAndKernel.cc hipMemset3D.cc hipMemset2D.cc - hipMemset2DAsyncMultiThreadAndKernel.cc hipHostMallocTests.cc - hipMallocConcurrency.cc hipMemset3DFunctional.cc hipMemset3DNegative.cc hipMemset3DRegressMultiThread.cc hipMallocManagedFlagsTst.cc hipMemPrefetchAsyncExtTsts.cc hipMemAdviseMmap.cc - hipMallocManaged.cc ) endif() -# Create shared lib of all tests -add_library(MemoryTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests MemoryTest) +#skipped in windows -duplicate HipTest::vectorADD sym (compiler issue) +if(UNIX) + set(TEST_SRC ${TEST_SRC} + hipMemcpyPeer.cc + hipMemcpyPeerAsync.cc + hipMemcpyWithStream.cc + hipMemcpyWithStreamMultiThread.cc + hipMemsetAsyncAndKernel.cc + hipMemset2DAsyncMultiThreadAndKernel.cc + hipMallocManaged.cc + hipMallocConcurrency.cc + hipMemcpyDtoD.cc + hipMemcpyDtoDAsync.cc + hipMemoryAllocateCoherent.cc + hipHostMalloc.cc + hipMemcpy.cc + hipMemcpyAsync.cc) +endif() + +hip_add_exe_to_target(NAME MemoryTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/unit/memory/hipMemCoherencyTst.cc b/tests/catch/unit/memory/hipMemCoherencyTst.cc new file mode 100644 index 0000000000..f03c549d11 --- /dev/null +++ b/tests/catch/unit/memory/hipMemCoherencyTst.cc @@ -0,0 +1,233 @@ +/* + Copyright (c) 2021 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. + */ + +/* Test Case Description: + Scenario 1: The test validates if fine grain + behavior is observed or not with memory allocated using hipHostMalloc() + Scenario 2: The test validates if fine grain + behavior is observed or not with memory allocated using hipMallocManaged() + Scenario 3: The test validates if memory access is fine + with memory allocated using hipMallocManaged() and CoarseGrain Advise + Scenario 4: The test validates if memory access is fine + with memory allocated using hipMalloc() and CoarseGrain Advise + Scenario 5: The test validates if fine grain + behavior is observed or not with memory allocated using + hipExtMallocWithFlags()*/ + + +#include +#include + +__global__ void CoherentTst(int *ptr, int PeakClk) { + // Incrementing the value by 1 + int64_t GpuFrq = (PeakClk * 1000); + int64_t StrtTck = clock64(); + atomicAdd(ptr, 1); + // The following while loop checks the value in ptr for around 3-4 seconds + while ((clock64() - StrtTck) <= (3 * GpuFrq)) { + if (*ptr == 3) { + atomicAdd(ptr, 1); + return; + } + } +} + +__global__ void SquareKrnl(int *ptr) { + // ptr value squared here + *ptr = (*ptr) * (*ptr); +} + + + +// The variable below will work as signal to decide pass/fail +static bool YES_COHERENT = false; + +// The function tests the coherency of allocated memory +static void TstCoherency(int *Ptr, bool HmmMem) { + int *Dptr = nullptr, peak_clk; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + // storing value 1 in the memory created above + *Ptr = 1; + // Getting gpu frequency + HIP_CHECK(hipDeviceGetAttribute(&peak_clk, hipDeviceAttributeClockRate, 0)); + if (!HmmMem) { + HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&Dptr), Ptr, + 0)); + CoherentTst<<<1, 1, 0, strm>>>(Dptr, peak_clk); + } else { + CoherentTst<<<1, 1, 0, strm>>>(Ptr, peak_clk); + } + // looping until the value is 2 for 3 seconds + std::chrono::steady_clock::time_point start = + std::chrono::steady_clock::now(); + while (std::chrono::duration_cast( + std::chrono::steady_clock::now() - start).count() < 3) { + if (*Ptr == 2) { + *Ptr += 1; + break; + } + } + HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipStreamDestroy(strm)); + if (*Ptr == 4) { + YES_COHERENT = true; + } +} + +/* Test case description: The following test validates if fine grain + behavior is observed or not with memory allocated using hipHostMalloc()*/ +// The following tests are disabled for Nvidia as they are not consistently +// passing +#if HT_AMD +TEST_CASE("Unit_hipHostMalloc_CoherentTst") { + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = false; + YES_COHERENT = false; + // Allocating hipHostMalloc() memory with hipHostMallocCoherent flag + SECTION("hipHostMalloc with hipHostMallocCoherent flag") { + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocCoherent)); + } + SECTION("hipHostMalloc with Default flag") { + HIP_CHECK(hipHostMalloc(&Ptr, SIZE)); + } + SECTION("hipHostMalloc with hipHostMallocMapped flag") { + HIP_CHECK(hipHostMalloc(&Ptr, SIZE, hipHostMallocMapped)); + } + + TstCoherency(Ptr, HmmMem); + HIP_CHECK(hipHostFree(Ptr)); + REQUIRE(YES_COHERENT); +} +#endif + + +/* Test case description: The following test validates if fine grain + behavior is observed or not with memory allocated using hipMallocManaged()*/ +// The following tests are disabled for Nvidia as they are not consistently +// passing +#if HT_AMD +TEST_CASE("Unit_hipMallocManaged_CoherentTst") { + int *Ptr = nullptr, SIZE = sizeof(int); + bool HmmMem = true; + YES_COHERENT = false; + // Allocating hipMallocManaged() memory + SECTION("hipMallocManaged with hipMemAttachGlobal flag") { + HIP_CHECK(hipMallocManaged(&Ptr, SIZE, hipMemAttachGlobal)); + } + SECTION("hipMallocManaged with hipMemAttachHost flag") { + HIP_CHECK(hipMallocManaged(&Ptr, SIZE, hipMemAttachHost)); + } + TstCoherency(Ptr, HmmMem); + HIP_CHECK(hipFree(Ptr)); + REQUIRE(YES_COHERENT); +} +#endif + +/* Test case description: The following test validates if memory access is fine + with memory allocated using hipMallocManaged() and CoarseGrain Advise*/ +TEST_CASE("Unit_hipMallocManaged_CoherentTstWthAdvise") { + int *Ptr = nullptr, SIZE = sizeof(int); + YES_COHERENT = false; + // Allocating hipMallocManaged() memory + SECTION("hipMallocManaged with hipMemAttachGlobal flag") { + HIP_CHECK(hipMallocManaged(&Ptr, SIZE, hipMemAttachGlobal)); + } + SECTION("hipMallocManaged with hipMemAttachHost flag") { + HIP_CHECK(hipMallocManaged(&Ptr, SIZE, hipMemAttachHost)); + } +#if HT_AMD + HIP_CHECK(hipMemAdvise(Ptr, SIZE, hipMemAdviseSetCoarseGrain, 0)); +#endif + // Initializing Ptr memory with 9 + *Ptr = 9; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + SquareKrnl<<<1, 1, 0, strm>>>(Ptr); + HIP_CHECK(hipStreamSynchronize(strm)); + if (*Ptr == 81) { + YES_COHERENT = true; + } + HIP_CHECK(hipFree(Ptr)); + HIP_CHECK(hipStreamDestroy(strm)); + REQUIRE(YES_COHERENT); +} + + +/* Test case description: The following test validates if memory allocated + using hipMalloc() are of type Coarse Grain*/ +// The following tests are disabled for Nvidia as they are not applicable +#if HT_AMD +TEST_CASE("Unit_hipMalloc_CoherentTst") { + int *Ptr = nullptr, SIZE = sizeof(int); + uint32_t svm_attrib = 0; + bool IfTstPassed = false; + // Allocating hipMalloc() memory + HIP_CHECK(hipMalloc(&Ptr, SIZE)); + HIP_CHECK(hipMemRangeGetAttribute(&svm_attrib, sizeof(svm_attrib), + hipMemRangeAttributeCoherencyMode, Ptr, SIZE)); + if (svm_attrib == hipMemRangeCoherencyModeCoarseGrain) { + IfTstPassed = true; + } + HIP_CHECK(hipFree(Ptr)); + REQUIRE(IfTstPassed); +} +#endif +/* Test case description: The following test validates if fine grain + behavior is observed or not with memory allocated using + hipExtMallocWithFlags()*/ +#if HT_AMD +TEST_CASE("Unit_hipExtMallocWithFlags_CoherentTst") { + int *Ptr = nullptr, SIZE = sizeof(int), InitVal = 9; + bool FineGrain = true; + YES_COHERENT = false; + // Allocating hipExtMallocWithFlags() memory with flags + SECTION("hipExtMallocWithFlags with hipDeviceMallocFinegrained flag") { + HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&Ptr), SIZE*2, + hipDeviceMallocFinegrained)); + } + SECTION("hipExtMallocWithFlags with hipDeviceMallocSignalMemory flag") { + // for hipMallocSignalMemory flag the size of memory must be 8 + HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&Ptr), SIZE*2, + hipMallocSignalMemory)); + } + SECTION("hipExtMallocWithFlags with hipDeviceMallocDefault flag") { + /* hipExtMallocWithFlags() with flag + hipDeviceMallocDefault allocates CoarseGrain memory */ + FineGrain = false; + HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&Ptr), SIZE*2, + hipDeviceMallocDefault)); + } + if (FineGrain) { + TstCoherency(Ptr, FineGrain); + } else { + *Ptr = InitVal; + hipStream_t strm; + HIP_CHECK(hipStreamCreate(&strm)); + SquareKrnl<<<1, 1, 0, strm>>>(Ptr); + HIP_CHECK(hipStreamSynchronize(strm)); + if (*Ptr == (InitVal * InitVal)) { + YES_COHERENT = true; + } + } + HIP_CHECK(hipFree(Ptr)); + REQUIRE(YES_COHERENT); +} +#endif + diff --git a/tests/catch/unit/memory/hipMemcpy.cc b/tests/catch/unit/memory/hipMemcpy.cc index 8063857812..f6343e52fc 100644 --- a/tests/catch/unit/memory/hipMemcpy.cc +++ b/tests/catch/unit/memory/hipMemcpy.cc @@ -572,7 +572,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy_PinnedRegMemWithKernelLaunch", HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM); unsigned int seed = time(0); - HIP_CHECK(hipSetDevice(rand_r(&seed) % (numDevices-1)+1)); + HIP_CHECK(hipSetDevice(HipTest::RAND_R(&seed) % (numDevices-1)+1)); int device; hipGetDevice(&device); diff --git a/tests/catch/unit/memory/hipMemcpyAsync.cc b/tests/catch/unit/memory/hipMemcpyAsync.cc index a7e327354d..be5eb26b73 100644 --- a/tests/catch/unit/memory/hipMemcpyAsync.cc +++ b/tests/catch/unit/memory/hipMemcpyAsync.cc @@ -350,7 +350,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_PinnedRegMemWithKernelLaunch", HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM); unsigned int seed = time(0); - HIP_CHECK(hipSetDevice(rand_r(&seed) % (numDevices-1)+1)); + HIP_CHECK(hipSetDevice(HipTest::RAND_R(&seed) % (numDevices-1)+1)); int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/tests/catch/unit/memory/hipMemset3DFunctional.cc b/tests/catch/unit/memory/hipMemset3DFunctional.cc index 421e066ab4..b47798487b 100644 --- a/tests/catch/unit/memory/hipMemset3DFunctional.cc +++ b/tests/catch/unit/memory/hipMemset3DFunctional.cc @@ -236,7 +236,7 @@ static void seekAndSet3DArraySlice(bool bAsync) { // select random slice for memset unsigned int seed = time(nullptr); - int slice_index = rand_r(&seed) % ZSIZE_S; + int slice_index = HipTest::RAND_R(&seed) % ZSIZE_S; INFO("memset3d for sliceindex " << slice_index); diff --git a/tests/catch/unit/memory/hipPointerGetAttributes.cc b/tests/catch/unit/memory/hipPointerGetAttributes.cc index b14ea9858e..4db534c223 100644 --- a/tests/catch/unit/memory/hipPointerGetAttributes.cc +++ b/tests/catch/unit/memory/hipPointerGetAttributes.cc @@ -148,7 +148,7 @@ void clusterAllocs(int numAllocs, size_t minSize, size_t maxSize) { } for (int i = 0; i < numAllocs; i++) { unsigned rand_seed = time(NULL); - bool isDevice = rand_r(&rand_seed) & 0x1; + bool isDevice = HipTest::RAND_R(&rand_seed) & 0x1; reference[i]._sizeBytes = zrand(maxSize - minSize) + minSize; reference[i]._attrib.device = zrand(numDevices); diff --git a/tests/catch/unit/occupancy/CMakeLists.txt b/tests/catch/unit/occupancy/CMakeLists.txt index a349698932..9f1f1873cc 100644 --- a/tests/catch/unit/occupancy/CMakeLists.txt +++ b/tests/catch/unit/occupancy/CMakeLists.txt @@ -4,8 +4,6 @@ set(TEST_SRC hipOccupancyMaxPotentialBlockSize.cc ) -# Create shared lib of all tests -add_library(OccupancyTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests OccupancyTest) +hip_add_exe_to_target(NAME OccupancyTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/unit/printf/CMakeLists.txt b/tests/catch/unit/printf/CMakeLists.txt index 251a9bbbf2..b911796d66 100644 --- a/tests/catch/unit/printf/CMakeLists.txt +++ b/tests/catch/unit/printf/CMakeLists.txt @@ -4,13 +4,15 @@ set(TEST_SRC printfSpecifiers.cc ) -# Create shared lib of all tests -add_library(printfTests SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) -if(HIP_PLATFORM MATCHES "amd") - set_property(TARGET printfTests PROPERTY CXX_STANDARD 17) -else() - target_compile_options(printfTests PUBLIC -std=c++17) -endif() -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests printfTests) +if(HIP_PLATFORM MATCHES "amd") + hip_add_exe_to_target(NAME printfTests + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests + PROPERTY CXX_STANDARD 17) +elseif (HIP_PLATFORM MATCHES "nvidia") + hip_add_exe_to_target(NAME printfTests + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests + COMPILE_OPTIONS -std=c++17) +endif() diff --git a/tests/catch/unit/printf/printfFlags.cc b/tests/catch/unit/printf/printfFlags.cc index fb64cb7791..8a9aa75a3f 100644 --- a/tests/catch/unit/printf/printfFlags.cc +++ b/tests/catch/unit/printf/printfFlags.cc @@ -51,7 +51,7 @@ xyzzy 00000042 )here"); - hip::SpawnProc proc("unit/printfExe/printfFlags", true); + hip::SpawnProc proc("printfExe/printfFlags", true); REQUIRE(proc.run() == 0); REQUIRE(proc.getOutput() == reference); } diff --git a/tests/catch/unit/printf/printfSpecifiers.cc b/tests/catch/unit/printf/printfSpecifiers.cc index fa39a751f8..37e8584943 100644 --- a/tests/catch/unit/printf/printfSpecifiers.cc +++ b/tests/catch/unit/printf/printfSpecifiers.cc @@ -89,7 +89,7 @@ x )here"); #endif - hip::SpawnProc proc("unit/printfExe/printfSepcifiers", true); + hip::SpawnProc proc("printfExe/printfSepcifiers", true); REQUIRE(0 == proc.run()); REQUIRE(proc.getOutput() == reference); } diff --git a/tests/catch/unit/printfExe/printfFlags.cc b/tests/catch/unit/printfExe/printfFlags.cc index 515abdfba6..a96c099340 100644 --- a/tests/catch/unit/printfExe/printfFlags.cc +++ b/tests/catch/unit/printfExe/printfFlags.cc @@ -38,5 +38,5 @@ __global__ void test_kernel() { int main() { test_kernel<<<1, 1>>>(); - hipDeviceSynchronize(); + static_cast(hipDeviceSynchronize()); } \ No newline at end of file diff --git a/tests/catch/unit/printfExe/printfSepcifiers.cc b/tests/catch/unit/printfExe/printfSepcifiers.cc index bfa33cbb0e..364376fb0a 100644 --- a/tests/catch/unit/printfExe/printfSepcifiers.cc +++ b/tests/catch/unit/printfExe/printfSepcifiers.cc @@ -60,6 +60,6 @@ __global__ void test_kernel() { int main() { test_kernel<<<1, 1>>>(); - hipDeviceSynchronize(); + static_cast(hipDeviceSynchronize()); return 0; } diff --git a/tests/catch/unit/rtc/CMakeLists.txt b/tests/catch/unit/rtc/CMakeLists.txt index d52d3f9288..3b9a3dbe41 100644 --- a/tests/catch/unit/rtc/CMakeLists.txt +++ b/tests/catch/unit/rtc/CMakeLists.txt @@ -3,8 +3,13 @@ set(TEST_SRC saxpy.cc ) -# Create shared lib of all tests -add_library(RTC SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests RTC) +if(HIP_PLATFORM MATCHES "nvidia") + hip_add_exe_to_target(NAME RTC + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests + LINKER_LIBS nvrtc) +elseif(HIP_PLATFORM MATCHES "amd") + hip_add_exe_to_target(NAME RTC + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) +endif() diff --git a/tests/catch/unit/rtc/customOptions.cc b/tests/catch/unit/rtc/customOptions.cc new file mode 100644 index 0000000000..040b567100 --- /dev/null +++ b/tests/catch/unit/rtc/customOptions.cc @@ -0,0 +1,148 @@ +#include + +#include +#include + + +#include +#include +#include +#include +#include +#include +#include + +static constexpr auto program{ + R"( +extern "C" +__global__ void kernel(int* a) { + // C++17 feature + if (int j = 10; *a % 2 == 0) + *a = 10 + j; + else + *a = 20 + j; +} +)"}; + +TEST_CASE("Unit_hiprtc_cpp17") { + using namespace std; + hiprtcProgram prog; + hiprtcCreateProgram(&prog, // prog + program, // buffer + "program.cu", // name + 0, nullptr, nullptr); + hipDeviceProp_t props; + int device = 0; + HIP_CHECK(hipGetDeviceProperties(&props, device)); +#ifdef __HIP_PLATFORM_AMD__ + std::string sarg = std::string("--gpu-architecture=") + props.gcnArchName; +#else + std::string sarg = std::string("--fmad=false"); +#endif + const char* options[] = {sarg.c_str(), "-std=c++17", "-Werror"}; + hiprtcResult compileResult{hiprtcCompileProgram(prog, 3, options)}; + size_t logSize; + HIPRTC_CHECK(hiprtcGetProgramLogSize(prog, &logSize)); + if (logSize) { + string log(logSize, '\0'); + HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); + std::cout << log << '\n'; + } + hiprtcDestroyProgram(&prog); + REQUIRE(compileResult == HIPRTC_SUCCESS); +} + +static constexpr const char template_kernel[]{R"( +template struct complex { + public: + typedef T value_type; + inline __host__ __device__ complex(const T& re, const T& im); + __host__ __device__ inline complex& operator*=(const complex z); + __host__ __device__ inline T real() const volatile { return m_data[0]; } + __host__ __device__ inline T imag() const volatile { return m_data[1]; } + __host__ __device__ inline T real() const { return m_data[0]; } + __host__ __device__ inline T imag() const { return m_data[1]; } + __host__ __device__ inline void real(T re) volatile { m_data[0] = re; } + __host__ __device__ inline void imag(T im) volatile { m_data[1] = im; } + __host__ __device__ inline void real(T re) { m_data[0] = re; } + __host__ __device__ inline void imag(T im) { m_data[1] = im; } + + private: + T m_data[2]; +}; +template inline __host__ __device__ complex::complex(const T& re, const T& im) { + real(re); + imag(im); +} +template +__host__ __device__ inline complex& complex::operator*=(const complex z) { + *this = *this * z; + return *this; +} +template +__host__ __device__ inline complex operator*(const complex& lhs, const complex& rhs) { + return complex(lhs.real() * rhs.real() - lhs.imag() * rhs.imag(), + lhs.real() * rhs.imag() + lhs.imag() * rhs.real()); +} + +template __global__ void my_sqrt(T* input, int N) { + unsigned int x = blockIdx.x * blockDim.x + threadIdx.x; + if (x < N) { + input[x] *= input[x]; + } +} +)"}; + +TEST_CASE("Unit_hiprtc_namehandling") { + using namespace std; + hiprtcProgram prog; + hiprtcCreateProgram(&prog, // prog + template_kernel, // buffer + "template_kernel.cu", // name + 0, nullptr, nullptr); + hipDeviceProp_t props; + int device = 0; + HIP_CHECK(hipGetDeviceProperties(&props, device)); +#ifdef __HIP_PLATFORM_AMD__ + std::string sarg = std::string("--gpu-architecture=") + props.gcnArchName; +#else + std::string sarg = std::string("--fmad=false"); +#endif + const char* options[] = {sarg.c_str()}; + + std::vector name_expressions; + name_expressions.push_back("my_sqrt"); + name_expressions.push_back("my_sqrt"); + name_expressions.push_back("my_sqrt>"); + name_expressions.push_back("my_sqrt >"); + for (size_t i = 0; i < name_expressions.size(); i++) { + REQUIRE(HIPRTC_SUCCESS == hiprtcAddNameExpression(prog, name_expressions[i].c_str())); + } + + hiprtcResult compileResult{hiprtcCompileProgram(prog, 1, options)}; + + size_t logSize; + HIPRTC_CHECK(hiprtcGetProgramLogSize(prog, &logSize)); + if (logSize) { + string log(logSize, '\0'); + HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); + std::cout << log << '\n'; + } + + std::map mangled_names; + + for (size_t i = 0; i < name_expressions.size(); i++) { + const char* mangled_instantiation_cstr; + REQUIRE(HIPRTC_SUCCESS == hiprtcGetLoweredName(prog, name_expressions[i].c_str(), &mangled_instantiation_cstr)); + + std::string mangled_name_str = mangled_instantiation_cstr; + mangled_names[name_expressions[i]] = mangled_name_str; + REQUIRE(mangled_name_str.size() > 0); + } + + // Match the last two names + REQUIRE(mangled_names["my_sqrt>"] == mangled_names["my_sqrt >"]); + + hiprtcDestroyProgram(&prog); + REQUIRE(compileResult == HIPRTC_SUCCESS); +} diff --git a/tests/catch/unit/stream/CMakeLists.txt b/tests/catch/unit/stream/CMakeLists.txt index 31157f7da6..fc528f2b72 100644 --- a/tests/catch/unit/stream/CMakeLists.txt +++ b/tests/catch/unit/stream/CMakeLists.txt @@ -4,14 +4,20 @@ set(TEST_SRC hipStreamGetFlags.cc hipStreamGetPriority.cc hipMultiStream.cc - hipStreamACb_MultiThread.cc hipStreamAddCallback.cc hipStreamCreateWithFlags.cc hipStreamCreateWithPriority.cc - hipStreamWithCUMask.cc hipStreamGetCUMask.cc hipAPIStreamDisable.cc ) + +#skipped in windows - duplicate HipTest::vector_square sym (compiler issue) +if(UNIX) + set(TEST_SRC ${TEST_SRC} + hipStreamWithCUMask.cc + hipStreamACb_MultiThread.cc) +endif() + else() set(TEST_SRC hipStreamCreate.cc @@ -26,8 +32,6 @@ set(TEST_SRC ) endif() -# Create shared lib of all tests -add_library(StreamTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests StreamTest) \ No newline at end of file +hip_add_exe_to_target(NAME StreamTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/catch/unit/stream/hipStreamAddCallback.cc b/tests/catch/unit/stream/hipStreamAddCallback.cc index bc16eda3bd..b03aede98b 100644 --- a/tests/catch/unit/stream/hipStreamAddCallback.cc +++ b/tests/catch/unit/stream/hipStreamAddCallback.cc @@ -26,7 +26,8 @@ Testcase Scenarios : #include #include -#include +#include +#include #define UNUSED(expr) do { (void)(expr); } while (0) @@ -89,7 +90,7 @@ bool testStreamCallbackFunctionality(bool isDefault) { HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, 0)); HIP_CHECK(hipStreamAddCallback(0, Callback, nullptr, 0)); - while (!gcbDone) usleep(100000); // Sleep for 100 ms + while (!gcbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms } else { hipStream_t mystream; HIP_CHECK(hipStreamCreateWithFlags(&mystream, hipStreamNonBlocking)); @@ -105,7 +106,7 @@ bool testStreamCallbackFunctionality(bool isDefault) { HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, mystream)); HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0)); - while (!gcbDone) usleep(100000); // Sleep for 100 ms + while (!gcbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms HIP_CHECK(hipStreamDestroy(mystream)); } HIP_CHECK(hipFree(reinterpret_cast(C_d))); @@ -192,7 +193,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst") { HIP_CHECK(hipStreamAddCallback(mystream, Callback_ChkUsrdataPtr, gusrptr, 0)); while (!gcbDone) { - usleep(100000); // Sleep for 100 ms + std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms } REQUIRE_FALSE(!gPassed); } @@ -204,7 +205,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst") { HIP_CHECK(hipStreamAddCallback(mystream, Callback_ChkStreamValue, nullptr, 0)); while (!gcbDone) { - usleep(100000); // Sleep for 100 ms + std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms } REQUIRE_FALSE(!gPassed); } diff --git a/tests/catch/unit/stream/hipStreamWithCUMask.cc b/tests/catch/unit/stream/hipStreamWithCUMask.cc index 0dd855702d..b65cdc4ca1 100644 --- a/tests/catch/unit/stream/hipStreamWithCUMask.cc +++ b/tests/catch/unit/stream/hipStreamWithCUMask.cc @@ -36,7 +36,8 @@ are ignored and hipExtStreamCreateWithCUMask must return hipSuccess. #include #include -#include +#include +#include #include #include @@ -159,7 +160,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc") { HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, mystream)); HIP_CHECK(hipStreamAddCallback(mystream, Callback, nullptr, 0)); - while (!cbDone) usleep(100000); // Sleep for 100 ms + while (!cbDone) std::this_thread::sleep_for(std::chrono::microseconds(100000)); // Sleep for 100 ms HIP_CHECK(hipStreamDestroy(mystream)); HIP_CHECK(hipFree(reinterpret_cast(C_d))); HIP_CHECK(hipFree(reinterpret_cast(A_d))); diff --git a/tests/catch/unit/texture/CMakeLists.txt b/tests/catch/unit/texture/CMakeLists.txt index f91ae84fd3..2472abf163 100644 --- a/tests/catch/unit/texture/CMakeLists.txt +++ b/tests/catch/unit/texture/CMakeLists.txt @@ -26,8 +26,6 @@ set(TEST_SRC hipCreateTextureObject_Array.cc ) -# Create shared lib of all tests -add_library(TextureTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC}) - -# Add dependency on build_tests to build it on this custom target -add_dependencies(build_tests TextureTest) +hip_add_exe_to_target(NAME TextureTest + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) diff --git a/tests/hipify-clang/unit_tests/libraries/cuSPARSE/cuSPARSE_12.cu b/tests/hipify-clang/unit_tests/libraries/cuSPARSE/cuSPARSE_12.cu deleted file mode 100644 index e6a2178053..0000000000 --- a/tests/hipify-clang/unit_tests/libraries/cuSPARSE/cuSPARSE_12.cu +++ /dev/null @@ -1,410 +0,0 @@ -// RUN: %run_test hipify "%s" "%t" %hipify_args %clang_args -// CHECK: #include -// CHECK: #include -// CHECK: #include -#include -#include -#include -#include -#include -#include - -#define Min(x,y) ((x)<(y)?(x):(y)) -#define Max(x,y) ((x)>(y)?(x):(y)) -#define Abs(x) ((x)>(0)?(x):-(x)) -// CHECK: static void CudaCheckCore(hipError_t code, const char *file, int line) { -static void CudaCheckCore(cudaError_t code, const char *file, int line) { - // CHECK: if (code != hipSuccess) { - if (code != cudaSuccess) { - // CHECK: fprintf(stderr,"Cuda Error %d : %s %s %d\n", code, hipGetErrorString(code), file, line); - fprintf(stderr,"Cuda Error %d : %s %s %d\n", code, cudaGetErrorString(code), file, line); - exit(code); - } -} - -#define CudaCheck( test ) { CudaCheckCore((test), __FILE__, __LINE__); } -// CHECK: #define CudaCheckAfterCall() { CudaCheckCore((hipGetLastError()), __FILE__, __LINE__); } -#define CudaCheckAfterCall() { CudaCheckCore((cudaGetLastError()), __FILE__, __LINE__); } - -// CHECK: static const char * GetErrorString(hipsparseStatus_t error) { -static const char * GetErrorString(cusparseStatus_t error) { - switch (error) { - // CHECK: case HIPSPARSE_STATUS_SUCCESS: - case CUSPARSE_STATUS_SUCCESS: - return "The operation completed successfully."; - // CHECK: case HIPSPARSE_STATUS_NOT_INITIALIZED: - case CUSPARSE_STATUS_NOT_INITIALIZED: - return "The cuSPARSE library was not initialized. This is usually caused by the lack of a prior call, an error in the CUDA Runtime API called by the cuSPARSE routine, or an error in the hardware setup.\n" \ - "To correct: call cusparseCreate() prior to the function call; and check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed."; - // CHECK: case HIPSPARSE_STATUS_ALLOC_FAILED: - case CUSPARSE_STATUS_ALLOC_FAILED: - return "Resource allocation failed inside the cuSPARSE library. This is usually caused by a cudaMalloc() failure.\n"\ - "To correct: prior to the function call, deallocate previously allocated memory as much as possible."; - // CHECK: case HIPSPARSE_STATUS_INVALID_VALUE: - case CUSPARSE_STATUS_INVALID_VALUE: - return "An unsupported value or parameter was passed to the function (a negative vector size, for example).\n"\ - "To correct: ensure that all the parameters being passed have valid values."; - // CHECK: case HIPSPARSE_STATUS_ARCH_MISMATCH: - case CUSPARSE_STATUS_ARCH_MISMATCH: - return "The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations or double precision.\n"\ - "To correct: compile and run the application on a device with appropriate compute capability, which is 1.1 for 32-bit atomic operations and 1.3 for double precision."; - // CHECK: case HIPSPARSE_STATUS_MAPPING_ERROR: - case CUSPARSE_STATUS_MAPPING_ERROR: - return "An access to GPU memory space failed, which is usually caused by a failure to bind a texture.\n"\ - "To correct: prior to the function call, unbind any previously bound textures."; - // CHECK: case HIPSPARSE_STATUS_EXECUTION_FAILED: - case CUSPARSE_STATUS_EXECUTION_FAILED: - return "The GPU program failed to execute. This is often caused by a launch failure of the kernel on the GPU, which can be caused by multiple reasons.\n"\ - "To correct: check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed."; - // CHECK: case HIPSPARSE_STATUS_INTERNAL_ERROR: - case CUSPARSE_STATUS_INTERNAL_ERROR: - return "An internal cuSPARSE operation failed. This error is usually caused by a cudaMemcpyAsync() failure.\n"\ - "To correct: check that the hardware, an appropriate version of the driver, and the cuSPARSE library are correctly installed. Also, check that the memory passed as a parameter to the routine is not being deallocated prior to the routines completion."; - // CHECK: case HIPSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED: - // CHECK: "To correct: check that the fields in hipsparseMatDescr_t descrA were set correctly."; - case CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED: - return "The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.\n"\ - "To correct: check that the fields in cusparseMatDescr_t descrA were set correctly."; - } - return ""; -} - -// CHECK: static void CudaSparseCheckCore(hipsparseStatus_t code, const char *file, int line) { -static void CudaSparseCheckCore(cusparseStatus_t code, const char *file, int line) { - // CHECK: if (code != HIPSPARSE_STATUS_SUCCESS) { - if (code != CUSPARSE_STATUS_SUCCESS) { - fprintf(stderr,"Cuda Error %d : %s %s %d\n", code, GetErrorString(code), file, line); - exit(code); - } -} - -#define CudaSparseCheck( test ) { CudaSparseCheckCore((test), __FILE__, __LINE__); } - -// Alloc and copy -template -ObjectType* allocAndCopy(const ObjectType src[], const int size) { - ObjectType* dest = NULL; - // CHECK: CudaCheck( hipMalloc(&dest,size*sizeof(ObjectType)) ); - CudaCheck( cudaMalloc(&dest,size*sizeof(ObjectType)) ); - // CHECK: CudaCheck( hipMemcpy(dest, src, size*sizeof(ObjectType), hipMemcpyHostToDevice ) ); - CudaCheck( cudaMemcpy(dest, src, size*sizeof(ObjectType), cudaMemcpyHostToDevice ) ); - return dest; -} - -template -ObjectType* alloc(const int size) { - ObjectType* dest = NULL; - // CHECK: CudaCheck( hipMalloc(&dest,size*sizeof(ObjectType)) ); - CudaCheck( cudaMalloc(&dest,size*sizeof(ObjectType)) ); - return dest; -} - -template -ObjectType* allocAndCopyPart(const ObjectType src[], const int size, const int allocSize) { - ObjectType* dest = NULL; - assert(size <= allocSize); - // CHECK: CudaCheck( hipMalloc(&dest,allocSize*sizeof(ObjectType)) ); - // CHECK: CudaCheck( hipMemcpy(dest, src, size*sizeof(ObjectType), hipMemcpyHostToDevice ) ); - // CHECK: CudaCheck( hipMemset(&dest[size],0,(allocSize-size)*sizeof(ObjectType)) ); - CudaCheck( cudaMalloc(&dest,allocSize*sizeof(ObjectType)) ); - CudaCheck( cudaMemcpy(dest, src, size*sizeof(ObjectType), cudaMemcpyHostToDevice ) ); - CudaCheck( cudaMemset(&dest[size],0,(allocSize-size)*sizeof(ObjectType)) ); - return dest; -} - -// COO part -#include - -struct Ijv { - int i, j; - double v; -}; - -bool IjvComp(const Ijv& v1, const Ijv& v2) { - return v1.i < v2.i || (v1.i == v2.i && v1.j < v2.j); -} - -struct COOArrays { - int m; - int nnz; - double *val;/*values(NNZ)*/ - int *rowind;/*i(NNZ)*/ - int *colind;/*j(NNZ)*/ - - COOArrays() { - val = NULL; - rowind = NULL; - colind = NULL; - } - - ~COOArrays() { - delete[] val; - delete[] rowind; - delete[] colind; - } - - void sortToRowMajor() { - Ijv* ijvs = new Ijv[nnz]; - for(int idxCopy = 0 ; idxCopy < nnz ; ++idxCopy){ - ijvs[idxCopy].i = rowind[idxCopy]; - ijvs[idxCopy].j = colind[idxCopy]; - ijvs[idxCopy].v = val[idxCopy]; - } - std::sort(ijvs, ijvs+nnz, IjvComp); - for(int idxCopy = 0 ; idxCopy < nnz ; ++idxCopy){ - rowind[idxCopy] = ijvs[idxCopy].i; - colind[idxCopy] = ijvs[idxCopy].j; - val[idxCopy] = ijvs[idxCopy].v; - } - delete[] ijvs; - } -}; - -void compute_COO(COOArrays& coo, double *x , double *y ) { - for(int idxVal = 0 ; idxVal < coo.nnz ; ++idxVal){ - y[coo.rowind[idxVal]] += x[coo.colind[idxVal]] * coo.val[idxVal]; - } -} - -// COO part -struct CRSArrays { - int m; //< the dim of the matrix - int nnz;//< the number of nnz (== ia[m]) - double *cu_csrValA; //< the values (of size NNZ) - int *cu_csrRowPtrA;//< the usual rowptr (of size m+1) - int *cu_csrColIndA;//< the colidx of each NNZ (of size nnz) - // CHECK: hipStream_t streamId; - // CHECK: hipsparseHandle_t cusparseHandle; - cudaStream_t streamId; - cusparseHandle_t cusparseHandle; - - CRSArrays() { - cu_csrValA = NULL; - cu_csrRowPtrA = NULL; - cu_csrColIndA = NULL; - // Create sparse handle (needed to call sparse functions - streamId = 0; - // CHECK-NOT: hipsparseHandle = 0; - cusparseHandle = 0; - // CHECK: CudaSparseCheck(hipsparseCreate(&cusparseHandle)); - // CHECK: CudaSparseCheck(hipsparseSetStream(cusparseHandle, streamId)); - CudaSparseCheck(cusparseCreate(&cusparseHandle)); - CudaSparseCheck(cusparseSetStream(cusparseHandle, streamId)); - } - - ~CRSArrays() { - // CHECK: CudaCheck(hipFree(cu_csrValA)); - // CHECK: CudaCheck(hipFree(cu_csrRowPtrA)); - // CHECK: CudaCheck(hipFree(cu_csrColIndA)); - CudaCheck(cudaFree(cu_csrValA)); - CudaCheck(cudaFree(cu_csrRowPtrA)); - CudaCheck(cudaFree(cu_csrColIndA)); - // Destroy sparse handle - // CHECK: CudaSparseCheck(hipsparseDestroy(cusparseHandle)); - CudaSparseCheck(cusparseDestroy(cusparseHandle)); - } -}; - -void COO_to_CRS(COOArrays& coo, CRSArrays* crs) { - // We need COO to be sorted by row (and column) - coo.sortToRowMajor(); - crs->m = coo.m; - crs->nnz = coo.nnz; - // Convert COO to CSR (it is just for the rows idx) - crs->cu_csrRowPtrA = alloc(coo.m+1); - { - int* cu_cooRowIndA = allocAndCopy(coo.rowind, coo.nnz); - // CHECK: CudaSparseCheck(hipsparseXcoo2csr(crs->cusparseHandle, cu_cooRowIndA, - // CHECK: coo.nnz, coo.m, crs->cu_csrRowPtrA, HIPSPARSE_INDEX_BASE_ZERO)); - CudaSparseCheck(cusparseXcoo2csr(crs->cusparseHandle, cu_cooRowIndA, - coo.nnz, coo.m, crs->cu_csrRowPtrA, CUSPARSE_INDEX_BASE_ZERO)); - // CHECK: CudaCheck(hipFree(cu_cooRowIndA)); - CudaCheck(cudaFree(cu_cooRowIndA)); - } - // Copy cols idx and values that are unchanged - crs->cu_csrValA = allocAndCopy(coo.val, coo.nnz); - crs->cu_csrColIndA = allocAndCopy(coo.colind, coo.nnz); -} - -double compute_CRS( CRSArrays& crs, double *x , double *y) { - // For blas 2 gemv y = alpha.x.A + Beta.y - const double alpha = 1.0; - const double beta = 0.0; - // Copy input - double* cu_x = allocAndCopy(x, crs.m); - double* cu_y = allocAndCopy(y, crs.m); - // Init matrix properties - // CHECK: hipsparseMatDescr_t descr = 0; - cusparseMatDescr_t descr = 0; - // CHECK: CudaSparseCheck(hipsparseCreateMatDescr(&descr)); - CudaSparseCheck(cusparseCreateMatDescr(&descr)); - // CHECK: hipsparseSetMatType(descr,HIPSPARSE_MATRIX_TYPE_GENERAL); - cusparseSetMatType(descr,CUSPARSE_MATRIX_TYPE_GENERAL); - // CHECK: hipsparseSetMatIndexBase(descr,HIPSPARSE_INDEX_BASE_ZERO); - cusparseSetMatIndexBase(descr,CUSPARSE_INDEX_BASE_ZERO); - // Compute gemv - float gemvComputeTume = 0; - { - // CHECK: hipEvent_t startTime, stopTime; - // CHECK: hipEventCreate(&startTime); - // CHECK: hipEventCreate(&stopTime); - // CHECK: hipEventRecord(startTime, crs.streamId); - cudaEvent_t startTime, stopTime; - cudaEventCreate(&startTime); - cudaEventCreate(&stopTime); - cudaEventRecord(startTime, crs.streamId); - // CHECK: CudaSparseCheck(hipsparseDcsrmv(crs.cusparseHandle, HIPSPARSE_OPERATION_NON_TRANSPOSE, - CudaSparseCheck(cusparseDcsrmv(crs.cusparseHandle, CUSPARSE_OPERATION_NON_TRANSPOSE, - crs.m, crs.m, crs.nnz, &alpha, - descr, crs.cu_csrValA, crs.cu_csrRowPtrA, - crs.cu_csrColIndA, cu_x, &beta, cu_y)); - // CHECK: hipEventRecord(stopTime, crs.streamId); - // CHECK: hipEventSynchronize(stopTime); - // CHECK: hipEventElapsedTime(&gemvComputeTume, startTime, stopTime); - cudaEventRecord(stopTime, crs.streamId); - cudaEventSynchronize(stopTime); - cudaEventElapsedTime(&gemvComputeTume, startTime, stopTime); - gemvComputeTume /=1000.0; - } - // Get back result - // CHECK: CudaCheck( hipMemcpy(y, cu_y, crs.m*sizeof(double), hipMemcpyDeviceToHost ) ); - CudaCheck( cudaMemcpy(y, cu_y, crs.m*sizeof(double), cudaMemcpyDeviceToHost ) ); - // Dealloc vectors - // CHECK: CudaCheck(hipFree(cu_x)); - // CHECK: CudaCheck(hipFree(cu_y)); - CudaCheck(cudaFree(cu_x)); - CudaCheck(cudaFree(cu_y)); - return gemvComputeTume; -} - -// BCSR part -struct BCRSArrays { - int m; - int nnz; - int nbBlocks; - int nbBlockRow; - int blockSize; - int* cu_bsrRowPtrC; - int* cu_bsrColIndC; - double* cu_bsrValC; - // CHECK: hipStream_t streamId; - cudaStream_t streamId; - // CHECK: hipsparseHandle_t cusparseHandle; - cusparseHandle_t cusparseHandle; - - BCRSArrays() { - cu_bsrRowPtrC = NULL; - cu_bsrColIndC = NULL; - cu_bsrValC = NULL; - // Create sparse handle (needed to call sparse functions - streamId = 0; - // CHECK: CudaSparseCheck(hipsparseCreate(&cusparseHandle)); - // CHECK: CudaSparseCheck(hipsparseSetStream(cusparseHandle, streamId)); - CudaSparseCheck(cusparseCreate(&cusparseHandle)); - CudaSparseCheck(cusparseSetStream(cusparseHandle, streamId)); - } - - ~BCRSArrays() { - // CHECK: CudaCheck(hipFree(cu_bsrRowPtrC)); - // CHECK: CudaCheck(hipFree(cu_bsrColIndC)); - // CHECK: CudaCheck(hipFree(cu_bsrValC)); - CudaCheck(cudaFree(cu_bsrRowPtrC)); - CudaCheck(cudaFree(cu_bsrColIndC)); - CudaCheck(cudaFree(cu_bsrValC)); - // Destroy sparse handle - // CHECK: CudaSparseCheck(hipsparseDestroy(cusparseHandle)); - CudaSparseCheck(cusparseDestroy(cusparseHandle)); - } -}; - -void CRS_to_BCRS(CRSArrays& csr, BCRSArrays* bcrs, const int blockSize) { - bcrs->m = csr.m; - bcrs->nnz = csr.nnz; - bcrs->blockSize = blockSize; - bcrs->nbBlockRow = (csr.m + blockSize-1)/blockSize; - // CHECK: hipMalloc((void**)&bcrs->cu_bsrRowPtrC, sizeof(int) *(bcrs->nbBlockRow+1)); - cudaMalloc((void**)&bcrs->cu_bsrRowPtrC, sizeof(int) *(bcrs->nbBlockRow+1)); - // CHECK: hipsparseMatDescr_t descr = 0; - cusparseMatDescr_t descr = 0; - // CHECK: CudaSparseCheck(hipsparseCreateMatDescr(&descr)); - // CHECK: hipsparseSetMatType(descr,HIPSPARSE_MATRIX_TYPE_GENERAL); - // CHECK: hipsparseSetMatIndexBase(descr,HIPSPARSE_INDEX_BASE_ZERO); - CudaSparseCheck(cusparseCreateMatDescr(&descr)); - cusparseSetMatType(descr,CUSPARSE_MATRIX_TYPE_GENERAL); - cusparseSetMatIndexBase(descr,CUSPARSE_INDEX_BASE_ZERO); - int nbNnzBlocks; - // NOTE: cusparseXcsr2bsrNnz and CUSPARSE_DIRECTION_COLUMN (of type cusparseDirection_t) are yet unsupported by HIP - // CHECK-NOT: hipsparseXcsr2bsrNnz(bcrs->cusparseHandle, HIPSPARSE_DIRECTION_COLUMN, csr.m, csr.m, descr, csr.cu_csrRowPtrA, csr.cu_csrColIndA, - cusparseXcsr2bsrNnz(bcrs->cusparseHandle, CUSPARSE_DIRECTION_COLUMN, csr.m, csr.m, descr, csr.cu_csrRowPtrA, csr.cu_csrColIndA, - blockSize, descr, bcrs->cu_bsrRowPtrC, &nbNnzBlocks); - { - int firstBlockIdx, lastBlockIdx; - // CHECK: hipMemcpy(&lastBlockIdx, bcrs->cu_bsrRowPtrC+bcrs->nbBlockRow, sizeof(int), hipMemcpyDeviceToHost); - // CHECK: hipMemcpy(&firstBlockIdx, bcrs->cu_bsrRowPtrC, sizeof(int), hipMemcpyDeviceToHost); - cudaMemcpy(&lastBlockIdx, bcrs->cu_bsrRowPtrC+bcrs->nbBlockRow, sizeof(int), cudaMemcpyDeviceToHost); - cudaMemcpy(&firstBlockIdx, bcrs->cu_bsrRowPtrC, sizeof(int), cudaMemcpyDeviceToHost); - assert(firstBlockIdx == 0); // we are in base 0 - assert(nbNnzBlocks == lastBlockIdx - firstBlockIdx); - } - bcrs->nbBlocks = nbNnzBlocks; - // CHECK: CudaCheck(hipMalloc((void**)&bcrs->cu_bsrColIndC, sizeof(int)*nbNnzBlocks)); - // CHECK: CudaCheck(hipMalloc((void**)&bcrs->cu_bsrValC, sizeof(double)*(blockSize*blockSize)*nbNnzBlocks)); - CudaCheck(cudaMalloc((void**)&bcrs->cu_bsrColIndC, sizeof(int)*nbNnzBlocks)); - CudaCheck(cudaMalloc((void**)&bcrs->cu_bsrValC, sizeof(double)*(blockSize*blockSize)*nbNnzBlocks)); - // NOTE: cusparseDcsr2bsr and CUSPARSE_DIRECTION_COLUMN (of type cusparseDirection_t) are yet unsupported by HIP - // CHECK-NOT: hipsparseDcsr2bsr(bcrs->cusparseHandle, HIPSPARSE_DIRECTION_COLUMN, - cusparseDcsr2bsr(bcrs->cusparseHandle, CUSPARSE_DIRECTION_COLUMN, - csr.m, csr.m, descr, csr.cu_csrValA, csr.cu_csrRowPtrA, csr.cu_csrColIndA, blockSize, descr, bcrs->cu_bsrValC, bcrs->cu_bsrRowPtrC, bcrs->cu_bsrColIndC); -} - -double compute_BSR(BCRSArrays& bcsr, double *x , double *y){ - // For blas 2 gemv y = alpha.x.A + Beta.y - const double alpha = 1.0; - const double beta = 0.0; - // Copy input - const int sizeMultipleBlockSize = ((bcsr.m+bcsr.blockSize-1)/bcsr.blockSize)*bcsr.blockSize; - double* cu_x = allocAndCopyPart(x, bcsr.m, sizeMultipleBlockSize); - double* cu_y = allocAndCopyPart(y, bcsr.m, sizeMultipleBlockSize); - // Init matrix properties - // CHECK: hipsparseMatDescr_t descr = 0; - // CHECK: CudaSparseCheck(hipsparseCreateMatDescr(&descr)); - // CHECK: hipsparseSetMatType(descr,HIPSPARSE_MATRIX_TYPE_GENERAL); - // CHECK: hipsparseSetMatIndexBase(descr,HIPSPARSE_INDEX_BASE_ZERO); - cusparseMatDescr_t descr = 0; - CudaSparseCheck(cusparseCreateMatDescr(&descr)); - cusparseSetMatType(descr,CUSPARSE_MATRIX_TYPE_GENERAL); - cusparseSetMatIndexBase(descr,CUSPARSE_INDEX_BASE_ZERO); - // Compute gemv - float gemvComputeTume = 0; - { - // CHECK: hipEvent_t startTime, stopTime; - // CHECK: hipEventCreate(&startTime); - // CHECK: hipEventCreate(&stopTime); - // CHECK: hipEventRecord(startTime, bcsr.streamId); - cudaEvent_t startTime, stopTime; - cudaEventCreate(&startTime); - cudaEventCreate(&stopTime); - cudaEventRecord(startTime, bcsr.streamId); - // CHECK: cusparseDbsrmv(bcsr.cusparseHandle, HIPSPARSE_DIRECTION_COLUMN, HIPSPARSE_OPERATION_NON_TRANSPOSE, - cusparseDbsrmv(bcsr.cusparseHandle, CUSPARSE_DIRECTION_COLUMN, CUSPARSE_OPERATION_NON_TRANSPOSE, - bcsr.nbBlockRow, bcsr.m, bcsr.nbBlocks, &alpha, descr, - bcsr.cu_bsrValC, bcsr.cu_bsrRowPtrC, bcsr.cu_bsrColIndC, bcsr.blockSize, - cu_x, &beta, cu_y); - // CHECK: hipEventRecord(stopTime, bcsr.streamId); - // CHECK: hipEventSynchronize(stopTime); - // CHECK: hipEventElapsedTime(&gemvComputeTume, startTime, stopTime); - cudaEventRecord(stopTime, bcsr.streamId); - cudaEventSynchronize(stopTime); - cudaEventElapsedTime(&gemvComputeTume, startTime, stopTime); - gemvComputeTume /=1000.0; - } - // Get back result - // CHECK: CudaCheck( hipMemcpy(y, cu_y, bcsr.m*sizeof(double), hipMemcpyDeviceToHost ) ); - CudaCheck( cudaMemcpy(y, cu_y, bcsr.m*sizeof(double), cudaMemcpyDeviceToHost ) ); - // Dealloc vectors - // CHECK: CudaCheck(hipFree(cu_x)); - // CHECK: CudaCheck(hipFree(cu_y)); - CudaCheck(cudaFree(cu_x)); - CudaCheck(cudaFree(cu_y)); - return gemvComputeTume; -} diff --git a/tests/src/p2p/hipPeerToPeer_simple.cpp b/tests/src/p2p/hipPeerToPeer_simple.cpp index 741f888369..f2f3592df2 100644 --- a/tests/src/p2p/hipPeerToPeer_simple.cpp +++ b/tests/src/p2p/hipPeerToPeer_simple.cpp @@ -389,39 +389,65 @@ void simpleNegative() { int main(int argc, char* argv[]) { - parseMyArguments(argc, argv); + int ret_code = 0; + + do { int gpuCount; HIPCHECK(hipGetDeviceCount(&gpuCount)); - if (gpuCount < 2) { - printf("P2P application requires atleast 2 gpu devices\n"); - if (hip_skip_tests_enabled()) { - return hip_skip_retcode(); - } - } else { - if (p_tests & 0x100) { - testPeerHostToDevice(false /*useAsyncCopy*/); - } - testPeerHostToDevice(true /*useAsyncCopy*/); - - if (p_tests & 0x1) { - enablePeerFirst(false /*useAsyncCopy*/); - } - - if (p_tests & 0x2) { - allocMemoryFirst(false /*useAsyncCopy*/); - } - - if (p_tests & 0x4) { - simpleNegative(); - } - - if (p_tests & 0x8) { - enablePeerFirst(true /*useAsyncCopy*/); - } - if (p_tests & 0x10) { - allocMemoryFirst(true /*useAsyncCopy*/); - } + printf("P2P application requires atleast 2 gpu devices\n"); + if (hip_skip_tests_enabled()) { + ret_code = hip_skip_retcode(); + } + break; //break from do while(0). } + + int canAccessPeer; + for (int dev_idx = 0; dev_idx < (gpuCount-1); ++dev_idx) { + HIPCHECK(hipDeviceCanAccessPeer(&canAccessPeer, dev_idx, dev_idx + 1)); + if (canAccessPeer == 0) { + printf("P2P Access not available between GPUs %d and %d \n", dev_idx, dev_idx + 1); + if (hip_skip_tests_enabled()) { + ret_code = hip_skip_retcode(); + } + break; // break from for loop. + } + } + + if (canAccessPeer == 0) { + break; //break from do while(0). + } + + // Run the test case scenarios + parseMyArguments(argc, argv); + if (p_tests & 0x100) { + testPeerHostToDevice(false /*useAsyncCopy*/); + } + testPeerHostToDevice(true /*useAsyncCopy*/); + + if (p_tests & 0x1) { + enablePeerFirst(false /*useAsyncCopy*/); + } + + if (p_tests & 0x2) { + allocMemoryFirst(false /*useAsyncCopy*/); + } + + if (p_tests & 0x4) { + simpleNegative(); + } + + if (p_tests & 0x8) { + enablePeerFirst(true /*useAsyncCopy*/); + } + if (p_tests & 0x10) { + allocMemoryFirst(true /*useAsyncCopy*/); + } + } while (0); + + if (ret_code == 0 || ret_code == hip_skip_retcode()) { passed(); + } + + return ret_code; } diff --git a/tests/src/runtimeApi/module/hipExtLaunchMultiKernelMultiDevice.cpp b/tests/src/runtimeApi/module/hipExtLaunchMultiKernelMultiDevice.cpp index 30701a39f2..c47c472766 100644 --- a/tests/src/runtimeApi/module/hipExtLaunchMultiKernelMultiDevice.cpp +++ b/tests/src/runtimeApi/module/hipExtLaunchMultiKernelMultiDevice.cpp @@ -33,7 +33,7 @@ THE SOFTWARE. #include #define MAX_GPUS 8 -/* +/* * Square each element in the array A and write to array C. */ #define NUM_KERNEL_ARGS 3 @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) // Fill with Phi + i for (size_t i = 0; i < N; i++) { - A_h[i] = 1.618f + i; + A_h[i] = 1.618f + i; } const unsigned blocks = 512; @@ -136,6 +136,6 @@ int main(int argc, char *argv[]) } } } - + printf ("PASSED!\n"); } diff --git a/tests/src/texture/hipBindTexRef1DFetch.cpp b/tests/src/texture/hipBindTexRef1DFetch.cpp index 0a890629c3..b2ea94b0bc 100644 --- a/tests/src/texture/hipBindTexRef1DFetch.cpp +++ b/tests/src/texture/hipBindTexRef1DFetch.cpp @@ -68,7 +68,7 @@ int runTest() { HIPCHECK(hipMalloc(&texBuf, N * sizeof(float))); HIPCHECK(hipMalloc(&devBuf, N * sizeof(float))); HIPCHECK(hipMemcpy(texBuf, val, N * sizeof(float), hipMemcpyHostToDevice)); - + tex.addressMode[0] = hipAddressModeClamp; tex.addressMode[1] = hipAddressModeClamp; tex.filterMode = hipFilterModePoint; diff --git a/tests/src/texture/hipNormalizedFloatValueTex.cpp b/tests/src/texture/hipNormalizedFloatValueTex.cpp index f2f1937132..3ac14b314d 100644 --- a/tests/src/texture/hipNormalizedFloatValueTex.cpp +++ b/tests/src/texture/hipNormalizedFloatValueTex.cpp @@ -1,16 +1,16 @@ /* Copyright (c) 2019 - 2021 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 @@ -181,7 +181,7 @@ int main(int argc, char** argv) #ifdef __HIP_PLATFORM_AMD__ std::cout << "Arch - AMD GPU :: " << props.gcnArch << std::endl; #endif - + if(textureFilterMode == 0) { printf("Test hipFilterModePoint\n"); status = runTest(); diff --git a/tests/src/texture/hipTex1DFetchCheckModes.cpp b/tests/src/texture/hipTex1DFetchCheckModes.cpp index d6f7712ce2..856eaeb05a 100644 --- a/tests/src/texture/hipTex1DFetchCheckModes.cpp +++ b/tests/src/texture/hipTex1DFetchCheckModes.cpp @@ -61,7 +61,7 @@ int runTest(hipTextureAddressMode addressMode, hipTextureFilterMode filterMode) // Allocating the required buffer on gpu device float *texBuf, *texBufOut; float val[N], output[N]; - + for (int i = 0; i < N; i++) { val[i] = i+1; output[i] = 0.0; @@ -85,7 +85,7 @@ int runTest(hipTextureAddressMode addressMode, hipTextureFilterMode filterMode) texDesc.addressMode[0] = addressMode; texDesc.addressMode[1] = addressMode; - texDesc.filterMode = filterMode; + texDesc.filterMode = filterMode; texDesc.normalizedCoords = false; // Creating texture object diff --git a/tests/src/texture/hipTexObjPitch.cpp b/tests/src/texture/hipTexObjPitch.cpp index 47e09d83a9..6869081a20 100644 --- a/tests/src/texture/hipTexObjPitch.cpp +++ b/tests/src/texture/hipTexObjPitch.cpp @@ -49,12 +49,12 @@ void texture2Dtest() for(size_t i=1; i <= (SIZE_H*SIZE_W); i++){ A[i-1] = i; } - + size_t devPitchA; HIPCHECK(hipMallocPitch((void**)&devPtrA, &devPitchA ,SIZE_W*sizeof(TYPE_t), SIZE_H)) ; HIPCHECK(hipMemcpy2D(devPtrA, devPitchA, A, SIZE_W*sizeof(TYPE_t), SIZE_W*sizeof(TYPE_t), SIZE_H, hipMemcpyHostToDevice)); - + // Use the texture object hipResourceDesc texRes; memset(&texRes, 0, sizeof(texRes)); diff --git a/tests/src/texture/simpleTexture2DLayered.cpp b/tests/src/texture/simpleTexture2DLayered.cpp index 0e1d55095d..7709a8cbec 100644 --- a/tests/src/texture/simpleTexture2DLayered.cpp +++ b/tests/src/texture/simpleTexture2DLayered.cpp @@ -82,7 +82,7 @@ void runTest(int width,int height,int num_layers,texture texi; texture texc; template -__global__ void simpleKernel3DArray(T* outputData, +__global__ void simpleKernel3DArray(T* outputData, int width, int height,int depth) { @@ -114,7 +114,7 @@ void runTest(int width,int height,int depth,texture