PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Undefined reference to `atomicaddd' using emulation mode
Goto page Previous  1, 2
 
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: Wed Nov 14, 2012 9:37 am    Post subject: Reply with quote

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
View user's profile
brentl



Joined: 20 Jul 2004
Posts: 108

PostPosted: Fri Nov 16, 2012 12:12 pm    Post subject: Reply with quote

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
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
Page 2 of 2

 
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