[llvm-dev] Separate compilation of CUDA code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[llvm-dev] Separate compilation of CUDA code?

Tim Northover 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [llvm-dev] Separate compilation of CUDA code?

Tim Northover via llvm-dev
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
[hidden email]
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
[hidden email]

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [llvm-dev] Separate compilation of CUDA code?

Tim Northover via llvm-dev
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";<[hidden email]>;
Send time: Monday, Jun 19, 2017 4:07 PM
To: "llvm-dev"<[hidden email]>;
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
[hidden email]
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
[hidden email]

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [llvm-dev] Separate compilation of CUDA code?

Tim Northover via llvm-dev
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";[hidden email];
Send time: Monday, Jun 19, 2017 4:07 PM
To: "llvm-dev"[hidden email];
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
[hidden email]
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
[hidden email]

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

Phone: +49-621-181-2696
[hidden email]

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [llvm-dev] Separate compilation of CUDA code?

Tim Northover via llvm-dev
In reply to this post by Tim Northover via llvm-dev


On 06/19/2017 04:37 AM, Yuanfeng Peng via llvm-dev wrote:
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,

As I understand it, this is not exactly true. Relocatable device code is necessary for OpenMP offloading support, and essentially works in that context, we just don't currently have an option to enable it in CUDA mode. Hopefully, some of the folks from IBM who have been working on this can comment.

 -Hal

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";[hidden email];
Send time: Monday, Jun 19, 2017 4:07 PM
To: "llvm-dev"[hidden email];
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
[hidden email]
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
[hidden email]


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Loading...