PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Compiler failed to translate accelerator region
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
ElMaskina



Joined: 09 Jul 2013
Posts: 13

PostPosted: Fri Jul 12, 2013 9:57 am    Post subject: Compiler failed to translate accelerator region Reply with quote

Hello,
I'm trying to accelerate a combustion fluid dynamics code using CUDA. But to do so I need to execute a differential equation solver in the GPU. I have defined all the necessary functions and subroutines as device in the solver code but I get the error:

Quote:
Compiler failed to translate accelerator region (see -Minfo messages): Unsupported procedure


You could find the archive in https://www.dropbox.com/s/unpco51fncciprx/LIB_dvode_f90_d.f90

Many thanks
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Jul 12, 2013 2:53 pm    Post subject: Reply with quote

Hi ElMaskina,

The "Unsupported feature" is an allocate and deallocate. Typicially, you don't want these in device code.

We id did recently add support for allocate/deallocate in device code (PGI 13.3 or later) but you have to have a Kepler K20 card, and compile with "-Mcuda=rdc,cc35". Though, great thought and care needs to be done before doing this since haveing many thousands of threads all allocating memory, may have a severe performance impact and/or cause you to run out of memory.

- Mat

Code:
% pgf90 -acc -c LIB_dvode_f90_d.f90 -Minfo=accel -Mcuda -V13.6
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 4947)
  0 inform,   0 warnings,   1 severes, 0 fatal for set_opts
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 5759)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvode_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9288)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvpreps
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9606)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvrenew
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 9907)
  0 inform,   0 warnings,   1 severes, 0 fatal for bgroup_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 10119)
  0 inform,   0 warnings,   1 severes, 0 fatal for banded_iaja_d
PGF90-S-0155-Use of allocate/deallocate in device code requires relocatable device code, -Mcuda=rdc  (LIB_dvode_f90_d.f90: 10921)
  0 inform,   0 warnings,   1 severes, 0 fatal for dvjacs28

Back to top
View user's profile
ElMaskina



Joined: 09 Jul 2013
Posts: 13

PostPosted: Tue Jul 16, 2013 4:33 am    Post subject: Reply with quote

Hello,
I commented all the calls to allocate() and allocated() in the program, with these changes the CPU version works fine, so that is not needed for my program. But when I try to compile it with the GPU, new errors appear.
Quote:
/tmp/pgcudaforsjGd2IIOIOhN.gpu(6): error: expected an expression

Quote:
/tmp/pgcudaforsjGd2IIOIOhN.gpu(1234): error: identifier "_dvode_f90_m_d_4" is undefined

Here is the new version https://www.dropbox.com/s/unpco51fncciprx/LIB_dvode_f90_d.f90
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jul 16, 2013 11:05 am    Post subject: Reply with quote

Hi ElMaskina,

The first error "expected an expression" is actually due to a know compiler issue (TPR#19370) when using multiple data statements in a device module. The work around is to not use DATA statements with device variables as well as the data initialization of "MORD".

The second error is because you're trying to access host data from within device code. Typically the compiler finds these cases but we're missing it here. Specifically, you for forgot to add "device" to the module allocatable arrays at line 1990 (starts with the array BIGP). After these changes the code will compile.

- Mat
Back to top
View user's profile
ElMaskina



Joined: 09 Jul 2013
Posts: 13

PostPosted: Wed Jul 24, 2013 11:47 am    Post subject: Reply with quote

So, how can I initialize the data?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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