NVPTX questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NVPTX questions

Mueller-Roemer, Johannes Sebastian

Hi,

 

I started experimenting with the NVPTX backend and have been successful so far, however I ran into two issues:

 

1.       How do I access createNVVMReflectPass properly? The header in which it is defined is not installed along with other headers when (using CMake, if that matters), so I am currently declaring it directly in my code.

2.       When using mathematical functions like powf or sqrtf, I need to use __nv_powf and __nv_sqrtf from libdevice. This works fine but unlike powf, expressions like powf(x, 0.5f), where .5f is constant are not optimized/strength reduced.
Is there any way to call powf, then optimize then rename these calls later on (and probably optimize again…)? Or is there a better approach?

 

Regards

Johannes

 

--

Johannes S. Mueller-Roemer, MSc

Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)

 

Fraunhofer-Institut für Graphische Datenverarbeitung IGD

Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany

Tel +49 6151 155-606  |  Fax +49 6151 155-139

[hidden email]  |  www.igd.fraunhofer.de

 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: NVPTX questions

Justin Holewinski-2

On Thu, Jun 11, 2015 at 10:31 AM, Mueller-Roemer, Johannes Sebastian <[hidden email]> wrote:

Hi,

 

I started experimenting with the NVPTX backend and have been successful so far, however I ran into two issues:

 

1.       How do I access createNVVMReflectPass properly? The header in which it is defined is not installed along with other headers when (using CMake, if that matters), so I am currently declaring it directly in my code.

Yes, that is an unfortunate part of the current implementation.  I've been thinking of how to address this better.  For now, just declaring the init function prototype in your source file is fine.
 

2.       When using mathematical functions like powf or sqrtf, I need to use __nv_powf and __nv_sqrtf from libdevice. This works fine but unlike powf, expressions like powf(x, 0.5f), where .5f is constant are not optimized/strength reduced.
Is there any way to call powf, then optimize then rename these calls later on (and probably optimize again…)? Or is there a better approach?

How are you linking with libdevice?  The recommended way is to link the IR before calling any optimization passes to allow the optimizers to see the implementation.  Or are you referring to LLVM not understanding that __nv_powf is a "built-in" function like libm's powf?

 

 

Regards

Johannes

 

--

Johannes S. Mueller-Roemer, MSc

Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)

 

Fraunhofer-Institut für Graphische Datenverarbeitung IGD

Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany

Tel <a href="tel:%2B49%206151%20155-606" value="+496151155606" target="_blank">+49 6151 155-606  |  Fax <a href="tel:%2B49%206151%20155-139" value="+496151155139" target="_blank">+49 6151 155-139

[hidden email]  |  www.igd.fraunhofer.de

 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




--

Thanks,

Justin Holewinski

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev