PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Calculating Exponents in the Debugger

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling
View previous topic :: View next topic  
Author Message
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Wed Mar 14, 2012 4:30 pm    Post subject: Calculating Exponents in the Debugger Reply with quote

Hey,

This might be a dumb question... but how might I calculate exponents in the debugger?

When I try say, 2**3, I get an error as that operator is not recognized, so I tried the C style way,
Code:

pgdbg [all] 0> print pow(2,3)
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
1


I tried making it a real,
Code:

pgdbg [all] 0> print pow(2.0,3.0)
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
1


Then tried printf,
Code:

pgdbg [all] 0> printf "%0.5f,%d",pow(2.3,4),3
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
,3


No luck..

I ask because I'm trying to follow some calculations in the code in the debugger, and they have a bunch of exponents in them.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5943
Location: The Portland Group Inc.

PostPosted: Fri Mar 16, 2012 11:09 am    Post subject: Reply with quote

Hi khea_actua1,

While pgdbg does support several command line operations, pow is not one of them. As a work around you could add your own routine in your program and then call the routine from the pgdbg command prompt. Something like:
Code:

       subroutine mypow(x, y)
           double precision x
           double precision y
           print *, x**y
       end


- Mat
Back to top
View user's profile
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Fri Mar 16, 2012 1:08 pm    Post subject: Reply with quote

hmm, good idea. I'll try it out. Thanks!
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group