PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Declaring local arrays in device code
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
crip_crop



Joined: 28 Jul 2010
Posts: 68

PostPosted: Thu Jun 07, 2012 9:45 am    Post subject: Reply with quote

Okay I tried implementing the following

Code:
      integer::cudaFuncCachePreferL1

!     Set device to prefer L1 cache to shared memory
      istat=cudaDeviceSetCacheConfig(cudaFuncCachePreferL1)


but I'm getting the compiler error:

Quote:
undefined reference to `cudadevicesetcacheconfig_'


Can you see anything wrong with how I'm calling the function?
Nb. The function is being called in host code.

Cheers,
Crip_crop
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Thu Jun 07, 2012 10:17 am    Post subject: Reply with quote

Do you have 'use cudafor' at the top of the module? And are you compiling -Mcuda?

ETA: Oh, wait, if you have 'use cudafor', you shouldn't need the integer:: declaration.

Matt
Back to top
View user's profile
crip_crop



Joined: 28 Jul 2010
Posts: 68

PostPosted: Thu Jun 07, 2012 10:35 am    Post subject: Reply with quote

Quote:
Do you have 'use cudafor' at the top of the module? And are you compiling -Mcuda?
....yes and yes.

Quote:
ETA: Oh, wait, if you have 'use cudafor', you shouldn't need the integer:: declaration.


I get the same compiler error both with and without the integer declaration.
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Thu Jun 07, 2012 11:01 am    Post subject: Reply with quote

crip_crop wrote:
Quote:
Do you have 'use cudafor' at the top of the module? And are you compiling -Mcuda?
....yes and yes.
Quote:
ETA: Oh, wait, if you have 'use cudafor', you shouldn't need the integer:: declaration.

I get the same compiler error both with and without the integer declaration.

Hmm. Are you using an old version of PGI? Because I can state it works for me in the code I'm running with PGI 12.5:
Code:
    STATUS = cudaDeviceSetCacheConfig(cudaFuncCachePreferL1)
    if (STATUS /= 0) then
       write (*,*) "cudaDeviceSetCacheConfig failed: ", cudaGetErrorString(STATUS)
    end if

When I see "undeclared reference" I think you aren't linking a library, or the library doesn't contain the function.

Matt
Back to top
View user's profile
crip_crop



Joined: 28 Jul 2010
Posts: 68

PostPosted: Thu Jun 07, 2012 11:39 am    Post subject: Reply with quote

I'm using 11.8... does that not support it?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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