|
| View previous topic :: View next topic |
| Author |
Message |
crip_crop
Joined: 28 Jul 2010 Posts: 66
|
Posted: Wed Nov 14, 2012 9:37 am Post subject: |
|
|
Hi there,
I managed to get the 12.10 update and have installed it. I'm not longer getting the | Quote: | | undefined reference to atomicadd | error when I compile but the error most certainly hasn't been fixed. When I try to run my code in emulation mode the result I get is zero. So I presume that although the compiler is recognizing the function it still doesn't know what to do with it when in emulation mode and so nothing gets added in to my array.
Will this be fixed in the next release?
Cheers,
Crip_crop |
|
| Back to top |
|
 |
brentl
Joined: 20 Jul 2004 Posts: 107
|
Posted: Fri Nov 16, 2012 12:12 pm Post subject: |
|
|
You'll have to show me how you use it. It works for me:
brentl@woodchuck:~/simple/cuda/qa> pgf90 -V12.10 -Mcuda=emu atomd2.cuf
brentl@woodchuck:~/simple/cuda/qa> ./a.out
32896.00000000000 32896.00000000000
TEST PASSED
brentl@woodchuck:~/simple/cuda/qa> cat atomd2.cuf
module atomictests
contains
attributes(global) subroutine testatomicdadd( a )
real*8, device :: a
real*8 r
r = dble((blockIdx%x-1) * blockDim%x + threadIdx%x)
istat = atomicadd(a, r)
return
end subroutine testatomicdadd
end module atomictests
program t
use cudafor
use atomictests
real*8, device :: r
real*8 x
n = 256
r = 0
call testatomicdadd<<<4,n/4>>> (r)
x = r
print *,x,dble(n*(n+1)/2)
if (x .eq. dble(n*(n+1)/2)) then
print *,"TEST PASSED"
else
print *,"TEST FAILED"
endif
end |
|
| 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
|