declaration as pointer

Could someone, please, explain me, why one of the variables is a pointer, and the others are not? Thank you.

      REAL,DEVICE :: mo1hDD,o1hDD,po1hDD
      REAL,DEVICE :: mo1h_D,o1h_D,po1h_D



pgdbg [all] 0> type mo1hDD
real*8 

pgdbg [all] 0> type o1hDD
real*8 

pgdbg [all] 0> type po1hDD
real*8 

pgdbg [all] 0> type mo1h_D
real*8 

pgdbg [all] 0> type o1h_D
real*8 , pointer

pgdbg [all] 0> type po1h_D
real*8

Ok, maybe I should explain why this is a important topic for me.
I try to convert part of an existing application to GPU, and as a beginner, of course my programm crashes. Using the debugger pgdbg I found something strange concerning some of the variables. I declared all the variables in the same way (see my previous posting), but in the end, five of them are real*8, and one of them is a pointer. I do not understand what causes this and would appreciate some explanations.

Thanks
AClimate

Hi AClimate,

Apologies for the late response. I sent this over to our tools group. This is not expected, however, they were unable to reproduce the issue here so don’t know what the problem could be. Can you please either post or send PGI Customer Service (trs@pgroup.com) a reproducing example so we can diagnose the issue?

Thanks,
Mat

Hi Mat,

this is my example:

      PROGRAM TEST
      USE CUDAFOR
      IMPLICIT NONE

      REAL :: a, b
      REAL,DEVICE :: a_D, b_D
    
      write (*,*) 'a small test'
      a_D = a
      
      END

and this is the result, when a breakpoint is set on the write statement:

pgdbg> type a; type a_D; type b; type b_D
real*8 
real*8 , pointer
real*8 
real*8

I would expect that all the variables are of the same type.

Thanks,
AClimate

Hi AClimate,

Thanks for the example.

I would expect that all the variables are of the same type.

a and b are real. a_D and b_D are pointers to device memory so will show as pointers. However since “b_D” isn’t used, I suspect the wrong type information is getting set. If you add a reference for b_D then it will show as a pointer.

  • Mat