[cfe-dev] [RFC] Introduce HIP language mode

Liu, Yaxun (Sam) via cfe-dev cfe-dev at lists.llvm.org
Mon Apr 2 09:36:29 PDT 2018

Hi Tom,

HIP on HCC is an existing open-source out-of-tee implementation of HIP. HIP on clang is a new implementation which is independent of HCC. Since HIP is very similar to CUDA, implementing it directly in clang trunk make it easier to upstream therefore result in higher quality.

After HIP is fully supported in clang trunk, we may consider removing HCC specific implementation details from HIP runtime. Of course HCC as an independent language has its own advantages and will still continue to exist.

-----Original Message-----
From: Tom Stellard [mailto:tstellar at redhat.com] 
Sent: Monday, April 02, 2018 12:26 PM
To: Liu, Yaxun (Sam) <Yaxun.Liu at amd.com>; cfe-dev (cfe-dev at lists.llvm.org) <cfe-dev at lists.llvm.org>
Cc: Tye, Tony <Tony.Tye at amd.com>; Sumner, Brian <Brian.Sumner at amd.com>
Subject: Re: [cfe-dev] [RFC] Introduce HIP language mode

On 03/28/2018 12:29 PM, Liu, Yaxun (Sam) via cfe-dev wrote:
> HIP is a language similar to CUDA (https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md  ).
> The language syntax is very similar, which allows a hip program to be 
> compiled as a CUDA program by Clang. The main difference is the host 
> API. HIP has a set of vendor neutral host API which can be implemented on different platforms. Currently there is open source implementation of HIP runtime on amdgpu target (https://github.com/ROCm-Developer-Tools/HIP ).

What's the relationship between the HIP language mode and hcc?  Is the HIP language mode intended to replace the current hip + hcc stack?


> We have a working implementation of HIP compiler based on clang thanks 
> to Greg Rodgers' work and we would like to upstream it. As an initial step, we created a Phabricator Review https://reviews.llvm.org/D44984 for adding support of file type hip and language option HIP.
> When hip file is compiled, both LangOpts.CUDA and LangOpts.HIP is 
> turned on. This allows compilation of hip program as CUDA in most cases and only special handling of hip program is needed LangOpts.HIP is checked.
> This patch also adds support of kernel launching of HIP program using HIP host API.
> The next patch will be the toolchain changes to support HIP. Basically HIP has its own open source header files and device libraries which may be ported to different targets/platforms.
> We plan to continue upstreaming our support of HIP until it becomes mature enough to support major machine learning applications ported to HIP, e.g. TensorFlow https://github.com/ROCmSoftwarePlatform/tensorflow .
> Any comments are welcome.
> Thanks.
> Yaxun (Sam) Liu
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list