<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 28, 2017 at 11:22 AM, P F <span dir="ltr"><<a href="mailto:pfultz2@yahoo.com" target="_blank">pfultz2@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Oct 28, 2017, at 9:50 AM, Aaron Boxer <<a href="mailto:boxerab@gmail.com">boxerab@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I have a cmake project on linux, and I would like to change the compiler<br>
> for certain files from g++ to  another, llvm-based compiler called hcc.<br>
> (hcc is AMDs HIP compiler for GPGPU)<br>
><br>
><br>
> Is there a way of doing this in my cmake file ?<br>
<br>
</span>There isn’t a simple way to do that. The FindCUDA and FindHIP cmake modules do that, but its not at all easy to follow, and brings its own set of issues.<br>
<br>
Of course, why do you need to use g++ to compile host code? Being clang-based hcc should be able to compile any g++ code. So you can just use hcc as the compiler for everything and then link with the `hccrt` cmake target(provided by `find_package(hcc)`) which will enable GPU compiling when you want to compile code for the device.<br></blockquote><div><br></div><div>Yes, I just might do that. I didn't realize there was a find_package for hcc.  So, how would I set hcc as the compiler for everything ?</div><div><br></div><div><br></div><div><br></div><div> </div></div><br></div></div>