Displaying 20 results from an estimated 27 matches for "enddo".
2009 Jun 30
3
Matrix with random number
...pa, double *pb){
*px = rbeta(*pa,*pb);
}
Code in Fortran
subroutine mat(x,l,c)
integer l,c
double precision x(l,c)
integer i,j
do j = 1, c
do i = 1, l
call fseedi()
x(i,j) = call myrbeta(1,4,5) ! It's correct?
call fseedo()
enddo
enddo
end
Thanks very much!
--
Fábio Mathias Corrêa
Estatística e Experimentação Agropecuária
Fábio Mathias Corrêa UFLA
____________________________________________________________________________________
[[elided Yahoo s...
2004 Jan 19
1
memory limitation with Fortran interface
...ly I'm getting into memory management problems.
To track the problem I wrote the following small Fortran subroutine
(saved as test.f) :
subroutine test(n,p)
implicit none
integer n,p,i,j
real x(n,p)
do i=1,n
do j=1,p
x(i,j) = 0
enddo
enddo
end
I compiled it by :
g77 -c test.f
then I called it from R with :
n <- 10000
p <- 1000
system("R CMD SHLIB ~/test.o")
dyn.load("~/test.so")
out.res<- .Fortran("test",
as.integer(n),
as.integer(p)...
2013 Feb 03
0
[LLVMdev] [Polly]
...ND), intent(in) :: szh, szx, szy
real(kind=RKIND), intent(in) :: H(szh), X(szx)
real(kind=RKIND), intent(out) :: Y(szy)
integer(kind=IKIND) :: i, j, i1, i2
integer, parameter :: rkind = RKIND
do i = 1, szy
Y(i) = 0.0_rkind
do j = 1, szh
Y(i) = Y(i) + X(i + j - 1) * H(j)
enddo
enddo
end subroutine filter
2)
subroutine filter(H, szh, X, szx, Y, szy)
implicit none
integer(kind=IKIND), intent(in) :: szh, szx, szy
real(kind=RKIND), intent(in) :: H(szh), X(szx)
real(kind=RKIND), intent(out) :: Y(szy)
integer(kind=IKIND) :: i, j, i1, i2
integer, parameter ::...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...finding problems with BackEdgeTaken count calculation in
even simple fortran loops with gfortran-4.6 + DragonEgg 3.0.
Even for simple double loops like this one:
program test2
integer i,j,k
dimension k(100,100)
do j=1,100
do i=1,100
k(i,j) = i
enddo
enddo
write(*,*) k(1,30)
end
make the ScalarEvolution engine return "CouldNotCompute" even for the
outer loop (the inner loop is fine).
You can find a screenshot of the translation of this loop here (with
-view-cfg Polly version):
http://i.imgur.com/Jyaqd.png
The p...
2012 Apr 13
2
Can't read a binary file
...'t read a binary file. Here is how the creator of the file described the code that would be needed in Fortran:
"Every record has a return in fortran. The length of each record is nx*ny*4. To read you would use the following:
nlayx = nx*ny*4
do iz=1,nz,4
read(binary file) var(1:nlayx)
enddo
nrest=mod(nx*ny*nz,nlayx)
read(binary file) var(1:nrest)"
The first value in the file should be 0.05, and all of the data values are real. Here is what I get (with similar answers using double):
> v<-readBin("plotb.251", numeric(), size=4, n=1)
> v
[1] 1.614296e-39
>...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...ps with gfortran-4.6 + DragonEgg 3.0.
>>
>> Even for simple double loops like this one:
>>
>> program test2
>> integer i,j,k
>> dimension k(100,100)
>> do j=1,100
>> do i=1,100
>> k(i,j) = i
>> enddo
>> enddo
>> write(*,*) k(1,30)
>> end
>>
>> make the ScalarEvolution engine return "CouldNotCompute" even for the
>> outer loop (the inner loop is fine).
>>
>> You can find a screenshot of the translation of this loop here...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...culation in
> even simple fortran loops with gfortran-4.6 + DragonEgg 3.0.
>
> Even for simple double loops like this one:
>
> program test2
> integer i,j,k
> dimension k(100,100)
> do j=1,100
> do i=1,100
> k(i,j) = i
> enddo
> enddo
> write(*,*) k(1,30)
> end
>
> make the ScalarEvolution engine return "CouldNotCompute" even for the
> outer loop (the inner loop is fine).
>
> You can find a screenshot of the translation of this loop here (with
> -view-cfg Polly versi...
2012 Jul 31
3
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
...sion(nx, ny) :: A
real, dimension(ny, nz) :: B
real, dimension(nx, nz) :: C
integer :: i, j, k
real, volatile :: start, finish
call init_array
call cpu_time(start)
do i = 1, nx
do j = 1, nz
C(i,j) = 0
do k = 1, ny
C(i, j) = C(i, j) + A(i, k) * B(k, j)
enddo
enddo
enddo
call cpu_time(finish)
print *, sum(C), maxval(C), minval(C)
call flush()
contains
subroutine init_array
implicit none
integer :: i, j
do i = 1, nx
do j = 1, ny
A(i, j) = (1 + mod((i * j), 1024)) / 2.0
enddo
enddo
do i = 1, ny
do j = 1,...
2012 Feb 08
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...double loops like this one:
>> >>
>> >> program test2
>> >> integer i,j,k
>> >> dimension k(100,100)
>> >> do j=1,100
>> >> do i=1,100
>> >> k(i,j) = i
>> >> enddo
>> >> enddo
>> >> write(*,*) k(1,30)
>> >> end
>> >>
>> >> make the ScalarEvolution engine return "CouldNotCompute" even for the
>> >> outer loop (the inner loop is fine).
>> >>
>>...
2009 Apr 13
5
[LLVMdev] MemoryDependenceAnalysis
Hello,
I have a code similar to the following:
program test
integer i, j, N
real B(10)
call bar(N, 8)
N = N+1
do i = 1, N
B(i) = (i+5)/(i+3)
enddo
j = N/2
N = N+7
call IMPORTANT_F(B, N, i, j)
end program
and I am trying to use dependence analysis on the second and fourth
actual parameters of IMPORTANT_F(). Since it's Fortran, they are
really pointers, and the IR of the last block lo...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...;
> >> Even for simple double loops like this one:
> >>
> >> program test2
> >> integer i,j,k
> >> dimension k(100,100)
> >> do j=1,100
> >> do i=1,100
> >> k(i,j) = i
> >> enddo
> >> enddo
> >> write(*,*) k(1,30)
> >> end
> >>
> >> make the ScalarEvolution engine return "CouldNotCompute" even for the
> >> outer loop (the inner loop is fine).
> >>
> >> You can find a screensh...
2012 Feb 09
2
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...>> program test2
>> >> >> integer i,j,k
>> >> >> dimension k(100,100)
>> >> >> do j=1,100
>> >> >> do i=1,100
>> >> >> k(i,j) = i
>> >> >> enddo
>> >> >> enddo
>> >> >> write(*,*) k(1,30)
>> >> >> end
>> >> >>
>> >> >> make the ScalarEvolution engine return "CouldNotCompute" even for
>> >> >> the
>> &...
2012 Jul 31
0
[LLVMdev] [DragonEgg] Mysterious FRAME coming from gimple to LLVM
...(nx, nz) :: C
>
> integer :: i, j, k
> real, volatile :: start, finish
>
> call init_array
>
> call cpu_time(start)
>
> do i = 1, nx
> do j = 1, nz
> C(i,j) = 0
> do k = 1, ny
> C(i, j) = C(i, j) + A(i, k) * B(k, j)
> enddo
> enddo
> enddo
>
> call cpu_time(finish)
>
> print *, sum(C), maxval(C), minval(C)
> call flush()
>
> contains
>
> subroutine init_array
> implicit none
>
> integer :: i, j
>
> do i = 1, nx
> do j = 1, ny
> A(i,...
2012 Feb 08
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...; >>
> >> >> program test2
> >> >> integer i,j,k
> >> >> dimension k(100,100)
> >> >> do j=1,100
> >> >> do i=1,100
> >> >> k(i,j) = i
> >> >> enddo
> >> >> enddo
> >> >> write(*,*) k(1,30)
> >> >> end
> >> >>
> >> >> make the ScalarEvolution engine return "CouldNotCompute" even for the
> >> >> outer loop (the inner loop is fine...
2009 Apr 13
0
[LLVMdev] MemoryDependenceAnalysis
...Can you please attach the .bc file for this?
-Chris
>
>
> program test
> integer i, j, N
> real B(10)
>
> call bar(N, 8)
> N = N+1
> do i = 1, N
> B(i) = (i+5)/(i+3)
> enddo
>
> j = N/2
> N = N+7
>
> call IMPORTANT_F(B, N, i, j)
>
> end program
>
> and I am trying to use dependence analysis on the second and fourth
> actual parameters of IMPORTANT_F(). Since it's Fortran, they are
> reall...
2013 Feb 03
2
[LLVMdev] [Polly] Parallelizing outer loop containing inner reduction loop
...=RKIND), intent(in) :: H(szh), X(szx)
> real(kind=RKIND), intent(out) :: Y(szy)
> integer(kind=IKIND) :: i, j, i1, i2
> integer, parameter :: rkind = RKIND
>
> do i = 1, szy
> Y(i) = 0.0_rkind
> do j = 1, szh
> Y(i) = Y(i) + X(i + j - 1) * H(j)
> enddo
> enddo
>
> end subroutine filter
>
> 2)
>
> subroutine filter(H, szh, X, szx, Y, szy)
>
> implicit none
> integer(kind=IKIND), intent(in) :: szh, szx, szy
> real(kind=RKIND), intent(in) :: H(szh), X(szx)
> real(kind=RKIND), intent(out) :: Y(szy)
>...
2009 Apr 13
2
[LLVMdev] MemoryDependenceAnalysis
...;
> -Chris
>
>>
>>
>> program test
>> integer i, j, N
>> real B(10)
>>
>> call bar(N, 8)
>> N = N+1
>> do i = 1, N
>> B(i) = (i+5)/(i+3)
>> enddo
>>
>> j = N/2
>> N = N+7
>>
>> call IMPORTANT_F(B, N, i, j)
>>
>> end program
>>
>> and I am trying to use dependence analysis on the second and fourth
>> actual parameters of IMPORTANT_F(). Since i...
2012 Feb 09
0
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...test2
>>> >> >> integer i,j,k
>>> >> >> dimension k(100,100)
>>> >> >> do j=1,100
>>> >> >> do i=1,100
>>> >> >> k(i,j) = i
>>> >> >> enddo
>>> >> >> enddo
>>> >> >> write(*,*) k(1,30)
>>> >> >> end
>>> >> >>
>>> >> >> make the ScalarEvolution engine return "CouldNotCompute" even for
>>> >>...
2012 Feb 09
1
[LLVMdev] BackedgeTakenCount calculation for fortran loops and DragonEgg gfortran-4.6
...gt;> >> integer i,j,k
>>>> >> >> dimension k(100,100)
>>>> >> >> do j=1,100
>>>> >> >> do i=1,100
>>>> >> >> k(i,j) = i
>>>> >> >> enddo
>>>> >> >> enddo
>>>> >> >> write(*,*) k(1,30)
>>>> >> >> end
>>>> >> >>
>>>> >> >> make the ScalarEvolution engine return "CouldNotCompute" even for
&...
2009 Apr 25
0
[LLVMdev] MemoryDependenceAnalysis
...>>
>>> program test
>>> integer i, j, N
>>> real B(10)
>>>
>>> call bar(N, 8)
>>> N = N+1
>>> do i = 1, N
>>> B(i) = (i+5)/(i+3)
>>> enddo
>>>
>>> j = N/2
>>> N = N+7
>>>
>>> call IMPORTANT_F(B, N, i, j)
>>>
>>> end program
>>>
>>> and I am trying to use dependence analysis on the second and fourth
>>> actual p...