PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Upgrading cuda toolkit from 4 to 5 with PGI 12.3 VS 2010
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
Dolf



Joined: 22 Mar 2012
Posts: 128

PostPosted: Fri Jan 04, 2013 5:42 pm    Post subject: Upgrading cuda toolkit from 4 to 5 with PGI 12.3 VS 2010 Reply with quote

Hi all,

I just installed cuda toolkit 5.0 today, and PGI properties windows on Visual Studio 2010 seems not updating the cuda toolkit to 5, still showing 4.

please help.

Dolf
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Jan 07, 2013 2:43 pm    Post subject: Reply with quote

Hi Dolf,

Because we have to make adjustments to use some of the CUDA components, we ship everything needed for GPU programming. Hence, our products are independent from the CUDA Toolkit that you install from NVIDIA. CUDA 5 support will be available in the PGI 2013 release.

- Mat
Back to top
View user's profile
Dolf



Joined: 22 Mar 2012
Posts: 128

PostPosted: Wed Jan 09, 2013 4:27 pm    Post subject: RE: Reply with quote

Thanks Mat.

is the following kernel structurally correct??
ngrad = 1001
nx = 306

!============================================
attributes (global) subroutine interp1_kernel(nx,ngrad,ref,temp,dn,pn)
!============================================
implicit none

integer, value :: nx,ngrad
integer :: i,ix
integer :: ixn(1001)
real(8) :: ref(nx),temp(ngrad),cox(1001),pn(ngrad),dn(ngrad)

ixn(1) = 1
ixn(ngrad) = nx-1
cox(1) = 1.d0
cox(ngrad) = 0.d0
i = (blockidx%x - 1) * blockDim%x + threadidx%x
!do i=1, nxn
if( i <= ngrad ) then
!do i=2,nxn-1
if( i >= 2 .AND. i <= ngrad-1) then
ix=ixn(i-1)
do while(.not.(ref(ix).le.temp(i) .and. ref(ix+1).gt.temp(i)))
ix=ix+1
enddo
ixn(i)=ix
!c interpolation coefficient
cox(i)=(ref(ix+1)-temp(i))/(ref(ix+1)-ref(ix))
!enddo
endif
!do i=1,nxn
pn(i)=cox(i)*dn(ixn(i))+(1.d0-cox(i))*dn(ixn(i)+1)
!enddo
endif

return
end


thanks,
Dolf
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jan 09, 2013 5:01 pm    Post subject: Reply with quote

Hi Dolf,

Structurally I think you're ok, but I do see some potential errors. I'm sure if they're just because you're in the middle of porting, but I point them out.

ixn is a local fixed size array. Since it's uninitialized for most of the array, the expression "ix=ixn(i-1)" will give you a garbage value. Is this array suppose to be global or initialized locally?

Do cox and ixn need to arrays at all? You only use a few elements from them. Why not make them scalars and save the memory?

- Mat
Back to top
View user's profile
Dolf



Joined: 22 Mar 2012
Posts: 128

PostPosted: Wed Jan 16, 2013 1:31 pm    Post subject: RE: Reply with quote

Hi Mat,

Thanks for the info, I was able to fix this problem.
I have a new problem, when I run the code after I compile, it runs perfectly. But when I run it for the next time (with no changes), I get NAN error message (which means in fortran "Not A Number"), usually it happen when you divide by zero.
I am suspecting this due to me not deallocating the device matrices before the end of the program, is that correct? if yes, how can I deallocate or delete all values in the memory before the end?
For the allocating, I used a subroutine to allocate all device matrices with proper size. I created another subroutine to deallocate them, but it gave me the error below:

0: DEALLOCATE: memory at 0000000000000000 not allocated

what's the best way to solve this issue??

thanks,
Dolf
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, 3  Next
Page 1 of 3

 
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