From 1e6eb6672c0ce787f3cf88c39508ea1b3cd59ca6 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Tue, 21 Jun 2016 11:11:20 -0500 Subject: [PATCH 1/7] added device functions to docs Change-Id: I11ad1af86274620782986e227888b2d5f0544d8f [ROCm/clr commit: d2c1fb6f13de93fbceff3213e514a7af691bcfc9] --- .../docs/markdown/hip_kernel_language.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/projects/clr/hipamd/docs/markdown/hip_kernel_language.md b/projects/clr/hipamd/docs/markdown/hip_kernel_language.md index e382ede4b3..23cde7fee6 100644 --- a/projects/clr/hipamd/docs/markdown/hip_kernel_language.md +++ b/projects/clr/hipamd/docs/markdown/hip_kernel_language.md @@ -299,6 +299,42 @@ Following is the list of supported single precision mathematical functions. | float tanhf ( float x )
Calculate the hyperbolic tangent of the input argument. | ✓ | ✓ | | float truncf ( float x )
Truncate input argument to the integral part. | ✓ | ✓ | | float tgammaf ( float x )
Calculate the gamma function of the input argument. | ✓ | ✓ | +| float erfcinvf ( float y )
Calculate the inverse complementary function of the input argument. | ✓ | ✓ | +| float erfcxf ( float x )
Calculate the scaled complementary error function of the input argument. | ✓ | ✓ | +| float erfinvf ( float y )
Calculate the inverse error function of the input argument. | ✓ | ✓ | +| float fdividef ( float x, float y )
Divide two floating point values. | ✓ | ✓ | +| float frexpf ( float x, int *nptr )
Extract mantissa and exponent of a floating-point value. | ✓ | ✓ | +| float j0f ( float x )
Calculate the value of the Bessel function of the first kind of order 0 for the input argument. | ✓ | ✓ | +| float j1f ( float x )
Calculate the value of the Bessel function of the first kind of order 1 for the input argument. | ✓ | ✓ | +| float jnf ( int n, float x )
Calculate the value of the Bessel function of the first kind of order n for the input argument. | ✓ | ✓ | +| float lgammaf ( float x )
Calculate the natural logarithm of the absolute value of the gamma function of the input argument. | ✓ | ✓ | +| long long int llrintf ( float x )
Round input to nearest integer value. | ✓ | ✓ | +| long long int llroundf ( float x )
Round to nearest integer value. | ✓ | ✓ | +| long int lrintf ( float x )
Round input to nearest integer value. | ✓ | ✓ | +| long int lroundf ( float x )
Round to nearest integer value. | ✓ | ✓ | +| float modff ( float x, float *iptr )
Break down the input argument into fractional and integral parts. | ✓ | ✓ | +| float nextafterf ( float x, float y )
Returns next representable single-precision floating-point value after argument. | ✓ | ✓ | +| float norm3df ( float a, float b, float c )
Calculate the square root of the sum of squares of three coordinates of the argument. | ✓ | ✓ | +| float norm4df ( float a, float b, float c, float d )
Calculate the square root of the sum of squares of four coordinates of the argument. | ✓ | ✓ | +| float normcdff ( float y )
Calculate the standard normal cumulative distribution function. | ✓ | ✓ | +| float normcdfinvf ( float y )
Calculate the inverse of the standard normal cumulative distribution function. | ✓ | ✓ | +| float normf ( int dim, const float *a )
Calculate the square root of the sum of squares of any number of coordinates. | ✓ | ✓ | +| float rcbrtf ( float x )
Calculate the reciprocal cube root function. | ✓ | ✓ | +| float remquof ( float x, float y, int *quo )
Compute single-precision floating-point remainder and part of quotient. | ✓ | ✓ | +| float rhypotf ( float x, float y )
Calculate one over the square root of the sum of squares of two arguments. | ✓ | ✓ | +| float rintf ( float x )
Round input to nearest integer value in floating-point. | ✓ | ✓ | +| float rnorm3df ( float a, float b, float c )
Calculate one over the square root of the sum of squares of three coordinates of the argument. | ✓ | ✓ | +| float rnorm4df ( float a, float b, float c, float d )
Calculate one over the square root of the sum of squares of four coordinates of the argument. | ✓ | ✓ | +| float rnormf ( int dim, const float *a )
Calculate the reciprocal of square root of the sum of squares of any number of coordinates. | ✓ | ✓ | +| float scalblnf ( float x, long int n )
Scale floating-point input by integer power of two. | ✓ | ✓ | +| void sincosf ( float x, float *sptr, float *cptr )
Calculate the sine and cosine of the first input argument. | ✓ | ✓ | +| void sincospif ( float x, float *sptr, float *cptr )
Calculate the sine and cosine of the first input argument multiplied by PI. | ✓ | ✓ | +| float y0f ( float x )
Calculate the value of the Bessel function of the second kind of order 0 for the input argument. | ✓ | ✓ | +| float y1f ( float x )
Calculate the value of the Bessel function of the second kind of order 1 for the input argument. | ✓ | ✓ | +| float ynf ( int n, float x )
Calculate the value of the Bessel function of the second kind of order n for the input argument. | ✓ | ✓ | + + + [1] __RETURN_TYPE is dependent on compiler. It is usually 'int' for C compilers and 'bool' for C++ compilers. [↩](#a1) ### Double Precision Mathematical Functions @@ -360,6 +396,40 @@ Following is the list of supported double precision mathematical functions. | double tanh ( double x )
Calculate the hyperbolic tangent of the input argument. | ✓ | ✓ | | double tgamma ( double x )
Calculate the gamma function of the input argument. | ✓ | ✓ | | double trunc ( double x )
Truncate input argument to the integral part. | ✓ | ✓ | +| double erfcinv ( double y )
Calculate the inverse complementary function of the input argument. | ✓ | ✓ | +| double erfcx ( double x )
Calculate the scaled complementary error function of the input argument. | ✓ | ✓ | +| double erfinv ( double y )
Calculate the inverse error function of the input argument. | ✓ | ✓ | +| double frexp ( float x, int *nptr )
Extract mantissa and exponent of a floating-point value. | ✓ | ✓ | +| double j0 ( double x )
Calculate the value of the Bessel function of the first kind of order 0 for the input argument. | ✓ | ✓ | +| double j1 ( double x )
Calculate the value of the Bessel function of the first kind of order 1 for the input argument. | ✓ | ✓ | +| double jn ( int n, double x )
Calculate the value of the Bessel function of the first kind of order n for the input argument. | ✓ | ✓ | +| double lgamma ( double x )
Calculate the natural logarithm of the absolute value of the gamma function of the input argument. | ✓ | ✓ | +| long long int llrint ( double x )
Round input to nearest integer value. | ✓ | ✓ | +| long long int llround ( double x )
Round to nearest integer value. | ✓ | ✓ | +| long int lrint ( double x )
Round input to nearest integer value. | ✓ | ✓ | +| long int lround ( double x )
Round to nearest integer value. | ✓ | ✓ | +| double modf ( double x, double *iptr )
Break down the input argument into fractional and integral parts. | ✓ | ✓ | +| double nextafter ( double x, double y )
Returns next representable single-precision floating-point value after argument. | ✓ | ✓ | +| double norm3d ( double a, double b, double c )
Calculate the square root of the sum of squares of three coordinates of the argument. | ✓ | ✓ | +| float norm4d ( double a, double b, double c, double d )
Calculate the square root of the sum of squares of four coordinates of the argument. | ✓ | ✓ | +| double normcdf ( double y )
Calculate the standard normal cumulative distribution function. | ✓ | ✓ | +| double normcdfinv ( double y )
Calculate the inverse of the standard normal cumulative distribution function. | ✓ | ✓ | +| double rcbrt ( double x )
Calculate the reciprocal cube root function. | ✓ | ✓ | +| double remquo ( double x, double y, int *quo )
Compute single-precision floating-point remainder and part of quotient. | ✓ | ✓ | +| double rhypot ( double x, double y )
Calculate one over the square root of the sum of squares of two arguments. | ✓ | ✓ | +| double rint ( double x )
Round input to nearest integer value in floating-point. | ✓ | ✓ | +| double rnorm3d ( double a, double b, double c )
Calculate one over the square root of the sum of squares of three coordinates of the argument. | ✓ | ✓ | +| double rnorm4d ( double a, double b, double c, double d )
Calculate one over the square root of the sum of squares of four coordinates of the argument. | ✓ | ✓ | +| double rnorm ( int dim, const double *a )
Calculate the reciprocal of square root of the sum of squares of any number of coordinates. | ✓ | ✓ | +| double scalbln ( double x, long int n )
Scale floating-point input by integer power of two. | ✓ | ✓ | +| void sincos ( double x, double *sptr, double *cptr )
Calculate the sine and cosine of the first input argument. | ✓ | ✓ | +| void sincospi ( double x, double *sptr, double *cptr )
Calculate the sine and cosine of the first input argument multiplied by PI. | ✓ | ✓ | +| double y0f ( double x )
Calculate the value of the Bessel function of the second kind of order 0 for the input argument. | ✓ | ✓ | +| double y1 ( double x )
Calculate the value of the Bessel function of the second kind of order 1 for the input argument. | ✓ | ✓ | +| double yn ( int n, double x )
Calculate the value of the Bessel function of the second kind of order n for the input argument. | ✓ | ✓ | + + + [1] __RETURN_TYPE is dependent on compiler. It is usually 'int' for C compilers and 'bool' for C++ compilers. [↩](#a2) ### Integer Intrinsics From 4ae1b48c6616dde38fbf566c0e734991ffb62f23 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Thu, 23 Jun 2016 22:22:58 +0530 Subject: [PATCH 2/7] Included code to calculate value of maxThreadsPerMultiprocessor property Change-Id: Ie7cad7442f36a7163e715048de5a309febc28664 [ROCm/clr commit: dc5ca031436657fa2520b204c642b41ebbb4ade1] --- projects/clr/hipamd/CMakeLists.txt | 4 ++-- projects/clr/hipamd/bin/hipcc | 2 +- projects/clr/hipamd/src/hip_hcc.cpp | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/clr/hipamd/CMakeLists.txt b/projects/clr/hipamd/CMakeLists.txt index 7007ceb2bd..5508c902ae 100644 --- a/projects/clr/hipamd/CMakeLists.txt +++ b/projects/clr/hipamd/CMakeLists.txt @@ -114,8 +114,8 @@ if(HIP_PLATFORM STREQUAL "hcc") set(CMAKE_C_COMPILER "${HCC_HOME}/bin/hcc") # Set HIP_HCC so we know this is HIP compile, some files are shared with HCC (staging_buffer). - set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC") - set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC") + set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include/libhsakmt -stdlib=libc++ -DHIP_HCC") + set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include/libhsakmt -stdlib=libc++ -DHIP_HCC") set(SOURCE_FILES src/device_util.cpp src/hip_hcc.cpp diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index f642aaf46e..9c7e23d0e7 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -81,7 +81,7 @@ if ($HIP_PLATFORM eq "hcc") { $HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0"; # Satisfy HCC dependencies $HIPLDFLAGS .= " -lc++abi"; - $HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am"; + $HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am -lhsakmt"; # Add trace marker library: # TODO - once we cleanly separate the HIP API headers from HIP library headers this logic should move to CMakebuild option - apps do not need to see the marker library. diff --git a/projects/clr/hipamd/src/hip_hcc.cpp b/projects/clr/hipamd/src/hip_hcc.cpp index b24eed918a..4af29352e4 100644 --- a/projects/clr/hipamd/src/hip_hcc.cpp +++ b/projects/clr/hipamd/src/hip_hcc.cpp @@ -42,6 +42,7 @@ THE SOFTWARE. #include "hip_runtime.h" #include "hcc_detail/hip_hcc.h" #include "hsa_ext_amd.h" +#include "hsakmt.h" // TODO, re-org header order. extern const char *ihipErrorString(hipError_t hip_error); @@ -720,17 +721,18 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop) prop->computeMode = 0; // Get Max Threads Per Multiprocessor -/* + HsaSystemProperties props; hsaKmtReleaseSystemProperties(); if(HSAKMT_STATUS_SUCCESS == hsaKmtAcquireSystemProperties(&props)) { HsaNodeProperties node_prop = {0}; if(HSAKMT_STATUS_SUCCESS == hsaKmtGetNodeProperties(node, &node_prop)) { uint32_t waves_per_cu = node_prop.MaxWavesPerSIMD; - prop-> maxThreadsPerMultiProcessor = prop->warpsize*waves_per_cu; + uint32_t simd_per_cu = node_prop.NumSIMDPerCU; + prop-> maxThreadsPerMultiProcessor = prop->warpSize*waves_per_cu*simd_per_cu; } } -*/ + // Get memory properties err = hsa_agent_iterate_regions(_hsa_agent, get_region_info, prop); From 8ddf1af7854c92c495a21860f6f6aef16afd4a91 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 24 Jun 2016 21:10:37 +0530 Subject: [PATCH 3/7] hip_samples package now contains uncompressed samples Change-Id: I69e773ebeff59733e016abd5a90bd1637798b1f5 [ROCm/clr commit: 058cdf2a8c44f86ec0831ebe5a86c657ae434b68] --- projects/clr/hipamd/packaging/hip_samples.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/clr/hipamd/packaging/hip_samples.txt b/projects/clr/hipamd/packaging/hip_samples.txt index 6adf9160bf..f289f2a8e5 100644 --- a/projects/clr/hipamd/packaging/hip_samples.txt +++ b/projects/clr/hipamd/packaging/hip_samples.txt @@ -1,17 +1,13 @@ cmake_minimum_required(VERSION 2.8.3) project(hip_samples) -add_custom_target(create_installer_script ALL - COMMAND tar cvzf ${PROJECT_BINARY_DIR}/samples.tgz --exclude='*.o' . - COMMAND @hip_SOURCE_DIR@/packaging/create_hip_samples_installer.sh ${PROJECT_BINARY_DIR}/samples.tgz ${PROJECT_BINARY_DIR}/unpack_hip_samples.sh - WORKING_DIRECTORY @hip_SOURCE_DIR@/samples) -install(PROGRAMS unpack_hip_samples.sh DESTINATION bin) +install(DIRECTORY @hip_SOURCE_DIR@/samples DESTINATION .) ############################# # Packaging steps ############################# set(CPACK_SET_DESTDIR TRUE) -set(CPACK_INSTALL_PREFIX "/opt/rocm") +set(CPACK_INSTALL_PREFIX "/opt/rocm/hip") set(CPACK_PACKAGE_NAME "hip_samples") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "HIP: Heterogenous-computing Interface for Portability [SAMPLES]") set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc.") From 138148a788920bb1b1ca48988c7fe40e2a576d46 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 29 Jun 2016 20:49:40 +0530 Subject: [PATCH 4/7] Update markdown documentation Change-Id: I92cf4411d601e5bbd62ce6c3346cdac0ea2945a8 [ROCm/clr commit: 41384610809b7ca56a18a116b58470f6445258e4] --- projects/clr/hipamd/docs/markdown/hip_faq.md | 32 ++++++------- .../docs/markdown/hip_kernel_language.md | 1 + .../hipamd/docs/markdown/hip_porting_guide.md | 46 +++++++++++++++++++ .../clr/hipamd/docs/markdown/hip_terms.md | 8 ++++ .../clr/hipamd/docs/markdown/hip_terms2.md | 8 ++++ 5 files changed, 78 insertions(+), 17 deletions(-) diff --git a/projects/clr/hipamd/docs/markdown/hip_faq.md b/projects/clr/hipamd/docs/markdown/hip_faq.md index f1d8c607ea..5e722383df 100644 --- a/projects/clr/hipamd/docs/markdown/hip_faq.md +++ b/projects/clr/hipamd/docs/markdown/hip_faq.md @@ -4,23 +4,21 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [FAQ](#faq) -- [Table of Contents](#table-of-contents) - - [What APIs does HIP support?](#what-apis-does-hip-support) - - [What is not supported?](#what-is-not-supported) - - [Run-time features:](#run-time-features) - - [How does HIP compare with OpenCL?](#how-does-hip-compare-with-opencl) - - [What hardware does HIP support?](#what-hardware-does-hip-support) - - [Does Hipify automatically convert all source code?](#does-hipify-automatically-convert-all-source-code) - - [What is NVCC?](#what-is-nvcc) - - [What is HCC?](#what-is-hcc) - - [Why use HIP rather than supporting CUDA directly?](#why-use-hip-rather-than-supporting-cuda-directly) - - [Can I develop HIP code on an Nvidia CUDA platform?](#can-i-develop-hip-code-on-an-nvidia-cuda-platform) - - [Can I develop HIP code on an AMD HCC platform?](#can-i-develop-hip-code-on-an-amd-hcc-platform) - - [Can a HIP binary run on both AMD and Nvidia platforms?](#can-a-hip-binary-run-on-both-amd-and-nvidia-platforms) - - [Hmmm](#hmmm) - - [Link2 Is it ready?](#link2-is-it-ready) - - [What's the difference between HIP and hc?](#whats-the-difference-between-hip-and-hc) +- [What APIs does HIP support ?](#what-apis-does-hip-support-) +- [What is not supported?](#what-is-not-supported) + - [Run-time features](#run-time-features) + - [Kernel language features](#kernel-language-features) +- [How does HIP compare with OpenCL?](#how-does-hip-compare-with-opencl) +- [What hardware does HIP support?](#what-hardware-does-hip-support) +- [Does Hipify automatically convert all source code?](#does-hipify-automatically-convert-all-source-code) +- [What is NVCC?](#what-is-nvcc) +- [What is HCC?](#what-is-hcc) +- [Why use HIP rather than supporting CUDA directly?](#why-use-hip-rather-than-supporting-cuda-directly) +- [Can I develop HIP code on an Nvidia CUDA platform?](#can-i-develop-hip-code-on-an-nvidia-cuda-platform) +- [Can I develop HIP code on an AMD HCC platform?](#can-i-develop-hip-code-on-an-amd-hcc-platform) +- [Can a HIP binary run on both AMD and Nvidia platforms?](#can-a-hip-binary-run-on-both-amd-and-nvidia-platforms) +- [What's the difference between HIP and hc?](#whats-the-difference-between-hip-and-hc) +- [HIP detected my platform (hcc vs nvcc) incorrectly - what should I do?](#hip-detected-my-platform-hcc-vs-nvcc-incorrectly---what-should-i-do) ================= diff --git a/projects/clr/hipamd/docs/markdown/hip_kernel_language.md b/projects/clr/hipamd/docs/markdown/hip_kernel_language.md index 23cde7fee6..9ac1a48a25 100644 --- a/projects/clr/hipamd/docs/markdown/hip_kernel_language.md +++ b/projects/clr/hipamd/docs/markdown/hip_kernel_language.md @@ -26,6 +26,7 @@ - [Single Precision Mathematical Functions](#single-precision-mathematical-functions) - [Double Precision Mathematical Functions](#double-precision-mathematical-functions) - [Integer Intrinsics](#integer-intrinsics) + - [Floating-point Intrinsics](#floating-point-intrinsics) - [Texture Functions](#texture-functions) - [Surface Functions](#surface-functions) - [Timer Functions](#timer-functions) diff --git a/projects/clr/hipamd/docs/markdown/hip_porting_guide.md b/projects/clr/hipamd/docs/markdown/hip_porting_guide.md index de5c590e12..5fcec1ae8e 100644 --- a/projects/clr/hipamd/docs/markdown/hip_porting_guide.md +++ b/projects/clr/hipamd/docs/markdown/hip_porting_guide.md @@ -1,3 +1,49 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [HIP Porting Guide](#hip-porting-guide) +- [###Table of Contents](#table-of-contents) + - [Porting a New Cuda Project](#porting-a-new-cuda-project) + - [General Tips](#general-tips) + - [Scanning existing CUDA code to scope the porting effort](#scanning-existing-cuda-code-to-scope-the-porting-effort) + - [Converting a project "in-place"](#converting-a-project-in-place) + - [Distinguishing Compiler Modes](#distinguishing-compiler-modes) + - [Identifying HIP Target Platform](#identifying-hip-target-platform) + - [Identifying the Compiler: hcc or nvcc](#identifying-the-compiler-hcc-or-nvcc) + - [Identifying Current Compilation Pass: Host or Device](#identifying-current-compilation-pass-host-or-device) + - [Compiler Defines: Summary](#compiler-defines-summary) + - [Identifying Architecture Features](#identifying-architecture-features) + - [HIP_ARCH Defines](#hip_arch-defines) + - [Device-Architecture Properties](#device-architecture-properties) + - [Table of Architecture Properties](#table-of-architecture-properties) + - [Finding HIP](#finding-hip) + - [Compiler Options](#compiler-options) + - [Linking Issues](#linking-issues) + - [Linking With hipcc](#linking-with-hipcc) + - [-lm Option](#-lm-option) + - [Linking Code With Other Compilers](#linking-code-with-other-compilers) + - [libc++ and libstdc++](#libc-and-libstdc) + - [HIP Headers (hip_runtime.h, hip_runtime_api.h)](#hip-headers-hip_runtimeh-hip_runtime_apih) + - [Using a Standard C++ Compiler](#using-a-standard-c-compiler) + - [cuda.h](#cudah) + - [Choosing HIP File Extensions](#choosing-hip-file-extensions) + - [Workarounds](#workarounds) + - [warpSize](#warpsize) + - [Textures and Cache Control](#textures-and-cache-control) + - [More Tips](#more-tips) + - [hcc CPU Mode](#hcc-cpu-mode) + - [HIPTRACE Mode](#hiptrace-mode) + - [Environment Variables](#environment-variables) + - [Debugging hipcc](#debugging-hipcc) + - [What Does This Error Mean?](#what-does-this-error-mean) + - [/usr/include/c++/v1/memory:5172:15: error: call to implicitly deleted default constructor of 'std::__1::bad_weak_ptr' throw bad_weak_ptr();](#usrincludecv1memory517215-error-call-to-implicitly-deleted-default-constructor-of-std__1bad_weak_ptr-throw-bad_weak_ptr) + - [grid_launch kernel dispatch - fallback](#grid_launch-kernel-dispatch---fallback) + - [HIP Environment Variables](#hip-environment-variables) + - [Editor Highlighting](#editor-highlighting) + + + # HIP Porting Guide In addition to providing a portable C++ programmming environement for GPUs, HIP is designed to ease the porting of existing CUDA code into the HIP environment. This section describes the available tools diff --git a/projects/clr/hipamd/docs/markdown/hip_terms.md b/projects/clr/hipamd/docs/markdown/hip_terms.md index 4ab04f459a..c1a40e0573 100644 --- a/projects/clr/hipamd/docs/markdown/hip_terms.md +++ b/projects/clr/hipamd/docs/markdown/hip_terms.md @@ -1,3 +1,11 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [Table Comparing Syntax for Different Compute APIs](#table-comparing-syntax-for-different-compute-apis) + + + # Table Comparing Syntax for Different Compute APIs |Term|CUDA|HIP|HC|C++AMP|OpenCL| diff --git a/projects/clr/hipamd/docs/markdown/hip_terms2.md b/projects/clr/hipamd/docs/markdown/hip_terms2.md index 53097d0e88..6807338b8d 100644 --- a/projects/clr/hipamd/docs/markdown/hip_terms2.md +++ b/projects/clr/hipamd/docs/markdown/hip_terms2.md @@ -1,3 +1,11 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [Terms used in HIP Documentation](#terms-used-in-hip-documentation) + + + # Terms used in HIP Documentation From c9b2c560c28ea3bf09ec3a341a8554b344f941a5 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Wed, 29 Jun 2016 20:50:14 +0530 Subject: [PATCH 5/7] Update release notes Change-Id: I6ae7e5c44b1f7d084abb7cedd353276b81531f82 [ROCm/clr commit: 88ca6f7312600b91621d706aa47faeb3eefd452a] --- projects/clr/hipamd/RELEASE.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/projects/clr/hipamd/RELEASE.md b/projects/clr/hipamd/RELEASE.md index c5eb2d0db6..dfec3285ae 100644 --- a/projects/clr/hipamd/RELEASE.md +++ b/projects/clr/hipamd/RELEASE.md @@ -9,16 +9,18 @@ Stay tuned - the work for many of these features is already in-flight. =================================================================================================== Release:0.90.00 -Date: 2016.06.xx --Support dynamic shared memory allocations --Min HCC compiler version is > 16186. --Expanded math functions (device and host). Document unsupported functions. --Initial support for hipBlas headers. --hipFree with null pointer initializes runtime and returns success. --Improve error code reporting on nvcc. --add hipPeekAtError for nvcc.. +Date: 2016.06.29 +- Support dynamic shared memory allocations +- Min HCC compiler version is > 16186. +- Expanded math functions (device and host). Document unsupported functions. +- hipFree with null pointer initializes runtime and returns success. +- Improve error code reporting on nvcc. +- Add hipPeekAtError for nvcc. + =================================================================================================== +## Revision History: + =================================================================================================== Release:0.86.00 Date: 2016.06.06 @@ -30,9 +32,6 @@ Date: 2016.06.06 compilation path. - More samples including gpu-burn, SHOC, nbody, rtm. See [HIP-Examples](https://github.com/GPUOpen-ProfessionalCompute-Tools/HIP-Examples) -=================================================================================================== - -## Revision History: =================================================================================================== Release:0.84.01 From ad1f67604cd5424921454367162dd1119c8f6a9d Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 15 Jul 2016 10:08:27 +0530 Subject: [PATCH 6/7] Add specifying ROCm target support to HIP Change-Id: I42930d8ccf0dafe408ce5bebe2d95f99e544ee8d [ROCm/clr commit: 1be2dbb15015e2aa3546bcb96cf8e28c75ea37ca] --- projects/clr/hipamd/bin/hipcc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 33041d240f..92ac35e049 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -60,6 +60,9 @@ if ($HIP_PLATFORM eq "hcc") { $ROCM_PATH=$ENV{'ROCM_PATH'}; $ROCM_PATH="/opt/rocm" unless defined $ROCM_PATH; + $ROCM_TARGET=$ENV{'ROCM_TARGET'}; + $ROCM_TARGET="fiji" unless defined $ROCM_TARGET; + # HCC* may be used to compile src/hip_hcc.o (and also feed the HIPCXXFLAGS below) $HCC = "$HCC_HOME/bin/hcc"; $HCCFLAGS = "-hc -I$HCC_HOME/include "; @@ -78,6 +81,14 @@ if ($HIP_PLATFORM eq "hcc") { $HIPLDFLAGS .= " -lc++abi"; $HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am -lhsakmt"; + # Handle ROCm target platform + if ($ROCM_TARGET eq "fiji") { + $HIPLDFLAGS .= " -amdgpu-target=AMD:AMDGPU:8:0:3"; + } + if ($ROCM_TARGET eq "hawaii") { + $HIPLDFLAGS .= " -amdgpu-target=AMD:AMDGPU:7:0:1"; + } + # Add trace marker library: # TODO - once we cleanly separate the HIP API headers from HIP library headers this logic should move to CMakebuild option - apps do not need to see the marker library. $marker_inc_path = "$marker_path/include"; From 87003ac6c502bf9ee88aa898a783905932a82c56 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Fri, 15 Jul 2016 10:40:56 +0530 Subject: [PATCH 7/7] Handle linker warning correctly Change-Id: Ifca5886e31b4551603944c2b90a8e532442e889f [ROCm/clr commit: 0eb4f5e1085b1df7f0f3a4a2caecac019ced9de6] --- projects/clr/hipamd/bin/hipcc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/bin/hipcc b/projects/clr/hipamd/bin/hipcc index 92ac35e049..7c894af53e 100755 --- a/projects/clr/hipamd/bin/hipcc +++ b/projects/clr/hipamd/bin/hipcc @@ -75,7 +75,13 @@ if ($HIP_PLATFORM eq "hcc") { $HIPLDFLAGS = "-hc -L$HCC_HOME/lib -Wl,--rpath=$HCC_HOME/lib -lc++ -ldl -lpthread -Wl,--whole-archive -lmcwamp -Wl,--no-whole-archive"; # Suppress linker warnings in case HCC distribution contains OpenCL/SPIR symbols - #$HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0"; + $HOST_OSNAME= `cat /etc/os-release | grep "^ID\=" | cut -d= -f2 | tr -d '\n'`; + $HOST_OSVER= `cat /etc/os-release | grep "^VERSION_ID\=" | cut -d= -f2 | tr -d '\n'`; + if ($HOST_OSNAME eq "ubuntu" and $HOST_OSVER eq "\"16.04\"") { + # No additional flags required + } else { + $HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0"; + } # Satisfy HCC dependencies $HIPLDFLAGS .= " -lc++abi";