|
| View previous topic :: View next topic |
| Author |
Message |
jand
Joined: 17 Aug 2008 Posts: 48
|
Posted: Sun Oct 28, 2012 1:02 am Post subject: minloc, maxloc |
|
|
Hi,
I read about minloc and maxloc not being supported in CUDA Frotran. Is there an update to this? Are there any plans to include these intrinsics?
Thanks, Jan |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Oct 29, 2012 10:01 am Post subject: |
|
|
Hi Jand,
No, sorry, there has been no progress on TPR#17664. I pinged our engineers again. In the mean time, you can add a device routine:
| Code: | module mtests
contains
attributes(device) function mymaxloc(x)
integer x(:)
integer foo, i
n = size(x)
imax = 1
imaxval = x(1)
do i = 2, n
if (x(i) .gt. imaxval) then
imaxval = x(i)
imax = i
end if
end do
mymaxloc = imax
return
end function
attributes(global) subroutine testany( a )
integer, device :: a(*)
integer ax(4)
ax(1) = 4
ax(2) = 6
ax(3) = 3
ax(4) = 2
i = threadidx%x
a(i) = mymaxloc(ax)
return
end subroutine
end module mtests
program t
use mtests
integer, allocatable, device :: n(:)
integer m(5),k(5)
allocate(n(5))
n = 0
call testany<<<1,5>>> (n)
m = n
do i = 1, 5
print *,i,m(i)
end do
end
|
- Mat |
|
| Back to top |
|
 |
TheMatt
Joined: 06 Jul 2009 Posts: 263 Location: Greenbelt, MD
|
Posted: Wed Apr 17, 2013 10:37 am Post subject: |
|
|
Mat,
Any news on maxloc? I'm working on trying to translate some of our CUDA Fortran code into nicer to manage OpenACC code, but one chunk of it has a maxloc call.
With CUDA Fortran I was able to hack in an ugly, ifdef gpu function to do this, but I don't think you can call CUDA Fortran from inside an accelerator region, right?
Matt |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Wed Apr 17, 2013 11:20 am Post subject: |
|
|
Hi Matt,
We have an engineer that's working on it right now. He expects a few more days of work and then testing. Hoping for 13.5 if all goes well.
- Mat |
|
| 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
|