resolve merge conflict
Este commit está contenido en:
+1
-1
@@ -15,4 +15,4 @@ include/hip/hip_version.h
|
||||
tags
|
||||
samples/1_Utils/hipInfo/hipInfo
|
||||
samples/1_Utils/hipBusBandwidth/hipBusBandwidth
|
||||
samples/1_Utils/hipDispatchLatency/hipDispatchLatency
|
||||
samples/1_Utils/hipDispatchLatency/hipDispatchLatency
|
||||
+2
-6
@@ -46,12 +46,8 @@ apt-get install hip-hcc
|
||||
|
||||
```
|
||||
git clone https://github.com/llvm/llvm-project.git
|
||||
cd llvm-project/llvm/tools
|
||||
ln -s clang ../../clang
|
||||
ln -s lld ../../lld
|
||||
cd ../..
|
||||
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" ../llvm
|
||||
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_EXTERNAL_LLD_SOURCE_DIR=../lld -DLLVM_EXTERNAL_CLANG_SOURCE_DIR=../clang ../llvm
|
||||
make -j
|
||||
sudo make install
|
||||
```
|
||||
@@ -60,7 +56,7 @@ sudo make install
|
||||
|
||||
```
|
||||
export PATH=/opt/rocm/llvm/bin:$PATH
|
||||
git clone -b master https://github.com/RadeonOpenCompute/ROCm-Device-Libs.git
|
||||
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 ..
|
||||
|
||||
vendido
+1
-1
@@ -394,7 +394,7 @@ cuda_10_x:
|
||||
// Block of string constants customizing behavior for cuda
|
||||
String nvcc_ver = 'cuda-10.x'
|
||||
String from_image = 'ci_test_nodes/cuda-10.x/ubuntu-16.04:latest'
|
||||
String inside_args = '--runtime=nvidia';
|
||||
String inside_args = '--gpus all';
|
||||
|
||||
// Checkout source code, dependencies and version files
|
||||
String source_hip_rel = checkout_and_version( nvcc_ver )
|
||||
|
||||
+65
-235
@@ -60,6 +60,9 @@ $isWindows = $^O eq 'MSWin32';
|
||||
$HIPCC_COMPILE_FLAGS_APPEND=$ENV{'HIPCC_COMPILE_FLAGS_APPEND'};
|
||||
$HIPCC_LINK_FLAGS_APPEND=$ENV{'HIPCC_LINK_FLAGS_APPEND'};
|
||||
|
||||
# Known HIP target names.
|
||||
@knownTargets = ('gfx701', 'gfx801', 'gfx802', 'gfx803', 'gfx900', 'gfx906', 'gfx908', 'gfx1010', 'gfx1011', 'gfx1012');
|
||||
|
||||
#
|
||||
# TODO: Fix rpath LDFLAGS settings
|
||||
#
|
||||
@@ -135,10 +138,6 @@ if (defined $HIP_RUNTIME and $HIP_RUNTIME eq "VDI" and !defined $HIP_VDI_HOME) {
|
||||
if (defined $HIP_VDI_HOME) {
|
||||
if (!defined $HIP_CLANG_PATH and (-e "$HIP_VDI_HOME/bin/clang" or -e "$HIP_VDI_HOME/bin/clang.exe")) {
|
||||
$HIP_CLANG_PATH = "$HIP_VDI_HOME/bin";
|
||||
# With HIP_VDI_HOME defined, assume the installation of clang components, including headers.
|
||||
if (!defined $HIP_CLANG_INCLUDE_PATH) {
|
||||
$HIP_CLANG_INCLUDE_PATH = "$HIP_VDI_HOME/include/clang";
|
||||
}
|
||||
}
|
||||
if (!defined $DEVICE_LIB_PATH and -e "$HIP_VDI_HOME/lib/bitcode") {
|
||||
$DEVICE_LIB_PATH = "$HIP_VDI_HOME/lib/bitcode";
|
||||
@@ -167,15 +166,6 @@ if ($verbose & 0x2) {
|
||||
# set if user explicitly requests -stdlib=libc++. (else we default to libstdc++ for better interop with g++):
|
||||
$setStdLib = 0; # TODO - set to 0
|
||||
|
||||
$target_gfx701 = 0;
|
||||
$target_gfx801 = 0;
|
||||
$target_gfx802 = 0;
|
||||
$target_gfx803 = 0;
|
||||
$target_gfx900 = 0;
|
||||
$target_gfx906 = 0;
|
||||
$target_gfx908 = 0;
|
||||
$target_gfx1010 = 0;
|
||||
$target_gfx1012 = 0;
|
||||
$default_amdgpu_target = 1;
|
||||
|
||||
if ($HIP_PLATFORM eq "clang") {
|
||||
@@ -352,6 +342,7 @@ my $runCmd = 1;
|
||||
my $buildDeps = 0;
|
||||
my $linkType = 1;
|
||||
my $setLinkType = 0;
|
||||
my $coFormatv3 = 1;
|
||||
|
||||
my @options = ();
|
||||
my @inputs = ();
|
||||
@@ -398,6 +389,8 @@ if($HIP_PLATFORM eq "nvcc"){
|
||||
|
||||
my $toolArgs = ""; # arguments to pass to the hcc or nvcc tool
|
||||
my $optArg = ""; # -O args
|
||||
my $targetOpt = '--amdgpu-target=';
|
||||
my $targetsStr = "";
|
||||
|
||||
foreach $arg (@ARGV)
|
||||
{
|
||||
@@ -419,56 +412,24 @@ foreach $arg (@ARGV)
|
||||
$setStdLib = 1;
|
||||
}
|
||||
|
||||
# TODO: Add support for comma separated list like HCC_AMDGPU_TARGET
|
||||
if($arg eq '--amdgpu-target=gfx701')
|
||||
{
|
||||
$target_gfx701 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx801')
|
||||
{
|
||||
$target_gfx801 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx802')
|
||||
{
|
||||
$target_gfx802 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx803')
|
||||
{
|
||||
$target_gfx803 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx900')
|
||||
{
|
||||
$target_gfx900 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx906')
|
||||
{
|
||||
$target_gfx906 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx908')
|
||||
{
|
||||
$target_gfx908 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx1010')
|
||||
{
|
||||
$target_gfx1010 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($arg eq '--amdgpu-target=gfx1012')
|
||||
{
|
||||
$target_gfx1012 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
# Check target selection option: --amdgpu-target=...
|
||||
if (substr($arg, 0, length($targetOpt)) eq $targetOpt) {
|
||||
# If targets string is not empty, add a comma before adding new target option value.
|
||||
$targetsStr .= ($targetsStr ? ',' : '');
|
||||
$targetsStr .= substr($arg, length($targetOpt));
|
||||
$default_amdgpu_target = 0;
|
||||
# hip-clang does not accept --amdgpu-target= options.
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$swallowArg = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# hip-clang does not accept --amdgpu-target= options.
|
||||
if (($arg =~ /--amdgpu-target=/) and $HIP_PLATFORM eq 'clang' ) {
|
||||
$swallowArg = 1;
|
||||
# code object format parsing
|
||||
if ($trimarg eq '-mcode-object-v3') {
|
||||
$coFormatv3 = 1;
|
||||
}
|
||||
if ($trimarg eq '-mno-code-object-v3') {
|
||||
$coFormatv3 = 0;
|
||||
}
|
||||
|
||||
if (($arg =~ /--genco/) and $HIP_PLATFORM eq 'clang' ) {
|
||||
@@ -665,192 +626,61 @@ foreach $arg (@ARGV)
|
||||
|
||||
if($HIP_PLATFORM eq "hcc" or $HIP_PLATFORM eq "clang"){
|
||||
# No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET
|
||||
if($default_amdgpu_target eq 1 and defined $ENV{HCC_AMDGPU_TARGET})
|
||||
{
|
||||
foreach my $target (split(/,/, $ENV{HCC_AMDGPU_TARGET}))
|
||||
{
|
||||
if($target eq 'gfx701')
|
||||
{
|
||||
$target_gfx701 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx801')
|
||||
{
|
||||
$target_gfx801 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx802')
|
||||
{
|
||||
$target_gfx802 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx803')
|
||||
{
|
||||
$target_gfx803 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx900')
|
||||
{
|
||||
$target_gfx900 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx906')
|
||||
{
|
||||
$target_gfx906 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx908')
|
||||
{
|
||||
$target_gfx908 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx1010')
|
||||
{
|
||||
$target_gfx1010 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($target eq 'gfx1012')
|
||||
{
|
||||
$target_gfx1012 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($default_amdgpu_target eq 1) {
|
||||
if (defined $ENV{HCC_AMDGPU_TARGET}) {
|
||||
$targetsStr = $ENV{HCC_AMDGPU_TARGET};
|
||||
} else {
|
||||
# Else try using rocm_agent_enumerator
|
||||
$ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
|
||||
$targetsStr = `${ROCM_AGENT_ENUM} -t GPU`;
|
||||
$targetsStr =~ s/\n/,/g;
|
||||
}
|
||||
}
|
||||
# Else try using rocm_agent_enumerator
|
||||
if($default_amdgpu_target eq 1)
|
||||
{
|
||||
$ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
|
||||
|
||||
my $myAgents = `${ROCM_AGENT_ENUM} -t GPU`;
|
||||
my @agentsLine = split('\n', $myAgents);
|
||||
|
||||
foreach my $val (@agentsLine) {
|
||||
if($val eq "gfx701") {
|
||||
$target_gfx701 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx801") {
|
||||
$target_gfx801 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx802") {
|
||||
$target_gfx802 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx803") {
|
||||
$target_gfx803 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx900") {
|
||||
$target_gfx900 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx906") {
|
||||
$target_gfx906 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq "gfx908") {
|
||||
$target_gfx908 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq 'gfx1010')
|
||||
{
|
||||
$target_gfx1010 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
if($val eq 'gfx1012')
|
||||
{
|
||||
$target_gfx1012 = 1;
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
# rocm_agent_enumerator failed! Throw an error and die if linking is required
|
||||
if ($default_amdgpu_target eq 1 and $compileOnly eq 0)
|
||||
{
|
||||
print "No valid AMD GPU target was either specified or found. Please specify a valid target using --amdgpu-target=" and die();
|
||||
$default_amdgpu_target = 0;
|
||||
}
|
||||
|
||||
$ENV{HCC_EXTRA_LIBRARIES}="\n";
|
||||
# Parse the targets collected in targetStr and set corresponding compiler options.
|
||||
my @targets = split(',', $targetsStr);
|
||||
|
||||
if($HIP_PLATFORM eq "hcc") {
|
||||
$GPU_ARCH_OPT = " --amdgpu-target=";
|
||||
} else {
|
||||
$GPU_ARCH_OPT = " --cuda-gpu-arch=";
|
||||
}
|
||||
# Handle ROCm target platform
|
||||
if ($target_gfx701 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx701";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
|
||||
foreach my $val (@targets) {
|
||||
# Ignore 'gfx000' target reported by rocm_agent_enumerator.
|
||||
if ($val ne 'gfx000') {
|
||||
# Construct an arch macro to be passed to the compiler.
|
||||
# Example: gfx900 --> -D__HIP_ARCH_GFX900__=1
|
||||
my $archMacro = ' -D__HIP_ARCH_' . uc($val) . '__=1 ';
|
||||
# Add the arch option and macro to the compiler options.
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . $val;
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
$HIPCXXFLAGS .= $archMacro;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;
|
||||
}
|
||||
|
||||
# If the specified target is not in the list of known target names, emit a warning.
|
||||
if (grep(/$val/, @knownTargets) eq 0) {
|
||||
print "Warning: The specified HIP target: $val is unknown. Correct compilation is not guaranteed.\n";
|
||||
}
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX701__=1 ";
|
||||
}
|
||||
if ($target_gfx801 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx801";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX801__=1 ";
|
||||
}
|
||||
if ($target_gfx802 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx802";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX802__=1 ";
|
||||
}
|
||||
if ($target_gfx803 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx803";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX803__=1 ";
|
||||
}
|
||||
if ($target_gfx900 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx900";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX900__=1 ";
|
||||
}
|
||||
if ($target_gfx906 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx906";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX906__=1 ";
|
||||
}
|
||||
if ($target_gfx908 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx908";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX908__=1 ";
|
||||
}
|
||||
if ($target_gfx1010 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx1010";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX1010__=1 ";
|
||||
}
|
||||
if ($target_gfx1012 eq 1) {
|
||||
$GPU_ARCH_ARG = $GPU_ARCH_OPT . "gfx1012";
|
||||
$HIPLDFLAGS .= $GPU_ARCH_ARG;
|
||||
if ($HIP_PLATFORM eq 'clang') {
|
||||
$HIPCXXFLAGS .= $GPU_ARCH_ARG;;
|
||||
}
|
||||
$HIPCXXFLAGS .= " -D__HIP_ARCH_GFX1012__=1 ";
|
||||
|
||||
# rocm_agent_enumerator failed! Throw an error and die if linking is required
|
||||
if ($default_amdgpu_target eq 1 and $compileOnly eq 0) {
|
||||
print "No valid AMD GPU target was either specified or found. Please specify a valid target using --amdgpu-target=" and die();
|
||||
}
|
||||
|
||||
$ENV{HCC_EXTRA_LIBRARIES}="\n";
|
||||
}
|
||||
|
||||
# hcc defaults to v2, so we need to convert to the appropriate flag
|
||||
# hip-clang defaults to v3, so we don't need to do anything
|
||||
if ($coFormatv3 and $HIP_PLATFORM eq 'hcc') {
|
||||
$HIPLDFLAGS .= " -mcode-object-v3";
|
||||
$HIPCXXFLAGS .= " -mcode-object-v3";
|
||||
}
|
||||
|
||||
if ($hasC and $HIP_PLATFORM eq 'nvcc') {
|
||||
|
||||
@@ -237,3 +237,6 @@ To disable it and use the legancy grid launch method, please either change the d
|
||||
$HIP/include/hip/hcc_detail/hip_runtime_api.h
|
||||
$HIP/include/hip/hcc_detail/host_defines.h
|
||||
Or pass "-DGENERIC_GRID_LAUNCH=0" to hipcc at application compilation time.
|
||||
|
||||
### What is maximum limit of Generic Grid Launch parameters (grid and block)?
|
||||
Product of (grid.x and block.x), (grid.y and block.y) or (grid.z and block.z) should always be less than UINT_MAX.
|
||||
@@ -160,7 +160,7 @@ if (HIPIFY_CLANG_TESTS)
|
||||
(CUDA_VERSION VERSION_GREATER "9.0" AND LLVM_PACKAGE_VERSION VERSION_LESS "7.0") OR
|
||||
(CUDA_VERSION VERSION_GREATER "9.2" AND LLVM_PACKAGE_VERSION VERSION_LESS "8.0") OR
|
||||
(CUDA_VERSION VERSION_GREATER "10.0" AND LLVM_PACKAGE_VERSION VERSION_LESS "9.0") OR
|
||||
(CUDA_VERSION VERSION_GREATER "10.1"))
|
||||
(CUDA_VERSION VERSION_GREATER "10.1" AND LLVM_PACKAGE_VERSION VERSION_LESS "10.0"))
|
||||
message(SEND_ERROR "CUDA ${CUDA_VERSION} is not supported by LLVM ${LLVM_PACKAGE_VERSION}.")
|
||||
if (CUDA_VERSION_MAJOR VERSION_LESS "7")
|
||||
message(STATUS "Please install CUDA 7.0 or higher.")
|
||||
@@ -176,8 +176,8 @@ if (HIPIFY_CLANG_TESTS)
|
||||
message(STATUS "Please install LLVM + clang 8.0 or higher.")
|
||||
elseif (CUDA_VERSION VERSION_EQUAL "10.1")
|
||||
message(STATUS "Please install LLVM + clang 9.0 or higher.")
|
||||
elseif (CUDA_VERSION VERSION_GREATER "10.1")
|
||||
message(STATUS "Please install CUDA 10.1 or lesser.")
|
||||
elseif (CUDA_VERSION VERSION_EQUAL "10.2")
|
||||
message(STATUS "Please install LLVM + clang 10.0 or higher.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -28,23 +28,24 @@ After applying all the matchers, the output HIP source is produced.
|
||||
**Advantages:**
|
||||
|
||||
1. It is a translator; thus, any even very complicated constructs will be parsed successfully, or an error will be reported.
|
||||
2. It supports clang options like -I, -D, --cuda-path, etc.
|
||||
2. It supports clang options like [`-I`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-i-dir), [`-D`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-d-macro), [`--cuda-path`](https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-cuda-path), etc.
|
||||
3. Seamless support of new CUDA versions as it is clang's responsibility.
|
||||
4. Ease in support.
|
||||
|
||||
**Disadvantages:**
|
||||
|
||||
1. The main advantage is also the main disadvantage: the input CUDA code should be correct; incorrect code wouldn't be translated to HIP.
|
||||
2. CUDA should be installed and provided in case of multiple installations by --cuda-path option.
|
||||
2. CUDA should be installed and provided in case of multiple installations by `--cuda-path` option.
|
||||
3. All the includes and defines should be provided to transform code successfully.
|
||||
|
||||
### <a name="dependencies"></a> hipify-clang: dependencies
|
||||
|
||||
`hipify-clang` requires:
|
||||
|
||||
1. [**LLVM+CLANG**](http://releases.llvm.org) of at least version [3.8.0](http://releases.llvm.org/download.html#3.8.0); the latest stable and recommended release: [**9.0.1**](http://releases.llvm.org/download.html#9.0.1).
|
||||
1. [**LLVM+CLANG**](http://releases.llvm.org) of at least version [3.8.0](http://releases.llvm.org/download.html#3.8.0); the latest stable and recommended release: [**9.0.1**](http://releases.llvm.org/download.html#9.0.1), the latest release candidate: [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1).
|
||||
|
||||
2. [**CUDA**](https://developer.nvidia.com/cuda-downloads) of at least version [7.0](https://developer.nvidia.com/cuda-toolkit-70), the latest supported version is [**10.1 Update 2**](https://developer.nvidia.com/cuda-10.1-download-archive-base).
|
||||
To use the latest CUDA version [10.2](https://developer.nvidia.com/cuda-downloads) please use the latest `LLVM` release candidate: [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1).
|
||||
|
||||
| **LLVM release version** | **CUDA latest supported version** | **Windows** | **Linux** |
|
||||
|:----------------------------------------------------------:|:------------------------------------------------------------------------:|:-----------:|:---------:|
|
||||
@@ -66,12 +67,13 @@ After applying all the matchers, the output HIP source is produced.
|
||||
| [8.0.1](http://releases.llvm.org/download.html#8.0.1) | [10.0](https://developer.nvidia.com/cuda-10.0-download-archive) | - <br/> not working due to <br/> the clang's bug [38811](https://bugs.llvm.org/show_bug.cgi?id=38811) <br/>+<br/>[patch](patches/patch_for_clang_8.0.1_bug_38811.zip)*</br> | + |
|
||||
| [9.0.0](http://releases.llvm.org/download.html#9.0.0) | [10.1](https://developer.nvidia.com/cuda-10.1-download-archive-base) | + | + |
|
||||
| [**9.0.1**](http://releases.llvm.org/download.html#9.0.1) | [**10.1**](https://developer.nvidia.com/cuda-10.1-download-archive-base) | + <br/> **LATEST STABLE RELEASE** | + <br/> **LATEST STABLE RELEASE** |
|
||||
| [10.0.0-rc1](https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.0-rc1) | [10.2](https://developer.nvidia.com/cuda-downloads) | + | + |
|
||||
|
||||
`*` Download the patch and unpack it into your LLVM distributive directory; a few header files will be overwritten; rebuilding of LLVM is not needed.
|
||||
`*` Download the patch and unpack it into your `LLVM` distributive directory; a few header files will be overwritten; rebuilding of `LLVM` is not needed.
|
||||
|
||||
In most cases, you can get a suitable version of LLVM+CLANG with your package manager.
|
||||
In most cases, you can get a suitable version of `LLVM+CLANG` with your package manager.
|
||||
|
||||
Failing that or having multiple versions of LLVM, you can [download a release archive](http://releases.llvm.org/), build or install it, and set
|
||||
Failing that or having multiple versions of `LLVM`, you can [download a release archive](http://releases.llvm.org/), build or install it, and set
|
||||
[CMAKE_PREFIX_PATH](https://cmake.org/cmake/help/v3.5/variable/CMAKE_PREFIX_PATH.html) so `cmake` can find it; for instance: `-DCMAKE_PREFIX_PATH=f:\LLVM\9.0.1\dist`
|
||||
|
||||
### <a name="hipify-clang-usage"></a> hipify-clang: usage
|
||||
@@ -84,10 +86,10 @@ For example:
|
||||
./hipify-clang square.cu --cuda-path=/usr/local/cuda-10.1 -I /usr/local/cuda-10.1/samples/common/inc
|
||||
```
|
||||
|
||||
`hipify-clang` arguments are given first, followed by a separator '--', and then the arguments you'd pass to `clang` if you
|
||||
`hipify-clang` arguments are given first, followed by a separator `'--'`, and then the arguments you'd pass to `clang` if you
|
||||
were compiling the input file. For example:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
./hipify-clang cpp17.cu --cuda-path=/usr/local/cuda-10.1 -- -std=c++17
|
||||
```
|
||||
|
||||
@@ -99,7 +101,7 @@ For a list of `hipify-clang` options, run `hipify-clang --help`.
|
||||
|
||||
Assuming this repository is at `./HIP`:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
cd hipify-clang
|
||||
mkdir build dist
|
||||
cd build
|
||||
@@ -111,7 +113,8 @@ cmake \
|
||||
|
||||
make -j install
|
||||
```
|
||||
On Windows, the following option should be specified for `cmake` at first place: `-G "Visual Studio 16 2019 Win64"`; the generated `hipify-clang.sln` should be built by `Visual Studio 15 2017` instead of `make.`
|
||||
On Windows, the following option should be specified for `cmake` at first place: `-G "Visual Studio 16 2019 Win64"`; the generated `hipify-clang.sln` should be built by `Visual Studio 16 2019` instead of `make.`
|
||||
Please, see [hipify-clang: Windows](#windows) for the supported tools for building.
|
||||
|
||||
Debug build type `-DCMAKE_BUILD_TYPE=Debug` is also supported and tested; `LLVM+CLANG` should be built in `Debug` mode as well.
|
||||
64-bit build mode (`-Thost=x64` on Windows) is also supported; `LLVM+CLANG` should be built in 64-bit mode as well.
|
||||
@@ -120,21 +123,17 @@ The binary can then be found at `./dist/bin/hipify-clang`.
|
||||
|
||||
### <a name="testing"></a> hipify-clang: testing
|
||||
|
||||
`hipify-clang` has unit tests using LLVM [`lit`](https://llvm.org/docs/CommandGuide/lit.html)/[`FileCheck`](https://llvm.org/docs/CommandGuide/FileCheck.html).
|
||||
`hipify-clang` has unit tests using `LLVM` [`lit`](https://llvm.org/docs/CommandGuide/lit.html)/[`FileCheck`](https://llvm.org/docs/CommandGuide/FileCheck.html).
|
||||
|
||||
**LLVM+CLANG should be built from sources, pre-built binaries are not exhaustive for testing.**
|
||||
`LLVM+CLANG` should be built from sources, pre-built binaries are not exhaustive for testing.
|
||||
|
||||
**LLVM 9.0.1 or older:**
|
||||
|
||||
To run it:
|
||||
1. download [`LLVM`](http://releases.llvm.org/9.0.1/llvm-9.0.1.src.tar.xz)+[`CLANG`](http://releases.llvm.org/9.0.1/cfe-9.0.1.src.tar.xz) sources;
|
||||
2. build [`LLVM+CLANG`](http://llvm.org/docs/CMake.html):
|
||||
```shell
|
||||
cd llvm
|
||||
mkdir build dist
|
||||
cd build
|
||||
```
|
||||
2. build [`LLVM+CLANG`](http://releases.llvm.org/9.0.0/docs/CMake.html):
|
||||
|
||||
- **Linux**:
|
||||
```shell
|
||||
**Linux**:
|
||||
```bash
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=../dist \
|
||||
-DLLVM_SOURCE_DIR=../llvm \
|
||||
@@ -143,8 +142,7 @@ To run it:
|
||||
../llvm
|
||||
make -j install
|
||||
```
|
||||
|
||||
- **Windows**:
|
||||
**Windows**:
|
||||
```shell
|
||||
cmake \
|
||||
-G "Visual Studio 16 2019" \
|
||||
@@ -156,9 +154,38 @@ To run it:
|
||||
-Thost=x64 \
|
||||
../llvm
|
||||
```
|
||||
Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`.
|
||||
|
||||
Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`.
|
||||
**LLVM 10.0.0 or newer:**
|
||||
|
||||
1. download [`LLVM project`](https://github.com/llvm/llvm-project/archive/llvmorg-10.0.0-rc1.tar.gz) sources;
|
||||
2. build [`LLVM project`](http://llvm.org/docs/CMake.html):
|
||||
|
||||
**Linux**:
|
||||
```bash
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=../dist \
|
||||
-DLLVM_SOURCE_DIR=../llvm-project \
|
||||
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX" \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
../llvm-project/llvm
|
||||
make -j install
|
||||
```
|
||||
**Windows**:
|
||||
```shell
|
||||
cmake \
|
||||
-G "Visual Studio 16 2019" \
|
||||
-A x64 \
|
||||
-DCMAKE_INSTALL_PREFIX=../dist \
|
||||
-DLLVM_SOURCE_DIR=../llvm-project \
|
||||
-DLLVM_TARGETS_TO_BUILD="NVPTX" \
|
||||
-DLLVM_ENABLE_PROJECTS="clang" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-Thost=x64 \
|
||||
../llvm-project/llvm
|
||||
```
|
||||
Run `Visual Studio 16 2019`, open the generated `LLVM.sln`, build all, build project `INSTALL`.
|
||||
|
||||
3. Ensure [`CUDA`](https://developer.nvidia.com/cuda-toolkit-archive) of minimum version 7.0 is installed.
|
||||
|
||||
@@ -188,7 +215,7 @@ To run it:
|
||||
|
||||
5. Ensure [`python`](https://www.python.org/downloads) of minimum required version 2.7 is installed.
|
||||
|
||||
6. Ensure `lit` and `FileCheck` are installed - these are distributed with LLVM.
|
||||
6. Ensure `lit` and `FileCheck` are installed - these are distributed with `LLVM`.
|
||||
|
||||
* Install `lit` into `python`:
|
||||
|
||||
@@ -212,23 +239,15 @@ To run it:
|
||||
|
||||
7. Set `HIPIFY_CLANG_TESTS` option turned on: `-DHIPIFY_CLANG_TESTS=1`.
|
||||
|
||||
8. Run `cmake`:
|
||||
* [***Linux***](#linux)
|
||||
* [***Windows***](#windows)
|
||||
8. Build and run tests:
|
||||
|
||||
9. Run tests:
|
||||
|
||||
- ***Linux***: `make test-hipify`.
|
||||
|
||||
- ***Windows***: run `Visual Studio 16 2019`, open the generated `hipify-clang.sln`, build project `test-hipify`.
|
||||
|
||||
### <a name="linux"></a > hipify-clang: Linux
|
||||
### <a name="Linux"></a > hipify-clang: Linux
|
||||
|
||||
On Linux the following configurations are tested:
|
||||
|
||||
Ubuntu 14: LLVM 5.0.0 - 6.0.1, CUDA 7.0 - 9.0, cudnn-5.0.5 - cudnn-7.6.5.32
|
||||
|
||||
Ubuntu 16-18: LLVM 8.0.0 - 9.0.1, CUDA 8.0 - 10.1 Update 2, cudnn-5.1.10 - cudnn-7.6.5.32
|
||||
Ubuntu 16-18: LLVM 8.0.0 - 10.0.0-rc1, CUDA 8.0 - 10.2, cudnn-5.1.10 - cudnn-7.6.5.32
|
||||
|
||||
Minimum build system requirements for the above configurations:
|
||||
|
||||
@@ -236,7 +255,7 @@ Python 2.7, cmake 3.5.1, GNU C/C++ 5.4.0.
|
||||
|
||||
Here is an example of building `hipify-clang` with testing support on `Ubuntu 16.04`:
|
||||
|
||||
```shell
|
||||
```bash
|
||||
cmake
|
||||
-DHIPIFY_CLANG_TESTS=1 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
@@ -380,11 +399,11 @@ LLVM 5.0.0 - 5.0.2, CUDA 8.0, cudnn 5.1.10 - 7.1.4.18
|
||||
|
||||
LLVM 6.0.0 - 6.0.1, CUDA 9.0, cudnn 7.0.5.15 - 7.6.5.32
|
||||
|
||||
LLVM 7.0.0 - 9.0.1, CUDA 7.5 - 10.1 Update 2, cudnn 7.0.5.15 - 7.6.5.32
|
||||
LLVM 7.0.0 - 10.0.0-rc1, CUDA 7.5 - 10.2, cudnn 7.0.5.15 - 7.6.5.32
|
||||
|
||||
Build system requirements for the latest configuration LLVM 9.0.1/CUDA 10.1 Update 2:
|
||||
Build system requirements for the latest stable configuration LLVM 9.0.1/CUDA 10.1 Update 2:
|
||||
|
||||
Python 3.6.0 - 3.8.1, cmake 3.5.1 - 3.16.3, Visual Studio 2017 (15.5.2) - 2019 (16.4.3).
|
||||
Python 3.6.0 - 3.8.1, cmake 3.5.1 - 3.16.3, Visual Studio 2017 (15.5.2) - 2019 (16.4.4).
|
||||
|
||||
Here is an example of building `hipify-clang` with testing support on `Windows 10` by `Visual Studio 16 2019`:
|
||||
|
||||
@@ -419,6 +438,8 @@ cmake
|
||||
-- Build files have been written to: f:/HIP/hipify-clang/build
|
||||
```
|
||||
|
||||
Run `Visual Studio 16 2019`, open the generated `hipify-clang.sln`, build project `test-hipify`.
|
||||
|
||||
## <a name="perl"></a> hipify-perl
|
||||
|
||||
`hipify-perl` is autogenerated perl-based script which heavily uses regular expressions.
|
||||
@@ -481,4 +502,3 @@ The information contained herein is for informational purposes only, and is subj
|
||||
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.
|
||||
|
||||
Copyright (c) 2014-2020 Advanced Micro Devices, Inc. All rights reserved.
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ StringRef readSourceText(clang::SourceManager &SM, const clang::SourceRange &exp
|
||||
*/
|
||||
std::string stringifyZeroDefaultedArg(clang::SourceManager &SM, const clang::Expr *arg) {
|
||||
if (clang::isa<clang::CXXDefaultArgExpr>(arg)) return "0";
|
||||
else return readSourceText(SM, arg->getSourceRange());
|
||||
else return std::string(readSourceText(SM, arg->getSourceRange()));
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -427,7 +427,7 @@ bool HipifyAction::cudaSharedIncompleteArrayVar(const mat::MatchFinder::MatchRes
|
||||
clang::LangOptions LO;
|
||||
LO.CUDA = true;
|
||||
clang::PrintingPolicy policy(LO);
|
||||
typeName = BT->getName(policy);
|
||||
typeName = std::string(BT->getName(policy));
|
||||
}
|
||||
} else {
|
||||
typeName = QT.getAsString();
|
||||
|
||||
@@ -44,7 +44,7 @@ ct::Replacements &getReplacements(ct::RefactoringTool &Tool, StringRef file) {
|
||||
#if LLVM_VERSION_MAJOR > 3
|
||||
// getReplacements() now returns a map from filename to Replacements - so create an entry
|
||||
// for this source file and return a reference to it.
|
||||
return Tool.getReplacements()[file];
|
||||
return Tool.getReplacements()[std::string(file)];
|
||||
#else
|
||||
return Tool.getReplacements();
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,7 @@ void appendArgumentsAdjusters(ct::RefactoringTool &Tool, const std::string &sSou
|
||||
// Includes for clang's CUDA wrappers for using by packaged hipify-clang
|
||||
static int Dummy;
|
||||
std::string hipify = llvm::sys::fs::getMainExecutable(hipify_exe, (void *)&Dummy);
|
||||
std::string clang_inc_path = llvm::sys::path::parent_path(hipify);
|
||||
std::string clang_inc_path = std::string(llvm::sys::path::parent_path(hipify));
|
||||
clang_inc_path.append("/include");
|
||||
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster(clang_inc_path.c_str(), ct::ArgumentInsertPosition::BEGIN));
|
||||
Tool.appendArgumentsAdjuster(ct::getInsertArgumentAdjuster("-isystem", ct::ArgumentInsertPosition::BEGIN));
|
||||
|
||||
@@ -154,6 +154,20 @@ hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* block
|
||||
dynSharedMemPerBlk, blockSizeLimit);
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline
|
||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(uint32_t* numBlocks, F kernel,
|
||||
uint32_t blockSize, size_t dynSharedMemPerBlk) {
|
||||
|
||||
using namespace hip_impl;
|
||||
|
||||
hip_impl::hip_init();
|
||||
auto f = get_program_state().kernel_descriptor(reinterpret_cast<std::uintptr_t>(kernel),
|
||||
target_agent(0));
|
||||
|
||||
return hipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, f, blockSize, dynSharedMemPerBlk);
|
||||
}
|
||||
|
||||
template <typename... Args, typename F = void (*)(Args...)>
|
||||
inline
|
||||
void hipLaunchKernelGGL(F kernel, const dim3& numBlocks, const dim3& dimBlocks,
|
||||
|
||||
@@ -2953,7 +2953,7 @@ hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* block
|
||||
* @param [in] dynSharedMemPerBlk dynamic shared memory usage (in bytes) intended for each block
|
||||
*/
|
||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk);
|
||||
uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk);
|
||||
|
||||
/**
|
||||
* @brief Returns occupancy for a device function.
|
||||
@@ -2964,8 +2964,7 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
* @param [in] dynSharedMemPerBlk dynamic shared memory usage (in bytes) intended for each block
|
||||
* @param [in] flags Extra flags for occupancy calculation (currently ignored)
|
||||
*/
|
||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
|
||||
uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags __dparm(hipOccupancyDefault));
|
||||
|
||||
#if __HIP_VDI__ && !defined(__HCC__)
|
||||
/**
|
||||
@@ -3235,6 +3234,21 @@ hipError_t hipLaunchKernel(const void* function_address,
|
||||
} /* extern "c" */
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
|
||||
template <typename F>
|
||||
static hipError_t __host__ inline hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk) {
|
||||
return ::hipOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, (hipFunction_t)func, blockSize,
|
||||
dynSharedMemPerBlk);
|
||||
}
|
||||
template <typename F>
|
||||
static hipError_t __host__ inline hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
uint32_t* numBlocks, F func, uint32_t blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
|
||||
return ::hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
numBlocks, (hipFunction_t)func, blockSize, dynSharedMemPerBlk, flags);
|
||||
}
|
||||
#endif // defined(__cplusplus) && !defined(__HCC__) && defined(__clang__) && defined(__HIP__)
|
||||
|
||||
#if USE_PROF_API
|
||||
#include <hip/hcc_detail/hip_prof_str.h>
|
||||
#endif
|
||||
@@ -3375,20 +3389,6 @@ hipError_t hipBindTextureToMipmappedArray(const texture<T, dim, readMode>& tex,
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk) {
|
||||
return hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
int* numBlocks, T f, int blockSize, size_t dynSharedMemPerBlk, unsigned int flags) {
|
||||
return hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
numBlocks, reinterpret_cast<const void*>(f), blockSize, dynSharedMemPerBlk, flags);
|
||||
}
|
||||
|
||||
#if __HIP_VDI__ && !defined(__HCC__)
|
||||
template <class T>
|
||||
inline hipError_t hipLaunchCooperativeKernel(T f, dim3 gridDim, dim3 blockDim,
|
||||
|
||||
@@ -57,6 +57,7 @@ struct __HIP_TEXTURE_ATTRIB texture : public textureReference {
|
||||
texture(int norm = 0, enum hipTextureFilterMode fMode = hipFilterModePoint,
|
||||
enum hipTextureAddressMode aMode = hipAddressModeClamp) {
|
||||
normalized = norm;
|
||||
readMode = hipReadModeNormalizedFloat;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
@@ -68,6 +69,7 @@ struct __HIP_TEXTURE_ATTRIB texture : public textureReference {
|
||||
texture(int norm, enum hipTextureFilterMode fMode, enum hipTextureAddressMode aMode,
|
||||
struct hipChannelFormatDesc desc) {
|
||||
normalized = norm;
|
||||
readMode = hipReadModeNormalizedFloat;
|
||||
filterMode = fMode;
|
||||
addressMode[0] = aMode;
|
||||
addressMode[1] = aMode;
|
||||
|
||||
@@ -34,11 +34,11 @@ THE SOFTWARE.
|
||||
|
||||
#include "hip/hcc_detail/host_defines.h"
|
||||
|
||||
#if !defined(_MSC_VER)|| __clang__
|
||||
#if !defined(_MSC_VER) || __clang__
|
||||
#if __has_attribute(ext_vector_type)
|
||||
#define __NATIVE_VECTOR__(n, ...) __attribute__((ext_vector_type(n)))
|
||||
#define __NATIVE_VECTOR__(n, T) T __attribute__((ext_vector_type(n)))
|
||||
#else
|
||||
#define __NATIVE_VECTOR__(n, ...) [n]
|
||||
#define __NATIVE_VECTOR__(n, T) T[n]
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
@@ -49,16 +49,16 @@ THE SOFTWARE.
|
||||
namespace hip_impl {
|
||||
template<typename, typename, unsigned int> struct Scalar_accessor;
|
||||
} // Namespace hip_impl.
|
||||
|
||||
|
||||
namespace std {
|
||||
template<typename T, typename U, unsigned int n>
|
||||
struct is_integral<hip_impl::Scalar_accessor<T, U, n>>
|
||||
: is_integral<T> {};
|
||||
template<typename T, typename U, unsigned int n>
|
||||
struct is_floating_point<hip_impl::Scalar_accessor<T, U, n>>
|
||||
struct is_floating_point<hip_impl::Scalar_accessor<T, U, n>>
|
||||
: is_floating_point<T> {};
|
||||
} // Namespace std.
|
||||
|
||||
|
||||
namespace hip_impl {
|
||||
template<typename T, typename Vector, unsigned int idx>
|
||||
struct Scalar_accessor {
|
||||
@@ -146,7 +146,7 @@ THE SOFTWARE.
|
||||
|
||||
__host__ __device__
|
||||
Address operator&() const noexcept { return Address{this}; }
|
||||
|
||||
|
||||
__host__ __device__
|
||||
Scalar_accessor& operator=(const Scalar_accessor& x) noexcept {
|
||||
data[idx] = x.data[idx];
|
||||
@@ -284,13 +284,20 @@ THE SOFTWARE.
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
inline
|
||||
constexpr
|
||||
unsigned int next_pot(unsigned int x) {
|
||||
// Precondition: x > 1.
|
||||
return 1u << (32u - __builtin_clz(x - 1u));
|
||||
}
|
||||
} // Namespace hip_impl.
|
||||
|
||||
template<typename T, unsigned int n> struct HIP_vector_base;
|
||||
|
||||
template<typename T>
|
||||
struct HIP_vector_base<T, 1> {
|
||||
using Native_vec_ = T __NATIVE_VECTOR__(1, T);
|
||||
using Native_vec_ = __NATIVE_VECTOR__(1, T);
|
||||
|
||||
union {
|
||||
Native_vec_ data;
|
||||
@@ -304,7 +311,7 @@ THE SOFTWARE.
|
||||
};
|
||||
|
||||
using value_type = T;
|
||||
|
||||
|
||||
__host__ __device__
|
||||
HIP_vector_base& operator=(const HIP_vector_base& x) noexcept {
|
||||
#if __has_attribute(ext_vector_type)
|
||||
@@ -319,9 +326,13 @@ THE SOFTWARE.
|
||||
|
||||
template<typename T>
|
||||
struct HIP_vector_base<T, 2> {
|
||||
using Native_vec_ = T __NATIVE_VECTOR__(2, T);
|
||||
using Native_vec_ = __NATIVE_VECTOR__(2, T);
|
||||
|
||||
union {
|
||||
union
|
||||
#if !__has_attribute(ext_vector_type)
|
||||
alignas(hip_impl::next_pot(2 * sizeof(T)))
|
||||
#endif
|
||||
{
|
||||
Native_vec_ data;
|
||||
#if __HIP_CLANG_ONLY__
|
||||
struct {
|
||||
@@ -335,7 +346,7 @@ THE SOFTWARE.
|
||||
};
|
||||
|
||||
using value_type = T;
|
||||
|
||||
|
||||
__host__ __device__
|
||||
HIP_vector_base& operator=(const HIP_vector_base& x) noexcept {
|
||||
#if __has_attribute(ext_vector_type)
|
||||
@@ -507,9 +518,13 @@ THE SOFTWARE.
|
||||
|
||||
template<typename T>
|
||||
struct HIP_vector_base<T, 4> {
|
||||
using Native_vec_ = T __NATIVE_VECTOR__(4, T);
|
||||
using Native_vec_ = __NATIVE_VECTOR__(4, T);
|
||||
|
||||
union {
|
||||
union
|
||||
#if !__has_attribute(ext_vector_type)
|
||||
alignas(hip_impl::next_pot(4 * sizeof(T)))
|
||||
#endif
|
||||
{
|
||||
Native_vec_ data;
|
||||
#if __HIP_CLANG_ONLY__
|
||||
struct {
|
||||
@@ -527,7 +542,7 @@ THE SOFTWARE.
|
||||
};
|
||||
|
||||
using value_type = T;
|
||||
|
||||
|
||||
__host__ __device__
|
||||
HIP_vector_base& operator=(const HIP_vector_base& x) noexcept {
|
||||
#if __has_attribute(ext_vector_type)
|
||||
|
||||
@@ -157,32 +157,16 @@ union TData {
|
||||
|
||||
#define TEXTURE_RETURN_UINT_XYZW return make_uint4(texel.u.x, texel.u.y, texel.u.z, texel.u.w);
|
||||
|
||||
#define TEXTURE_RETURN_FLOAT return (texFormatToSize[texRef.format] == 1)? texel.f.x : (float)texel.u.x/texFormatToSize[texRef.format];
|
||||
#define TEXTURE_RETURN_FLOAT return texel.f.x;
|
||||
|
||||
#define TEXTURE_RETURN_FLOAT_X return (texFormatToSize[texRef.format] == 1)? make_float1(texel.f.x) : make_float1((float)texel.u.x/texFormatToSize[texRef.format]);
|
||||
#define TEXTURE_RETURN_FLOAT_X return make_float1(texel.f.x);
|
||||
|
||||
#define TEXTURE_RETURN_FLOAT_XY return (texFormatToSize[texRef.format] == 1)? make_float2(texel.f.x, texel.f.y) : make_float2((float)texel.u.x/texFormatToSize[texRef.format], (float)texel.u.y/texFormatToSize[texRef.format]);
|
||||
#define TEXTURE_RETURN_FLOAT_XY return make_float2(texel.f.x, texel.f.y);
|
||||
|
||||
#define TEXTURE_RETURN_FLOAT_XYZW return (texFormatToSize[texRef.format] == 1)? make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w) : make_float4((float)texel.u.x/texFormatToSize[texRef.format], (float)texel.u.y/texFormatToSize[texRef.format], (float)texel.u.z/texFormatToSize[texRef.format], (float)texel.u.w/texFormatToSize[texRef.format]) ;
|
||||
#define TEXTURE_RETURN_FLOAT_XYZW return make_float4(texel.f.x, texel.f.y, texel.f.z, texel.f.w);
|
||||
|
||||
extern "C" {
|
||||
|
||||
// this is really a sparse array with only valid values being the ones indexed by the enum hipArray_Format(e.g. texFormatToSize[HIP_AD_FORMAT_UNSIGNED_INT8] = UCHAR_MAX)
|
||||
__device__ __constant__ static int texFormatToSize[] = {
|
||||
1, /* HIP_AD_FORMAT_NOT_INITIALIZED */
|
||||
UCHAR_MAX, /* HIP_AD_FORMAT_UNSIGNED_INT8 */
|
||||
USHRT_MAX, /* HIP_AD_FORMAT_UNSIGNED_INT16 */
|
||||
1, /* HIP_AD_FORMAT_UNSIGNED_INT32 */
|
||||
1,1,1,1, /* Invalid values */
|
||||
SCHAR_MAX, /* HIP_AD_FORMAT_SIGNED_INT8 */
|
||||
SHRT_MAX, /* HIP_AD_FORMAT_SIGNED_INT16 */
|
||||
1, /* HIP_AD_FORMAT_SIGNED_INT32 */
|
||||
1,1,1,1,1, /* Invalid values */
|
||||
1, /* HIP_AD_FORMAT_HALF */
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* Invalid values */
|
||||
1 /* HIP_AD_FORMAT_FLOAT */
|
||||
};
|
||||
|
||||
__device__
|
||||
__hip_float4_vector_value_type __ockl_image_sample_1D(
|
||||
unsigned int ADDRESS_SPACE_CONSTANT* i, unsigned int ADDRESS_SPACE_CONSTANT* s,
|
||||
|
||||
@@ -73,6 +73,7 @@ enum hipTextureReadMode { hipReadModeElementType = 0, hipReadModeNormalizedFloat
|
||||
*/
|
||||
typedef struct textureReference {
|
||||
int normalized;
|
||||
enum hipTextureReadMode readMode;// used only for driver API's
|
||||
enum hipTextureFilterMode filterMode;
|
||||
enum hipTextureAddressMode addressMode[3]; // Texture address mode for up to 3 dimensions
|
||||
struct hipChannelFormatDesc channelDesc;
|
||||
|
||||
@@ -20,7 +20,6 @@ set_target_properties(hip::hip_hcc_static PROPERTIES
|
||||
else()
|
||||
set_target_properties(hip::hip_hcc_static PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hc_am"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc_static.a"
|
||||
)
|
||||
endif()
|
||||
@@ -37,7 +36,6 @@ set_target_properties(hip::hip_hcc PROPERTIES
|
||||
)
|
||||
else()
|
||||
set_target_properties(hip::hip_hcc PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "hcc::hccrt;hcc::hc_am"
|
||||
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libhip_hcc.so"
|
||||
IMPORTED_SONAME_RELEASE "libhip_hcc.so"
|
||||
)
|
||||
|
||||
@@ -26,6 +26,9 @@ foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::host hip::device)
|
||||
endif()
|
||||
endforeach()
|
||||
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
|
||||
unset(_targetsDefined)
|
||||
unset(_targetsNotDefined)
|
||||
unset(_expectedTargets)
|
||||
set(CMAKE_IMPORT_FILE_VERSION)
|
||||
cmake_policy(POP)
|
||||
return()
|
||||
@@ -47,6 +50,7 @@ endif()
|
||||
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
|
||||
get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH)
|
||||
|
||||
|
||||
# Create imported target hip::hip_hcc_static
|
||||
add_library(hip::hip_hcc_static STATIC IMPORTED)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ This tutorial shows how to get write simple HIP application. We will write the s
|
||||
HIP is a C++ runtime API and kernel language that allows developers to create portable applications that can run on AMD and other GPU’s. Our goal was to rise above the lowest-common-denominator paths and deliver a solution that allows you, the developer, to use essential hardware features and maximize your application’s performance on GPU hardware.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -91,11 +91,11 @@ Use the make command and execute it using ./exe
|
||||
Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [hipify-clang](https://github.com/ROCm-Developer-Tools/HIP/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -15,7 +15,7 @@ For more information:
|
||||
[User Guide for AMDGPU Back-end](llvm.org/docs/AMDGPUUsage.html)
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -50,11 +50,11 @@ Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia
|
||||
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -43,11 +43,11 @@ make
|
||||
```
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [hipify-clang](https://github.com/ROCm-Developer-Tools/HIP/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -86,8 +86,8 @@ void launchKernel(float* C, float* A, float* B, bool manual){
|
||||
printf("kernel Execution time = %6.3fms\n", eventMs);
|
||||
|
||||
//Calculate Occupancy
|
||||
int numBlock = 0;
|
||||
HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, multiply,(int)blockSize, 0));
|
||||
uint32_t numBlock = 0;
|
||||
HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, multiply, blockSize, 0));
|
||||
|
||||
if(devProp.maxThreadsPerMultiProcessor){
|
||||
std::cout << "Theoretical Occupancy is " << (double)numBlock* blockSize/devProp.maxThreadsPerMultiProcessor * 100 << "%" << std::endl;
|
||||
|
||||
@@ -7,7 +7,7 @@ This tutorial is follow-up of the previous one where we learn how to write our f
|
||||
Memory transfer and kernel execution are the most important parameter in parallel computing (specially HPC and machine learning). Memory bottlenecks is the main problem why we are not able to get the highest performance, therefore obtaining the memory transfer timing and kernel execution timing plays key role in application optimization.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -70,11 +70,11 @@ Use the make command and execute it using ./exe
|
||||
Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [hipify-clang](https://github.com/ROCm-Developer-Tools/HIP/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -37,11 +37,11 @@ You can also print the HIP function strings to stderr using HIP_TRACE_API enviro
|
||||
Note this trace mode uses colors. "less -r" can handle raw control characters and will display the debug output in proper colors.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [hipify-clang](https://github.com/ROCm-Developer-Tools/HIP/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -7,7 +7,7 @@ Earlier we learned how to write our first hip program, in which we compute Matri
|
||||
As we mentioned earlier that Memory bottlenecks is the main problem why we are not able to get the highest performance, therefore minimizing the latency for memory access plays prominent role in application optimization. In this tutorial, we'll learn how to use static shared memory and will explain the dynamic one latter.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -32,11 +32,11 @@ Use the make command and execute it using ./exe
|
||||
Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -17,7 +17,7 @@ Let's talk about Warp first. The kernel code is executed in groups of fixed numb
|
||||
```
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -43,11 +43,11 @@ Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia
|
||||
please make sure you have a 3.0 or higher compute capable device in order to use warp shfl operations and add `-gencode arch=compute=30, code=sm_30` nvcc flag in the Makefile while using this application.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -17,7 +17,7 @@ Let's talk about Warp first. The kernel code is executed in groups of fixed numb
|
||||
```
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -45,11 +45,11 @@ Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia
|
||||
please make sure you have a 3.0 or higher compute capable device in order to use warp shfl operations and add `-gencode arch=compute=30, code=sm_30` nvcc flag in the Makefile while using this application.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -7,7 +7,7 @@ Earlier we learned how to use static shared memory. In this tutorial, we'll expl
|
||||
As we mentioned earlier that Memory bottlenecks is the main problem why we are not able to get the highest performance, therefore minimizing the latency for memory access plays prominent role in application optimization. In this tutorial, we'll learn how to use dynamic shared memory.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -39,11 +39,11 @@ Use the make command and execute it using ./exe
|
||||
Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -7,7 +7,7 @@ In all Earlier tutorial we used single stream, In this tutorial, we'll explain h
|
||||
The various instances of kernel to be executed on device in exact launch order defined by Host are called streams. We can launch multiple streams on a single device. We will learn how to learn two streams which can we scaled with ease.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -53,11 +53,11 @@ Use the make command and execute it using ./exe
|
||||
Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -8,7 +8,7 @@ Loop unrolling optimization hints can be specified with #pragma unroll and #prag
|
||||
Specifying #pragma unroll without a parameter directs the loop unroller to attempt to fully unroll the loop if the trip count is known at compile time and attempt to partially unroll the loop if the trip count is not known at compile time.
|
||||
|
||||
## Requirement:
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/INSTALL.md)
|
||||
For hardware requirement and software installation [Installation](https://github.com/ROCm-Developer-Tools/HIP/blob/master/INSTALL.md)
|
||||
|
||||
## prerequiste knowledge:
|
||||
|
||||
@@ -38,11 +38,11 @@ Use hipcc to build the application, which is using hcc on AMD and nvcc on nvidia
|
||||
please make sure you have a 3.0 or higher compute capable device in order to use warp shfl operations and add `-gencode arch=compute=30, code=sm_30` nvcc flag in the Makefile while using this application.
|
||||
|
||||
## More Info:
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP FAQ](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md)
|
||||
- [HIP Kernel Language](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md)
|
||||
- [HIP Runtime API (Doxygen)](http://rocm-developer-tools.github.io/HIP)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [clang-hipify](https://github.com/ROCm-Developer-Tools/HIP/clang-hipify/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/RELEASE.md)
|
||||
- [HIP Porting Guide](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md)
|
||||
- [HIP Terminology](https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
|
||||
- [HIPIFY](https://github.com/ROCm-Developer-Tools/HIP/blob/master/hipify-clang/README.md)
|
||||
- [Developer/CONTRIBUTING Info](https://github.com/ROCm-Developer-Tools/HIP/blob/master/CONTRIBUTING.md)
|
||||
- [Release Notes](https://github.com/ROCm-Developer-Tools/HIP/blob/master/RELEASE.md)
|
||||
|
||||
@@ -189,6 +189,44 @@ hipError_t hipConfigureCall(
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
extern "C" hipError_t __hipPushCallConfiguration(
|
||||
dim3 gridDim,
|
||||
dim3 blockDim,
|
||||
size_t sharedMem,
|
||||
hipStream_t stream)
|
||||
{
|
||||
GET_TLS();
|
||||
auto ctx = ihipGetTlsDefaultCtx();
|
||||
LockedAccessor_CtxCrit_t crit(ctx->criticalData());
|
||||
|
||||
crit->_execStack.push(ihipExec_t{gridDim, blockDim, sharedMem, stream});
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
extern "C" hipError_t __hipPopCallConfiguration(
|
||||
dim3 *gridDim,
|
||||
dim3 *blockDim,
|
||||
size_t *sharedMem,
|
||||
hipStream_t *stream)
|
||||
{
|
||||
GET_TLS();
|
||||
auto ctx = ihipGetTlsDefaultCtx();
|
||||
LockedAccessor_CtxCrit_t crit(ctx->criticalData());
|
||||
|
||||
ihipExec_t exec;
|
||||
exec = std::move(crit->_execStack.top());
|
||||
crit->_execStack.pop();
|
||||
|
||||
*gridDim = exec._gridDim;
|
||||
*blockDim = exec._blockDim;
|
||||
*sharedMem = exec._sharedMem;
|
||||
*stream = exec._hStream;
|
||||
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
hipError_t hipSetupArgument(
|
||||
const void *arg,
|
||||
size_t size,
|
||||
|
||||
+49
-52
@@ -134,10 +134,10 @@ extern hipError_t ihipGetDeviceProperties(hipDeviceProp_t* props, int device);
|
||||
return ihipLogStatus(hipStatus); \
|
||||
}
|
||||
|
||||
hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
uint32_t globalWorkSizeY, uint32_t globalWorkSizeZ,
|
||||
uint32_t localWorkSizeX, uint32_t localWorkSizeY,
|
||||
uint32_t localWorkSizeZ, size_t sharedMemBytes,
|
||||
hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t gridSizeX,
|
||||
uint32_t gridSizeY, uint32_t gridSizeZ,
|
||||
uint32_t blockSizeX, uint32_t blockSizeY,
|
||||
uint32_t blockSizeZ, size_t sharedMemBytes,
|
||||
hipStream_t hStream, void** kernelParams, void** extra,
|
||||
hipEvent_t startEvent, hipEvent_t stopEvent, uint32_t flags, bool isStreamLocked = 0,
|
||||
void** impCoopParams = 0) {
|
||||
@@ -146,6 +146,14 @@ hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t global
|
||||
auto ctx = ihipGetTlsDefaultCtx();
|
||||
hipError_t ret = hipSuccess;
|
||||
|
||||
size_t globalWorkSizeX = (size_t)gridSizeX * (size_t)blockSizeX;
|
||||
size_t globalWorkSizeY = (size_t)gridSizeY * (size_t)blockSizeY;
|
||||
size_t globalWorkSizeZ = (size_t)gridSizeZ * (size_t)blockSizeZ;
|
||||
if(globalWorkSizeX > UINT32_MAX || globalWorkSizeY > UINT32_MAX || globalWorkSizeZ > UINT32_MAX)
|
||||
{
|
||||
return hipErrorInvalidConfiguration;
|
||||
}
|
||||
|
||||
if (ctx == nullptr) {
|
||||
ret = hipErrorInvalidDevice;
|
||||
|
||||
@@ -180,7 +188,8 @@ hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t global
|
||||
return hipErrorNotInitialized;
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
else if (f->_kernarg_layout.size() != 0) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
@@ -202,8 +211,8 @@ hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t global
|
||||
lp.dynamic_group_mem_bytes =
|
||||
sharedMemBytes; // TODO - this should be part of preLaunchKernel.
|
||||
hStream = ihipPreLaunchKernel(
|
||||
hStream, dim3(globalWorkSizeX/localWorkSizeX, globalWorkSizeY/localWorkSizeY, globalWorkSizeZ/localWorkSizeZ),
|
||||
dim3(localWorkSizeX, localWorkSizeY, localWorkSizeZ), &lp, f->_name.c_str(), isStreamLocked);
|
||||
hStream, dim3(globalWorkSizeX/blockSizeX, globalWorkSizeY/blockSizeY, globalWorkSizeZ/blockSizeZ),
|
||||
dim3(blockSizeX, blockSizeY, blockSizeZ), &lp, f->_name.c_str(), isStreamLocked);
|
||||
|
||||
hsa_kernel_dispatch_packet_t aql;
|
||||
|
||||
@@ -212,9 +221,9 @@ hipError_t ihipModuleLaunchKernel(TlsData *tls, hipFunction_t f, uint32_t global
|
||||
// aql.completion_signal._handle = 0;
|
||||
// aql.kernarg_address = 0;
|
||||
|
||||
aql.workgroup_size_x = localWorkSizeX;
|
||||
aql.workgroup_size_y = localWorkSizeY;
|
||||
aql.workgroup_size_z = localWorkSizeZ;
|
||||
aql.workgroup_size_x = blockSizeX;
|
||||
aql.workgroup_size_y = blockSizeY;
|
||||
aql.workgroup_size_z = blockSizeZ;
|
||||
aql.grid_size_x = globalWorkSizeX;
|
||||
aql.grid_size_y = globalWorkSizeY;
|
||||
aql.grid_size_z = globalWorkSizeZ;
|
||||
@@ -275,7 +284,7 @@ hipError_t hipModuleLaunchKernel(hipFunction_t f, uint32_t gridDimX, uint32_t gr
|
||||
HIP_INIT_API(hipModuleLaunchKernel, f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes,
|
||||
hStream, kernelParams, extra);
|
||||
return ihipLogStatus(ihipModuleLaunchKernel(tls,
|
||||
f, blockDimX * gridDimX, blockDimY * gridDimY, gridDimZ * blockDimZ, blockDimX, blockDimY,
|
||||
f, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY,
|
||||
blockDimZ, sharedMemBytes, hStream, kernelParams, extra, nullptr, nullptr, 0));
|
||||
}
|
||||
|
||||
@@ -287,8 +296,12 @@ hipError_t hipExtModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
hipEvent_t startEvent, hipEvent_t stopEvent, uint32_t flags) {
|
||||
HIP_INIT_API(hipExtModuleLaunchKernel, f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX,
|
||||
localWorkSizeY, localWorkSizeZ, sharedMemBytes, hStream, kernelParams, extra);
|
||||
|
||||
if(localWorkSizeX == 0 || localWorkSizeY == 0 || localWorkSizeZ == 0)
|
||||
return hipErrorInvalidValue;
|
||||
|
||||
return ihipLogStatus(ihipModuleLaunchKernel(tls,
|
||||
f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX, localWorkSizeY,
|
||||
f, globalWorkSizeX/localWorkSizeX, globalWorkSizeY/localWorkSizeY, globalWorkSizeZ/localWorkSizeZ, localWorkSizeX, localWorkSizeY,
|
||||
localWorkSizeZ, sharedMemBytes, hStream, kernelParams, extra, startEvent, stopEvent, flags));
|
||||
}
|
||||
|
||||
@@ -300,8 +313,12 @@ hipError_t hipHccModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
|
||||
hipEvent_t startEvent, hipEvent_t stopEvent) {
|
||||
HIP_INIT_API(hipHccModuleLaunchKernel, f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX,
|
||||
localWorkSizeY, localWorkSizeZ, sharedMemBytes, hStream, kernelParams, extra);
|
||||
|
||||
if(localWorkSizeX == 0 || localWorkSizeY == 0 || localWorkSizeZ == 0)
|
||||
return hipErrorInvalidValue;
|
||||
|
||||
return ihipLogStatus(ihipModuleLaunchKernel(tls,
|
||||
f, globalWorkSizeX, globalWorkSizeY, globalWorkSizeZ, localWorkSizeX, localWorkSizeY,
|
||||
f, globalWorkSizeX/localWorkSizeX, globalWorkSizeY/localWorkSizeY, globalWorkSizeZ/localWorkSizeZ, localWorkSizeX, localWorkSizeY,
|
||||
localWorkSizeZ, sharedMemBytes, hStream, kernelParams, extra, startEvent, stopEvent, 0));
|
||||
}
|
||||
|
||||
@@ -352,9 +369,9 @@ hipError_t ihipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList
|
||||
const hipLaunchParams& lp = launchParamsList[i];
|
||||
|
||||
result = ihipModuleLaunchKernel(tls, kds[i],
|
||||
lp.gridDim.x * lp.blockDim.x,
|
||||
lp.gridDim.y * lp.blockDim.y,
|
||||
lp.gridDim.z * lp.blockDim.z,
|
||||
lp.gridDim.x,
|
||||
lp.gridDim.y,
|
||||
lp.gridDim.z,
|
||||
lp.blockDim.x, lp.blockDim.y,
|
||||
lp.blockDim.z, lp.sharedMem,
|
||||
lp.stream, lp.args, nullptr, nullptr, nullptr, 0,
|
||||
@@ -458,9 +475,9 @@ hipError_t ihipLaunchCooperativeKernel(const void* f, dim3 gridDim,
|
||||
|
||||
// launch the main kernel
|
||||
result = ihipModuleLaunchKernel(tls, kd,
|
||||
gridDim.x * blockDimX.x,
|
||||
gridDim.y * blockDimX.y,
|
||||
gridDim.z * blockDimX.z,
|
||||
gridDim.x,
|
||||
gridDim.y,
|
||||
gridDim.z,
|
||||
blockDimX.x, blockDimX.y, blockDimX.z,
|
||||
sharedMemBytes, stream, kernelParams, nullptr, nullptr,
|
||||
nullptr, 0, true, impCoopParams);
|
||||
@@ -612,9 +629,9 @@ hipError_t ihipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsL
|
||||
impCoopParams[0] = &mg_info_ptr[i];
|
||||
|
||||
result = ihipModuleLaunchKernel(tls, kds[i],
|
||||
lp.gridDim.x * lp.blockDim.x,
|
||||
lp.gridDim.y * lp.blockDim.y,
|
||||
lp.gridDim.z * lp.blockDim.z,
|
||||
lp.gridDim.x,
|
||||
lp.gridDim.y,
|
||||
lp.gridDim.z,
|
||||
lp.blockDim.x, lp.blockDim.y,
|
||||
lp.blockDim.z, lp.sharedMem,
|
||||
lp.stream, lp.args, nullptr, nullptr, nullptr, 0,
|
||||
@@ -1368,7 +1385,7 @@ hipError_t hipOccupancyMaxPotentialBlockSize(uint32_t* gridSize, uint32_t* block
|
||||
}
|
||||
|
||||
hipError_t ihipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
TlsData *tls, int* numBlocks, hipFunction_t f, int blockSize, size_t dynSharedMemPerBlk)
|
||||
TlsData *tls, uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk)
|
||||
{
|
||||
using namespace hip_impl;
|
||||
|
||||
@@ -1408,41 +1425,35 @@ hipError_t ihipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
: std::min(maxWavesPerSimd, availableSGPRs / usedSGPRS));
|
||||
|
||||
// Calculate blocks occupancy per CU based on SGPR usage
|
||||
*numBlocks = std::min(*numBlocks, (int) (sgprs_alu_occupancy / numWavefronts));
|
||||
*numBlocks = std::min(*numBlocks, (uint32_t) (sgprs_alu_occupancy / numWavefronts));
|
||||
|
||||
size_t total_used_lds = usedLDS + dynSharedMemPerBlk;
|
||||
if (total_used_lds != 0) {
|
||||
// Calculate LDS occupacy per CU. lds_per_cu / (static_lsd + dynamic_lds)
|
||||
size_t lds_occupancy = prop.maxSharedMemoryPerMultiProcessor / total_used_lds;
|
||||
*numBlocks = std::min(*numBlocks, (int) lds_occupancy);
|
||||
*numBlocks = std::min(*numBlocks, (uint32_t) lds_occupancy);
|
||||
}
|
||||
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk)
|
||||
uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk)
|
||||
{
|
||||
HIP_INIT_API(hipOccupancyMaxActiveBlocksPerMultiprocessor, numBlocks, f, blockSize, dynSharedMemPerBlk);
|
||||
|
||||
auto F = hip_impl::get_program_state().kernel_descriptor((std::uintptr_t)(f),
|
||||
hip_impl::target_agent(0));
|
||||
|
||||
return ihipLogStatus(ihipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
tls, numBlocks, F, blockSize, dynSharedMemPerBlk));
|
||||
tls, numBlocks, f, blockSize, dynSharedMemPerBlk));
|
||||
}
|
||||
|
||||
hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
|
||||
int* numBlocks, const void* f, int blockSize, size_t dynSharedMemPerBlk,
|
||||
uint32_t* numBlocks, hipFunction_t f, uint32_t blockSize, size_t dynSharedMemPerBlk,
|
||||
unsigned int flags)
|
||||
{
|
||||
HIP_INIT_API(hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, numBlocks, f, blockSize, dynSharedMemPerBlk, flags);
|
||||
|
||||
auto F = hip_impl::get_program_state().kernel_descriptor((std::uintptr_t)(f),
|
||||
hip_impl::target_agent(0));
|
||||
|
||||
return ihipLogStatus(ihipOccupancyMaxActiveBlocksPerMultiprocessor(
|
||||
tls, numBlocks, F, blockSize, dynSharedMemPerBlk));
|
||||
tls, numBlocks, f, blockSize, dynSharedMemPerBlk));
|
||||
}
|
||||
|
||||
hipError_t hipLaunchKernel(
|
||||
@@ -1454,21 +1465,7 @@ hipError_t hipLaunchKernel(
|
||||
hipFunction_t kd = hip_impl::get_program_state().kernel_descriptor((std::uintptr_t)func_addr,
|
||||
hip_impl::target_agent(stream));
|
||||
|
||||
if(kd == nullptr || kd->_header == nullptr)
|
||||
return ihipLogStatus(hipErrorInvalidValue);
|
||||
|
||||
size_t szKernArg = kd->_header->kernarg_segment_byte_size;
|
||||
|
||||
if(args == NULL && szKernArg != 0)
|
||||
return ihipLogStatus(hipErrorInvalidValue);
|
||||
|
||||
void* config[]{
|
||||
HIP_LAUNCH_PARAM_BUFFER_POINTER,
|
||||
args,
|
||||
HIP_LAUNCH_PARAM_BUFFER_SIZE,
|
||||
&szKernArg,
|
||||
HIP_LAUNCH_PARAM_END};
|
||||
|
||||
return ihipLogStatus(ihipModuleLaunchKernel(tls, kd, numBlocks.x * dimBlocks.x, numBlocks.y * dimBlocks.y, numBlocks.z * dimBlocks.z,
|
||||
dimBlocks.x, dimBlocks.y, dimBlocks.z, sharedMemBytes, stream, nullptr, (void**)&config, nullptr, nullptr, 0));
|
||||
return hipModuleLaunchKernel(kd, numBlocks.x, numBlocks.y, numBlocks.z,
|
||||
dimBlocks.x, dimBlocks.y, dimBlocks.z, sharedMemBytes,
|
||||
stream, args, nullptr);
|
||||
}
|
||||
|
||||
@@ -29,24 +29,32 @@ void saveTextureInfo(const hipTexture* pTexture, const hipResourceDesc* pResDesc
|
||||
}
|
||||
}
|
||||
|
||||
void getDrvChannelOrderAndType(const enum hipArray_Format Format, unsigned int NumChannels,
|
||||
void getDrvChannelOrderAndType(const enum hipArray_Format Format, enum hipTextureReadMode readMode, unsigned int NumChannels,
|
||||
hsa_ext_image_channel_order_t* channelOrder,
|
||||
hsa_ext_image_channel_type_t* channelType) {
|
||||
switch (Format) {
|
||||
case HIP_AD_FORMAT_UNSIGNED_INT8:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8;
|
||||
*channelType = readMode == hipReadModeNormalizedFloat
|
||||
? HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT8
|
||||
: HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8;
|
||||
break;
|
||||
case HIP_AD_FORMAT_UNSIGNED_INT16:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16;
|
||||
*channelType = readMode == hipReadModeNormalizedFloat
|
||||
? HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT16
|
||||
: HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16;
|
||||
break;
|
||||
case HIP_AD_FORMAT_UNSIGNED_INT32:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32;
|
||||
break;
|
||||
case HIP_AD_FORMAT_SIGNED_INT8:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT8;
|
||||
*channelType = readMode == hipReadModeNormalizedFloat
|
||||
? HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT8
|
||||
: HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT8;
|
||||
break;
|
||||
case HIP_AD_FORMAT_SIGNED_INT16:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT16;
|
||||
*channelType = readMode == hipReadModeNormalizedFloat
|
||||
? HSA_EXT_IMAGE_CHANNEL_TYPE_SNORM_INT16
|
||||
: HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT16;
|
||||
break;
|
||||
case HIP_AD_FORMAT_SIGNED_INT32:
|
||||
*channelType = HSA_EXT_IMAGE_CHANNEL_TYPE_SIGNED_INT32;
|
||||
@@ -422,7 +430,7 @@ hipError_t ihipBindTextureImpl(TlsData *tls_, int dim, enum hipTextureReadMode r
|
||||
hsa_ext_image_channel_order_t channelOrder;
|
||||
hsa_ext_image_channel_type_t channelType;
|
||||
if (NULL == desc) {
|
||||
getDrvChannelOrderAndType(tex->format, tex->numChannels, &channelOrder, &channelType);
|
||||
getDrvChannelOrderAndType(tex->format, readMode, tex->numChannels, &channelOrder, &channelType);
|
||||
} else {
|
||||
getChannelOrderAndType(*desc, readMode, &channelOrder, &channelType);
|
||||
}
|
||||
@@ -497,7 +505,7 @@ hipError_t ihipBindTexture2DImpl(TlsData *tls, int dim, enum hipTextureReadMode
|
||||
hsa_ext_image_channel_type_t channelType;
|
||||
|
||||
if (NULL == desc) {
|
||||
getDrvChannelOrderAndType(tex->format, tex->numChannels, &channelOrder, &channelType);
|
||||
getDrvChannelOrderAndType(tex->format, readMode, tex->numChannels, &channelOrder, &channelType);
|
||||
} else {
|
||||
getChannelOrderAndType(*desc, readMode, &channelOrder, &channelType);
|
||||
}
|
||||
@@ -602,7 +610,7 @@ hipError_t ihipBindTextureToArrayImpl(TlsData *tls_, int dim, enum hipTextureRea
|
||||
hsa_ext_image_channel_order_t channelOrder;
|
||||
hsa_ext_image_channel_type_t channelType;
|
||||
if (array->isDrv) {
|
||||
getDrvChannelOrderAndType(array->Format, array->NumChannels,
|
||||
getDrvChannelOrderAndType(array->Format, readMode, array->NumChannels,
|
||||
&channelOrder, &channelType);
|
||||
} else {
|
||||
getChannelOrderAndType(desc, readMode, &channelOrder, &channelType);
|
||||
@@ -724,7 +732,10 @@ hipError_t hipTexRefSetFormat(textureReference* tex, hipArray_Format fmt, int Nu
|
||||
hipError_t hipTexRefSetFlags(textureReference* tex, unsigned int flags) {
|
||||
HIP_INIT_API(hipTexRefSetFlags, tex, flags);
|
||||
hipError_t hip_status = hipSuccess;
|
||||
tex->normalized = flags;
|
||||
if(flags == HIP_TRSF_READ_AS_INTEGER)
|
||||
tex->readMode = hipReadModeElementType;
|
||||
else if(flags == HIP_TRSF_NORMALIZED_COORDINATES)
|
||||
tex->normalized = flags;
|
||||
return ihipLogStatus(hip_status);
|
||||
}
|
||||
|
||||
@@ -757,7 +768,7 @@ hipError_t hipTexRefSetArray(textureReference* tex, hipArray_const_t array, unsi
|
||||
HIP_INIT_API(hipTexRefSetArray, tex, array, flags);
|
||||
hipError_t hip_status = hipSuccess;
|
||||
|
||||
hip_status = ihipBindTextureToArrayImpl(tls, array->textureType, hipReadModeElementType, array,
|
||||
hip_status = ihipBindTextureToArrayImpl(tls, array->textureType, tex->readMode, array,
|
||||
array->desc, tex);
|
||||
return ihipLogStatus(hip_status);
|
||||
}
|
||||
@@ -785,7 +796,7 @@ hipError_t hipTexRefSetAddress(size_t* offset, textureReference* tex, hipDevicep
|
||||
HIP_INIT_API(hipTexRefSetAddress, offset, tex, devPtr, size);
|
||||
hipError_t hip_status = hipSuccess;
|
||||
// TODO: hipReadModeElementType is default.
|
||||
hip_status = ihipBindTextureImpl(tls, hipTextureType1D, hipReadModeElementType, offset, devPtr, NULL,
|
||||
hip_status = ihipBindTextureImpl(tls, hipTextureType1D, tex->readMode, offset, devPtr, NULL,
|
||||
size, tex);
|
||||
return ihipLogStatus(hip_status);
|
||||
}
|
||||
@@ -816,7 +827,7 @@ hipError_t hipTexRefSetAddress2D(textureReference* tex, const HIP_ARRAY_DESCRIPT
|
||||
//TODO: Fix when HSA accepts user defined pitch
|
||||
if(pitch % 64) pitch =0;
|
||||
|
||||
hip_status = ihipBindTexture2DImpl(tls, hipTextureType2D, hipReadModeElementType, &offset, devPtr,
|
||||
hip_status = ihipBindTexture2DImpl(tls, hipTextureType2D, tex->readMode, &offset, devPtr,
|
||||
NULL, desc->Width, desc->Height, tex, pitch);
|
||||
return ihipLogStatus(hip_status);
|
||||
}
|
||||
|
||||
@@ -613,7 +613,8 @@ public:
|
||||
for (auto&& kernel_symbol : it->second) {
|
||||
functions[aa].second.emplace(
|
||||
function.first,
|
||||
Kernel_descriptor{kernel_object(kernel_symbol), it->first});
|
||||
Kernel_descriptor{kernel_object(kernel_symbol), it->first,
|
||||
kernargs_size_align(function.first)});
|
||||
}
|
||||
}
|
||||
}, agent);
|
||||
@@ -672,11 +673,12 @@ public:
|
||||
auto dx1 = kernels_md.find("CodeProps", dx);
|
||||
dx = kernels_md.find("Args:", dx);
|
||||
|
||||
if (dx1 < dx) {
|
||||
if (dx1 < dx || dx == std::string::npos) {
|
||||
dx = dx1;
|
||||
// create an empty kernarg laybout vector for kernels without any arg
|
||||
kernargs[fn];
|
||||
continue;
|
||||
}
|
||||
if (dx == std::string::npos) break;
|
||||
|
||||
static constexpr decltype(kernels_md.size()) args_sz{5};
|
||||
dx = parse_args_v2(kernels_md, dx + args_sz, dx1, kernargs[fn]);
|
||||
|
||||
@@ -47,7 +47,7 @@ In the above, BUILD commands provide instructions on how to build the test case
|
||||
|
||||
The supported syntax for the BUILD command is:
|
||||
```
|
||||
BUILD: %t %s HIPCC_OPTIONS <hipcc_specific_options> HCC_OPTIONS <hcc_specific_options> NVCC_OPTIONS <nvcc_specific_options> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> DEPENDS <dependencies>
|
||||
BUILD: %t %s HIPCC_OPTIONS <hipcc_specific_options> HCC_OPTIONS <hcc_specific_options> NVCC_OPTIONS <nvcc_specific_options> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> EXCLUDE_HIP_RUNTIME <HCC|VDI> EXCLUDE_HIP_COMPILER <hcc|clang> DEPENDS <dependencies>
|
||||
```
|
||||
%s: refers to current source file name. Additional source files needed for the test can be specified by name (including relative path).
|
||||
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
|
||||
@@ -55,6 +55,9 @@ HIPCC_OPTIONS: All options specified after this delimiter are passed to hipcc on
|
||||
HCC_OPTIONS: All options specified after this delimiter are passed to hipcc on HCC platform only.
|
||||
NVCC_OPTIONS: All options specified after this delimiter are passed to hipcc on NVCC platform only.
|
||||
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or both platforms.
|
||||
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from HCC or VDI runtime.
|
||||
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
|
||||
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test case from particular runtime and compiler.
|
||||
DEPENDS: This can be used to specify dependencies that need to be built before building the current target.
|
||||
|
||||
|
||||
@@ -62,7 +65,7 @@ DEPENDS: This can be used to specify dependencies that need to be built before b
|
||||
|
||||
The supported syntax for the BUILD_CMD command is:
|
||||
```
|
||||
BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> DEPENDS <dependencies>
|
||||
BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> EXCLUDE_HIP_RUNTIME <HCC|VDI> EXCLUDE_HIP_COMPILER <hcc|clang> DEPENDS <dependencies>
|
||||
```
|
||||
%s: refers to current source file name. Additional source files needed for the test can be specified by name (including relative path).
|
||||
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
|
||||
@@ -73,6 +76,9 @@ BUILD_CMD: <targetname> <build_command> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> DEPE
|
||||
%S: refers to path to current source file.
|
||||
%T: refers to path to current build target.
|
||||
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or both platforms.
|
||||
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from HCC or VDI runtime.
|
||||
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
|
||||
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test from particular runtime and compiler.
|
||||
DEPENDS: This can be used to specify dependencies that need to be built before building the current target.
|
||||
|
||||
|
||||
@@ -80,17 +86,20 @@ DEPENDS: This can be used to specify dependencies that need to be built before b
|
||||
|
||||
The supported syntax for the TEST command is:
|
||||
```
|
||||
TEST: %t <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all>
|
||||
TEST: %t <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> EXCLUDE_HIP_RUNTIME <HCC|VDI> EXCLUDE_HIP_COMPILER <hcc|clang>
|
||||
```
|
||||
%t: refers to target executable named derived by removing the extension from the current source file. Alternatively a target executable name can be specified.
|
||||
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or both platforms. Note that if the test has been excluded for a specific platform in the BUILD command, it is automatically excluded from the TEST command as well for the same platform.
|
||||
|
||||
EXCLUDE_HIP_PLATFORM: This can be used to exclude a test case from HCC, NVCC or both platforms.
|
||||
EXCLUDE_HIP_RUNTIME: This can be used to exclude a test case from HCC or VDI runtime.
|
||||
EXCLUDE_HIP_COMPILER: This can be used to exclude a test case from hcc or clang compiler.
|
||||
EXCLUDE_HIP_RUNTIME AND EXCLUDE_HIP_COMPILER: when both options are specified it excludes test from particular runtime and compiler.
|
||||
Note that if the test has been excluded for a specific platform/runtime/compiler in the BUILD command, it is automatically excluded from the TEST command as well for the sameplatform.
|
||||
|
||||
#### TEST_NAMED command
|
||||
|
||||
When using the TEST command, HIT will squash and append the arguments specified to the test executable name to generate the CMAKE test name. Sometimes we might want to specify a more descriptive name. The TEST_NAMED command is used for that. The supported syntax for the TEST_NAMED command is:
|
||||
```
|
||||
TEST: %t CMAKE_TEST_NAME <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all>
|
||||
TEST: %t CMAKE_TEST_NAME <arguments_to_test_executable> EXCLUDE_HIP_PLATFORM <hcc|nvcc|all> EXCLUDE_HIP_RUNTIME <HCC|VDI> EXCLUDE_HIP_COMPILER <hcc|clang>
|
||||
```
|
||||
|
||||
|
||||
|
||||
+126
-16
@@ -3,7 +3,7 @@ find_package(HIP REQUIRED)
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Helper macro to parse BUILD instructions
|
||||
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_options _link_options _exclude_platforms _depends _dir)
|
||||
macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _depends _dir)
|
||||
set(${_target})
|
||||
set(${_sources})
|
||||
set(${_hipcc_options})
|
||||
@@ -11,6 +11,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(${_nvcc_options})
|
||||
set(${_link_options})
|
||||
set(${_exclude_platforms})
|
||||
set(${_exclude_runtime})
|
||||
set(${_exclude_compiler})
|
||||
set(${_depends})
|
||||
set(_target_found FALSE)
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -18,6 +20,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
foreach(arg ${ARGN})
|
||||
if(NOT _target_found)
|
||||
@@ -29,6 +33,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xHCC_OPTIONS")
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -36,6 +42,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xNVCC_OPTIONS")
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -43,6 +51,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found TRUE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xLINK_OPTIONS")
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -50,6 +60,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found TRUE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -57,6 +69,26 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found TRUE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
|
||||
set(_hipcc_options_found FALSE)
|
||||
set(_hcc_options_found FALSE)
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found TRUE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
|
||||
set(_hipcc_options_found FALSE)
|
||||
set(_hcc_options_found FALSE)
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found TRUE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xDEPENDS")
|
||||
set(_hipcc_options_found FALSE)
|
||||
@@ -64,6 +96,8 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
set(_nvcc_options_found FALSE)
|
||||
set(_link_options_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found TRUE)
|
||||
else()
|
||||
if(_hipcc_options_found)
|
||||
@@ -76,6 +110,10 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
list(APPEND ${_link_options} ${arg})
|
||||
elseif(_exclude_platforms_found)
|
||||
set(${_exclude_platforms} ${arg})
|
||||
elseif(_exclude_runtime_found)
|
||||
set(${_exclude_runtime} ${arg})
|
||||
elseif(_exclude_compiler_found)
|
||||
set(${_exclude_compiler} ${arg})
|
||||
elseif(_depends_found)
|
||||
list(APPEND ${_depends} ${arg})
|
||||
else()
|
||||
@@ -86,13 +124,15 @@ macro(PARSE_BUILD_COMMAND _target _sources _hipcc_options _hcc_options _nvcc_opt
|
||||
endmacro()
|
||||
|
||||
# Helper macro to parse CUSTOM BUILD instructions
|
||||
macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _depends)
|
||||
macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends)
|
||||
set(${_target})
|
||||
set(${_buildcmd} " ")
|
||||
set(${_exclude_platforms})
|
||||
set(${_depends})
|
||||
set(_target_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
foreach(arg ${ARGN})
|
||||
if(NOT _target_found)
|
||||
@@ -100,13 +140,31 @@ macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _depends)
|
||||
set(${_target} ${arg})
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
|
||||
set(_exclude_platforms_found TRUE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found TRUE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found TRUE)
|
||||
set(_depends_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xDEPENDS")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
set(_depends_found TRUE)
|
||||
else()
|
||||
if(_exclude_platforms_found)
|
||||
set(${_exclude_platforms} ${arg})
|
||||
elseif(_exclude_runtime_found)
|
||||
set(${_exclude_runtime} ${arg})
|
||||
elseif(_exclude_compiler_found)
|
||||
set(${_exclude_compiler} ${arg})
|
||||
elseif(_depends_found)
|
||||
list(APPEND ${_depends} ${arg})
|
||||
else()
|
||||
@@ -117,21 +175,39 @@ macro(PARSE_CUSTOMBUILD_COMMAND _target _buildcmd _exclude_platforms _depends)
|
||||
endmacro()
|
||||
|
||||
# Helper macro to parse TEST instructions
|
||||
macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms)
|
||||
macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms _exclude_runtime _exclude_compiler)
|
||||
set(${_target})
|
||||
set(${_arguments} " ")
|
||||
set(${_exclude_platforms})
|
||||
set(${_exclude_runtime})
|
||||
set(${_exclude_compiler})
|
||||
set(_target_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
foreach(arg ${ARGN})
|
||||
if(NOT _target_found)
|
||||
set(_target_found TRUE)
|
||||
set(${_target} ${arg})
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
|
||||
set(_exclude_platforms_found TRUE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found TRUE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found TRUE)
|
||||
else()
|
||||
if(_exclude_platforms_found)
|
||||
set(${_exclude_platforms} ${arg})
|
||||
elseif(_exclude_runtime_found)
|
||||
set(${_exclude_runtime} ${arg})
|
||||
elseif(_exclude_compiler_found)
|
||||
set(${_exclude_compiler} ${arg})
|
||||
else()
|
||||
list(APPEND ${_arguments} ${arg})
|
||||
endif()
|
||||
@@ -140,13 +216,15 @@ macro(PARSE_TEST_COMMAND _target _arguments _exclude_platforms)
|
||||
endmacro()
|
||||
|
||||
# Helper macro to parse TEST_NAMED instructions
|
||||
macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms)
|
||||
macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler)
|
||||
set(${_target})
|
||||
set(${_arguments} " ")
|
||||
set(${_exclude_platforms})
|
||||
set(_target_found FALSE)
|
||||
set(_testname_found FALSE)
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
foreach(arg ${ARGN})
|
||||
if(NOT _target_found)
|
||||
set(_target_found TRUE)
|
||||
@@ -156,9 +234,23 @@ macro(PARSE_TEST_NAMED_COMMAND _target _testname _arguments _exclude_platforms)
|
||||
set(${_testname} ${arg})
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_PLATFORM")
|
||||
set(_exclude_platforms_found TRUE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_RUNTIME")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found TRUE)
|
||||
set(_exclude_compiler_found FALSE)
|
||||
elseif("x${arg}" STREQUAL "xEXCLUDE_HIP_COMPILER")
|
||||
set(_exclude_platforms_found FALSE)
|
||||
set(_exclude_runtime_found FALSE)
|
||||
set(_exclude_compiler_found TRUE)
|
||||
else()
|
||||
if(_exclude_platforms_found)
|
||||
set(${_exclude_platforms} ${arg})
|
||||
elseif(_exclude_runtime_found)
|
||||
set(${_exclude_runtime} ${arg})
|
||||
elseif(_exclude_compiler_found)
|
||||
set(${_exclude_compiler} ${arg})
|
||||
else()
|
||||
list(APPEND ${_arguments} ${arg})
|
||||
endif()
|
||||
@@ -203,10 +295,16 @@ macro(HIT_ADD_FILES _dir _label _parent)
|
||||
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
|
||||
foreach(_cmd ${_contents})
|
||||
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
|
||||
parse_build_command(_target _sources _hipcc_options _hcc_options _nvcc_options _link_options _exclude_platforms _depends ${_dir} ${_cmd})
|
||||
parse_build_command(_target _sources _hipcc_options _hcc_options _nvcc_options _link_options _exclude_platforms _exclude_runtime _exclude_compiler _depends ${_dir} ${_cmd})
|
||||
string(REGEX REPLACE "/" "." target ${_label}/${_target})
|
||||
insert_into_map("_exclude" "${target}" "${_exclude_platforms}")
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(NOT _exclude_runtime AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(NOT _exclude_compiler AND _exclude_runtime STREQUAL ${HIP_RUNTIME})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
else()
|
||||
set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
|
||||
hip_reset_flags()
|
||||
@@ -236,10 +334,16 @@ macro(HIT_ADD_FILES _dir _label _parent)
|
||||
string(REGEX REPLACE "%T" ${_label} _contents "${_contents}")
|
||||
foreach(_cmd ${_contents})
|
||||
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
|
||||
parse_custombuild_command(_target _buildcmd _exclude_platforms _depends ${_cmd})
|
||||
parse_custombuild_command(_target _buildcmd _exclude_platforms _exclude_runtime _exclude_compiler _depends ${_cmd})
|
||||
string(REGEX REPLACE "/" "." target ${_label}/${_target})
|
||||
insert_into_map("_exclude" "${target}" "${_exclude_platforms}")
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(NOT _exclude_runtime AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(NOT _exclude_compiler AND _exclude_runtime STREQUAL ${HIP_RUNTIME})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
insert_into_map("_exclude" "${target}" TRUE)
|
||||
else()
|
||||
string(REGEX REPLACE ";" " " _buildcmd "${_buildcmd}")
|
||||
#string(CONCAT buildscript ${CMAKE_CURRENT_BINARY_DIR}/${target} ".sh")
|
||||
@@ -263,11 +367,14 @@ macro(HIT_ADD_FILES _dir _label _parent)
|
||||
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
|
||||
foreach(_cmd ${_contents})
|
||||
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
|
||||
parse_test_command(_target _arguments _exclude_platforms ${_cmd})
|
||||
parse_test_command(_target _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd})
|
||||
string(REGEX REPLACE "/" "." target ${_label}/${_target})
|
||||
read_from_map("_exclude" "${target}" _exclude_platforms_from_build)
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM} OR
|
||||
_exclude_platforms_from_build STREQUAL "all" OR _exclude_platforms_from_build STREQUAL ${HIP_PLATFORM})
|
||||
read_from_map("_exclude" "${target}" _exclude_test_from_build)
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM})
|
||||
elseif(NOT _exclude_runtime AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
elseif(NOT _exclude_compiler AND _exclude_runtime STREQUAL ${HIP_RUNTIME})
|
||||
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
elseif(_exclude_test_from_build STREQUAL TRUE)
|
||||
else()
|
||||
make_test(${_label}/${_target} ${_arguments})
|
||||
endif()
|
||||
@@ -282,11 +389,14 @@ macro(HIT_ADD_FILES _dir _label _parent)
|
||||
string(REGEX REPLACE "\n" ";" _contents "${_contents}")
|
||||
foreach(_cmd ${_contents})
|
||||
string(REGEX REPLACE " " ";" _cmd "${_cmd}")
|
||||
parse_test_named_command(_target _testname _arguments _exclude_platforms ${_cmd})
|
||||
parse_test_named_command(_target _testname _arguments _exclude_platforms _exclude_runtime _exclude_compiler ${_cmd})
|
||||
string(REGEX REPLACE "/" "." target ${_label}/${_target})
|
||||
read_from_map("_exclude" "${target}" _exclude_platforms_from_build)
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM} OR
|
||||
_exclude_platforms_from_build STREQUAL "all" OR _exclude_platforms_from_build STREQUAL ${HIP_PLATFORM})
|
||||
read_from_map("_exclude" "${target}" _exclude_test_from_build)
|
||||
if(_exclude_platforms STREQUAL "all" OR _exclude_platforms STREQUAL ${HIP_PLATFORM})
|
||||
elseif(NOT _exclude_runtime AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
elseif(NOT _exclude_compiler AND _exclude_runtime STREQUAL ${HIP_RUNTIME})
|
||||
elseif(_exclude_runtime STREQUAL ${HIP_RUNTIME} AND _exclude_compiler STREQUAL ${HIP_COMPILER})
|
||||
elseif(_exclude_test_from_build STREQUAL TRUE)
|
||||
else()
|
||||
make_named_test(${_label}/${_target} ${_label}/${_testname}.tst ${_arguments})
|
||||
endif()
|
||||
|
||||
@@ -36,7 +36,7 @@ bool LaunchKernelArg()
|
||||
dim3 blocks = {1,1,1};
|
||||
dim3 threads = {1,1,1};
|
||||
|
||||
HIPCHECK(hipLaunchKernel(kernel, blocks, threads,NULL, 0, 0));
|
||||
HIPCHECK(hipLaunchKernel(kernel, blocks, threads, NULL, 0, 0));
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -50,9 +50,9 @@ bool LaunchKernelArg1()
|
||||
|
||||
// Allocate Device memory
|
||||
HIPCHECK(hipMalloc((void**)&A_d, sizeof(int)));
|
||||
|
||||
void* Args[]={A_d};
|
||||
HIPCHECK(hipLaunchKernel(kernel1, blocks, threads, Args,0,0));
|
||||
|
||||
void* Args[]={&A_d};
|
||||
HIPCHECK(hipLaunchKernel(kernel1, blocks, threads, Args, 0, 0));
|
||||
|
||||
// Get the result back to host memory
|
||||
HIPCHECK(hipMemcpy(&A, A_d, sizeof(int), hipMemcpyDeviceToHost));
|
||||
@@ -60,7 +60,7 @@ bool LaunchKernelArg1()
|
||||
HIPCHECK(hipFree(A_d));
|
||||
|
||||
if(A != 333)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -81,9 +81,9 @@ bool LaunchKernelArg2()
|
||||
HIPCHECK(hipMalloc((void**)&B_d, sizeof(int)));
|
||||
|
||||
// Copy data from host memory to device memory
|
||||
HIPCHECK(hipMemcpy(B_d,&B, sizeof(int), hipMemcpyHostToDevice));
|
||||
HIPCHECK(hipMemcpy(B_d, &B, sizeof(int), hipMemcpyHostToDevice));
|
||||
|
||||
void* Args[]={A_d,B_d};
|
||||
void* Args[]={&A_d, &B_d};
|
||||
HIPCHECK(hipLaunchKernel(kernel2, blocks, threads, Args,0,0));
|
||||
|
||||
// Get the result back to host memory
|
||||
@@ -118,11 +118,11 @@ bool LaunchKernelArg3()
|
||||
HIPCHECK(hipMalloc((void**)&C_d, sizeof(int)));
|
||||
|
||||
// Copy data from host memory to device memory
|
||||
HIPCHECK(hipMemcpy(A_d,&A, sizeof(int), hipMemcpyHostToDevice));
|
||||
HIPCHECK(hipMemcpy(A_d, &A, sizeof(int), hipMemcpyHostToDevice));
|
||||
|
||||
HIPCHECK(hipMemcpy(B_d,&B, sizeof(int), hipMemcpyHostToDevice));
|
||||
HIPCHECK(hipMemcpy(B_d, &B, sizeof(int), hipMemcpyHostToDevice));
|
||||
|
||||
void* Args[]={A_d,B_d,C_d};
|
||||
void* Args[]={&A_d, &B_d, &C_d};
|
||||
HIPCHECK(hipLaunchKernel(kernel3, blocks, threads, Args,0,0));
|
||||
|
||||
// Get the result back to host memory
|
||||
@@ -138,14 +138,43 @@ bool LaunchKernelArg3()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LaunchKernelArg4()
|
||||
{
|
||||
int A = 0;
|
||||
int *A_d = NULL;
|
||||
dim3 blocks = {1,1,1};
|
||||
dim3 threads = {1,1,1};
|
||||
|
||||
// Allocate Device memory
|
||||
HIPCHECK(hipMalloc((void**)&A_d, sizeof(int)));
|
||||
|
||||
char c = 1;
|
||||
short s = 10;
|
||||
int i = 100;
|
||||
struct things t = {2,20,200};
|
||||
|
||||
void* Args[]={&A_d, &c, &s, &i, &t};
|
||||
HIPCHECK(hipLaunchKernel(kernel4, blocks, threads, Args, 0, 0));
|
||||
|
||||
// Get the result back to host memory
|
||||
HIPCHECK(hipMemcpy(&A, A_d, sizeof(int), hipMemcpyDeviceToHost));
|
||||
|
||||
HIPCHECK(hipFree(A_d));
|
||||
|
||||
if (A != (c + s + i + t.c + t.s + t.i))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
if( LaunchKernelArg() &&
|
||||
LaunchKernelArg1() &&
|
||||
LaunchKernelArg2() &&
|
||||
LaunchKernelArg3())
|
||||
LaunchKernelArg3() &&
|
||||
LaunchKernelArg4())
|
||||
{
|
||||
printf("PASSED!\n");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,23 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
extern __global__ void kernel();
|
||||
extern __global__ void kernel1(int*);
|
||||
extern __global__ void kernel2(int*,int*);
|
||||
extern __global__ void kernel3(int*,int*,int*);
|
||||
|
||||
struct things {
|
||||
char c;
|
||||
short s;
|
||||
int i;
|
||||
};
|
||||
extern __global__ void kernel4(int*, char, short, int, struct things);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
|
||||
#include<hip/hip_runtime.h>
|
||||
#include "LaunchKernel.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@@ -43,4 +44,9 @@ __global__ void kernel3(int *a, int*b, int* c)
|
||||
*c = *a+*b;
|
||||
}
|
||||
|
||||
__global__ void kernel4(int *a, char c, short s, int i, struct things t)
|
||||
{
|
||||
*a = c + s + i + t.c + t.s + t.i;
|
||||
}
|
||||
|
||||
}//extern "C"
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
Copyright (c) 2019 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.
|
||||
*/
|
||||
|
||||
// Simple test for hipLaunchCooperativeKernelMultiDevice API.
|
||||
|
||||
/* HIT_START
|
||||
* BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM all
|
||||
* TEST: %t
|
||||
* HIT_END
|
||||
*/
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include "hip/hip_runtime_api.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <chrono>
|
||||
#include "hip/hip_cooperative_groups.h"
|
||||
#include "test_common.h"
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
const static uint NumOfLoopIterrations = 16 * 1024;
|
||||
const static uint BufferSizeInDwords = 28672 * NumOfLoopIterrations;
|
||||
const static uint numQueues = 4;
|
||||
const static uint numIter = 100;
|
||||
constexpr uint NumKernelArgs = 4;
|
||||
constexpr uint MaxGPUs = 8;
|
||||
|
||||
#include <stdio.h>
|
||||
/*
|
||||
namespace cg = cooperative_groups;
|
||||
using namespace cooperative_groups;
|
||||
*/
|
||||
|
||||
__global__ void test_gws(uint* buf, uint bufSize, long* tmpBuf, long* result)
|
||||
{
|
||||
extern __shared__ long tmp[];
|
||||
uint groups = gridDim.x;
|
||||
uint group_id = blockIdx.x;
|
||||
uint local_id = threadIdx.x;
|
||||
uint chunk = gridDim.x * blockDim.x;
|
||||
|
||||
uint i = group_id * blockDim.x + local_id;
|
||||
long sum = 0;
|
||||
while (i < bufSize) {
|
||||
sum += buf[i];
|
||||
i += chunk;
|
||||
}
|
||||
tmp[local_id] = sum;
|
||||
__syncthreads();
|
||||
i = 0;
|
||||
if (local_id == 0) {
|
||||
sum = 0;
|
||||
while (i < blockDim.x) {
|
||||
sum += tmp[i];
|
||||
i++;
|
||||
}
|
||||
tmpBuf[group_id] = sum;
|
||||
}
|
||||
|
||||
// wait
|
||||
cooperative_groups::this_grid().sync();
|
||||
|
||||
if (((blockIdx.x * blockDim.x) + threadIdx.x) == 0) {
|
||||
for (uint i = 1; i < groups; ++i) {
|
||||
sum += tmpBuf[i];
|
||||
}
|
||||
//*result = sum;
|
||||
result[1 + cooperative_groups::this_multi_grid().grid_rank()] = sum;
|
||||
}
|
||||
cooperative_groups::this_multi_grid().sync();
|
||||
if (cooperative_groups::this_multi_grid().grid_rank() == 0) {
|
||||
sum = 0;
|
||||
for (uint i = 1; i <= cooperative_groups::this_multi_grid().num_grids(); ++i) {
|
||||
sum += result[i];
|
||||
}
|
||||
*result = sum;
|
||||
}
|
||||
}
|
||||
|
||||
int main() {
|
||||
float *A, *B;
|
||||
uint* dA[MaxGPUs];
|
||||
long* dB[MaxGPUs];
|
||||
long* dC;
|
||||
hipModule_t Module;
|
||||
hipStream_t stream[MaxGPUs];
|
||||
|
||||
uint32_t* init = new uint32_t[BufferSizeInDwords];
|
||||
for (uint32_t i = 0; i < BufferSizeInDwords; ++i) {
|
||||
init[i] = i;
|
||||
}
|
||||
|
||||
int nGpu = 0;
|
||||
HIPCHECK(hipGetDeviceCount(&nGpu));
|
||||
size_t copySizeInDwords = BufferSizeInDwords / nGpu;
|
||||
hipDeviceProp_t deviceProp[MaxGPUs];
|
||||
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
HIPCHECK(hipSetDevice(i));
|
||||
|
||||
// Calculate the device occupancy to know how many blocks can be run concurrently
|
||||
hipGetDeviceProperties(&deviceProp[i], 0);
|
||||
if (!deviceProp[i].cooperativeMultiDeviceLaunch) {
|
||||
printf("Device doesn't support cooperative launch!");
|
||||
passed();
|
||||
return 0;
|
||||
}
|
||||
size_t SIZE = copySizeInDwords * sizeof(uint);
|
||||
|
||||
HIPCHECK(hipMalloc((void**)&dA[i], SIZE));
|
||||
if (i == 0) {
|
||||
HIPCHECK(hipHostMalloc((void**)&dC, (nGpu + 1) * sizeof(long), hipHostMallocCoherent));
|
||||
}
|
||||
HIPCHECK(hipMemcpy(dA[i], &init[i * copySizeInDwords] , SIZE, hipMemcpyHostToDevice));
|
||||
HIPCHECK(hipStreamCreate(&stream[i]));
|
||||
}
|
||||
|
||||
dim3 dimBlock;
|
||||
dim3 dimGrid;
|
||||
dimGrid.x = 1;
|
||||
dimGrid.y = 1;
|
||||
dimGrid.z = 1;
|
||||
dimBlock.x = 64;
|
||||
dimBlock.y = 1;
|
||||
dimBlock.z = 1;
|
||||
|
||||
int numBlocks = 0;
|
||||
uint workgroups[3] = {64, 128, 256};
|
||||
|
||||
hipLaunchParams* launchParamsList = new hipLaunchParams[nGpu];
|
||||
|
||||
system_clock::time_point start = system_clock::now();
|
||||
|
||||
for (uint set = 0; set < 3; ++set) {
|
||||
void* args[MaxGPUs * NumKernelArgs];
|
||||
std::cout << "---------- Test#" << set << "---------------\n";
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
HIPCHECK(hipSetDevice(i));
|
||||
dimBlock.x = workgroups[set];
|
||||
HIPCHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(reinterpret_cast<uint32_t*>(&numBlocks),
|
||||
(hipFunction_t)test_gws, dimBlock.x * dimBlock.y * dimBlock.z, dimBlock.x * sizeof(long)));
|
||||
|
||||
std::cout << "GPU(" << i << ") Block size: " << dimBlock.x << " Num blocks per CU: " << numBlocks << "\n";
|
||||
|
||||
dimGrid.x = deviceProp[i].multiProcessorCount * std::min(numBlocks, 32);
|
||||
HIPCHECK(hipMalloc((void**)&dB[i], dimGrid.x * sizeof(long)));
|
||||
|
||||
args[i * NumKernelArgs] = (void*)&dA[i];
|
||||
args[i * NumKernelArgs + 1] = (void*)©SizeInDwords;
|
||||
args[i * NumKernelArgs + 2] = (void*)&dB[i];
|
||||
args[i * NumKernelArgs + 3] = (void*)&dC;
|
||||
|
||||
launchParamsList[i].func = reinterpret_cast<void*>(test_gws);
|
||||
launchParamsList[i].gridDim = dimGrid;
|
||||
launchParamsList[i].blockDim = dimBlock;
|
||||
launchParamsList[i].sharedMem = dimBlock.x * sizeof(long);
|
||||
launchParamsList[i].stream = stream[i];
|
||||
launchParamsList[i].args = &args[i * NumKernelArgs];
|
||||
}
|
||||
|
||||
hipLaunchCooperativeKernelMultiDevice(launchParamsList, nGpu, 0);
|
||||
|
||||
HIPCHECK(hipMemcpy(init, dC, sizeof(long), hipMemcpyDeviceToHost));
|
||||
|
||||
if (*dC != (((long)(BufferSizeInDwords) * (BufferSizeInDwords - 1)) / 2)) {
|
||||
std::cout << "Data validation failed for grid size = " << dimGrid.x << " and block size = " << dimBlock.x << "\n";
|
||||
std::cout << "Test failed! \n";
|
||||
}
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
hipFree(dB[i]);
|
||||
}
|
||||
}
|
||||
system_clock::time_point end = system_clock::now();
|
||||
|
||||
delete [] launchParamsList;
|
||||
|
||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
||||
|
||||
std::time_t end_time = std::chrono::system_clock::to_time_t(end);
|
||||
|
||||
std::cout << "finished computation at " << std::ctime(&end_time) <<
|
||||
"elapsed time: " << elapsed_seconds.count() << "s\n";
|
||||
|
||||
hipSetDevice(0);
|
||||
hipFree(dC);
|
||||
for (int i = 0; i < nGpu; i++) {
|
||||
hipFree(dA[i]);
|
||||
HIPCHECK(hipStreamDestroy(stream[i]));
|
||||
}
|
||||
delete [] init;
|
||||
passed();
|
||||
return 0;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ int main() {
|
||||
|
||||
dimBlock.x = workgroups[i];
|
||||
// Calculate the device occupancy to know how many blocks can be run concurrently
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks,
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor(reinterpret_cast<uint32_t*>(&numBlocks),
|
||||
test_gws, dimBlock.x * dimBlock.y * dimBlock.z, dimBlock.x * sizeof(long));
|
||||
|
||||
dimGrid.x = deviceProp.multiProcessorCount * std::min(numBlocks, 32);
|
||||
|
||||
+18
-3
@@ -30,6 +30,10 @@ THE SOFTWARE.
|
||||
#include "hip/hip_runtime.h"
|
||||
#include "test_common.h"
|
||||
|
||||
#define fileName "vcpy_kernel.code"
|
||||
#define kernel_name "hello_world"
|
||||
|
||||
|
||||
__global__ void f1(float *a) { *a = 1.0; }
|
||||
|
||||
template <typename T>
|
||||
@@ -45,10 +49,11 @@ int main(int argc, char* argv[]) {
|
||||
hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f1, 0, 0);
|
||||
assert(gridSize != 0 && blockSize != 0);
|
||||
|
||||
int numBlock = 0;
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, (int)blockSize, 0);
|
||||
uint32_t numBlock = 0;
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, blockSize, 0);
|
||||
assert(numBlock != 0);
|
||||
|
||||
|
||||
// test case for using kernel function pointer with template
|
||||
gridSize = 0;
|
||||
blockSize = 0;
|
||||
@@ -56,7 +61,17 @@ int main(int argc, char* argv[]) {
|
||||
assert(gridSize != 0 && blockSize != 0);
|
||||
|
||||
numBlock = 0;
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor<void(*)(int *)>(&numBlock, f2, (int)blockSize, 0);
|
||||
hipOccupancyMaxActiveBlocksPerMultiprocessor<void(*)(int *)>(&numBlock, f2, blockSize, 0);
|
||||
assert(numBlock != 0);
|
||||
|
||||
|
||||
// test case for using kernel with hipFunction_t type
|
||||
numBlock = 0;
|
||||
hipModule_t Module;
|
||||
hipFunction_t Function;
|
||||
HIPCHECK(hipModuleLoad(&Module, fileName));
|
||||
HIPCHECK(hipModuleGetFunction(&Function, Module, kernel_name));
|
||||
HIPCHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, Function, blockSize, 0));
|
||||
assert(numBlock != 0);
|
||||
|
||||
passed();
|
||||
+1
@@ -33,6 +33,7 @@ THE SOFTWARE.
|
||||
#define fileName "vcpy_kernel.code"
|
||||
#define kernel_name "hello_world"
|
||||
|
||||
|
||||
__global__ void f1(float *a) { *a = 1.0; }
|
||||
|
||||
template <typename T>
|
||||
@@ -27,8 +27,24 @@ THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
#define SIZE 10
|
||||
|
||||
static float getNormalizedValue(const float value,
|
||||
const enum hipArray_Format texFormat) {
|
||||
switch (texFormat) {
|
||||
case HIP_AD_FORMAT_SIGNED_INT8:
|
||||
return (value / SCHAR_MAX);
|
||||
case HIP_AD_FORMAT_UNSIGNED_INT8:
|
||||
return (value / UCHAR_MAX);
|
||||
case HIP_AD_FORMAT_SIGNED_INT16:
|
||||
return (value / SHRT_MAX);
|
||||
case HIP_AD_FORMAT_UNSIGNED_INT16:
|
||||
return (value / USHRT_MAX);
|
||||
default:
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
texture<float, hipTextureType1D, hipReadModeElementType> textureNormalizedVal_1D;
|
||||
|
||||
__global__ void normalizedValTextureTest(unsigned int numElements, float* pDst)
|
||||
@@ -47,7 +63,6 @@ bool textureTest(enum hipArray_Format texFormat)
|
||||
T *dData = NULL;
|
||||
HIPCHECK(hipMalloc((void **) &dData, sizeof(T)*SIZE));
|
||||
HIPCHECK(hipMemcpyHtoD((hipDeviceptr_t)dData, hData, sizeof(T)*SIZE));
|
||||
|
||||
textureReference* texRef = &textureNormalizedVal_1D;
|
||||
HIPCHECK(hipTexRefSetAddressMode(texRef, 0, hipAddressModeClamp));
|
||||
HIPCHECK(hipTexRefSetAddressMode(texRef, 1, hipAddressModeClamp));
|
||||
@@ -73,7 +88,8 @@ bool textureTest(enum hipArray_Format texFormat)
|
||||
|
||||
for(int i = 0; i < SIZE; i++)
|
||||
{
|
||||
if((float)hData[i]/texFormatToSize[texFormat] != hOutputData[i])
|
||||
float expected = getNormalizedValue(float(hData[i]), texFormat);
|
||||
if(expected != hOutputData[i])
|
||||
{
|
||||
printf("mismatch at index:%d for texType:%d output:%f\n",i,texFormat,hOutputData[i]);
|
||||
testResult = false;
|
||||
|
||||
@@ -76,8 +76,7 @@ void texture2Dtest()
|
||||
texDescr.readMode = hipReadModeElementType;
|
||||
|
||||
hipTextureObject_t texObj;
|
||||
hipResourceViewDesc resDesc;
|
||||
HIPCHECK( hipCreateTextureObject(&texObj, &texRes, &texDescr, &resDesc));
|
||||
HIPCHECK( hipCreateTextureObject(&texObj, &texRes, &texDescr, NULL));
|
||||
|
||||
HIPCHECK(hipMalloc((void**)&devPtrB, SIZE_W*sizeof(TYPE_t)*SIZE_H)) ;
|
||||
|
||||
|
||||
@@ -1,503 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
This file is part of GtkSourceView
|
||||
|
||||
Author: Aditya Atluri <aditya.atluri@amd.com>
|
||||
|
||||
GtkSourceView is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
GtkSourceView is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (c) 2015 - present 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.
|
||||
|
||||
-->
|
||||
<language id="hip" _name="HIP" version="2.0" _section="Sources">
|
||||
|
||||
Referencia en una nueva incidencia
Block a user