- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
At the Fortran discourse site (https://fortran-lang.discourse.group/t/computing-at-compile-time/3044/13) there is a discussion about the possibility to use compile-time computation. I wrote a small program to meet a challenge that was posted, getting a list of prime numbers at run-time. While hardly the right tool of course, for more serious purposes, it is short and it causes an amazing problem it seems for the compiler. The Intel Fortran oneAPI compiler has been running for more than 4 hours (as has the gfortran compiler).
Here is the code:
! primesieve.f90 --
! Is it possible t obuild a prime sieve using compile-time computation?
!
program primesieve
implicit none
integer, parameter :: N = 1000
integer :: i, j
integer, parameter :: candidates(*) = [(i, i=2,N)]
integer, parameter :: multiples(*) = [(( i*j, i=2,N), j=2,N)]
integer, parameter :: primes(*) = pack( candidates, [(all(candidates(i) /= multiples), i = 1,size(candidates))] )
write(*,*) primes
end program primesieve
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Deleting all the partitions, make a new partition and reinstalling windows has fixed the problem.
I sometimes wonder how many computers are out there that are not maintained and updated.
Turning off all of the MS stuff takes almost as much time as the install.
This site would not allow me to include a child's name, from a novel, that is the shortened form of Richard. **Bleep** is my new go to word.
What happens if someone has the name **Bleep** (Intel I added it for you so you do not have to).
The gods are only human.
**Bleep**
