|
| View previous topic :: View next topic |
| Author |
Message |
Dolf
Joined: 22 Mar 2012 Posts: 78
|
Posted: Fri Jan 04, 2013 5:42 pm Post subject: Upgrading cuda toolkit from 4 to 5 with PGI 12.3 VS 2010 |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Jan 07, 2013 2:43 pm Post subject: |
|
|
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 |
|
 |
Dolf
Joined: 22 Mar 2012 Posts: 78
|
Posted: Wed Jan 09, 2013 4:27 pm Post subject: RE: |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed Jan 09, 2013 5:01 pm Post subject: |
|
|
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 |
|
 |
Dolf
Joined: 22 Mar 2012 Posts: 78
|
Posted: Wed Jan 16, 2013 1:31 pm Post subject: RE: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|