PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Fortran CUDA device function error

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
jack_laconic



Joined: 14 Aug 2010
Posts: 5

PostPosted: Thu Sep 30, 2010 8:42 pm    Post subject: Fortran CUDA device function error Reply with quote

I have the following error message when calling a device function
Calls from device code to a host function are allowed only in emulation mode - match
Does anyone know what is wrong?

module module1
use cudafor
contains

attributes(device) logical function match(mem, cnt, a, b)
integer:: mem(32), cnt, a, b
...
end

attributes(global) subroutine kernel1(...)
logical match
...
if( match(mem,0,i,k)) then
...
end

subroutine hostfunction (...)
...
call kernel1<<<...>>>
end

end module module1
Back to top
View user's profile
mkcolg



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

PostPosted: Fri Oct 01, 2010 2:22 pm    Post subject: Reply with quote

Hi jack_laconic,

Take out the "logical match" declaration from kernel1. This tells the compiler that 'match' is an external function so it thinks you're trying to call a host routine called match, not the module's match.

Hope this helps,
Mat
Back to top
View user's profile
jack_laconic



Joined: 14 Aug 2010
Posts: 5

PostPosted: Sat Oct 02, 2010 6:15 pm    Post subject: Reply with quote

That works.
Thanks a lot, Mat!
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
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