[llvm-dev] Separate compilation of CUDA code?

Lorenz Braun via llvm-dev llvm-dev at lists.llvm.org
Mon Jun 19 03:40:48 PDT 2017


Thanks for the link to this hack!
I have thought about doing something similar. But since the 
reallocatable device code is only nice to have for me i don't want to 
put to much work in it.

Maybe its possible to generate IR with clang, hand it over to the 
libnvvm backend and get a fatbinary which then can be included in the 
host code compiled by clang. I think this would need the least amount of 
hacking to being able to use the rdc flag.

Regards
Lorenz

Am 19.06.17 um 11:37 schrieb Yuanfeng Peng:
> Hi Lorenz,
>
> Thanks for letting me know!  It seems that relocatable device code for 
> CUDA isn't being taken care of by anyone in the LLVM developers 
> community now, so I ended up with a little hacking with nvcc to 
> achieve my goal.  I found the approach on 
> github: https://github.com/apc-llc/nvcc-llvm-ir .  Basically, I used 
> this method to get the unoptimized nvvm IR from nvcc( more precisely, 
> cicc), then invoked my own llvm pass on it to do the transformation I 
> need, and feed the transformed IR back to nvcc's libnvvm backend. 
>  This way, nvcc still takes care of the compilation and linking of 
> device code.
>
> I'm not sure whether this can be useful for your problem as well, but 
> I think I should let you know.  Hope it helps!
>
> Thanks!
> Yuanfeng
>
>
> ------------------ Original ------------------
> *From: * "via llvm-dev";<llvm-dev at lists.llvm.org>;
> *Send time:* Monday, Jun 19, 2017 4:07 PM
> *To:* "llvm-dev"<llvm-dev at lists.llvm.org>;
> *Subject: * Re: [llvm-dev] Separate compilation of CUDA code?
>
> Hi Yuanfeng,
>
> i have asked about this a few days ago. [0]
> As far as i know there is no such flag available and i did not find 
> any information whether this feature will be supported. However i 
> would be very interested on any updates on this feature.
>
> Kind Regards
> Lorenz
>
> [0] http://lists.llvm.org/pipermail/llvm-dev/2017-June/113921.html
>
>
> Am 14.06.17 um 19:18 schrieb Yuanfeng Peng via llvm-dev:
>> Hi,
>>
>> I wonder whether the current version of LLVM supports separate 
>> compilation and linking of device code, i.e., is there a flag 
>> analogous to nvcc's --relocatable-device-code flag?  If not, is there 
>> any plan to support this?
>>
>> Thanks!
>> Yuanfeng Peng
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
> -- 
> Lorenz Braun
> Research Associate
> Institute of Computer Engineering (ZITI)
> B6, 26, Building B, Office B2.20
> 68131 Mannheim
>
> Phone: +49-621-181-2696
> lorenz.braun at ziti.uni-heidelberg.de

-- 
Lorenz Braun
Research Associate
Institute of Computer Engineering (ZITI)
B6, 26, Building B, Office B2.20
68131 Mannheim

Phone: +49-621-181-2696
lorenz.braun at ziti.uni-heidelberg.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170619/0304e827/attachment-0001.html>


More information about the llvm-dev mailing list