Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Zig
Javascript
GIMPLE
Ygen
sway
fortran source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
AARCH64 gfortran 10.5.0
AARCH64 gfortran 11.4.0
AARCH64 gfortran 12.1.0
AARCH64 gfortran 12.2.0
AARCH64 gfortran 12.3.0
AARCH64 gfortran 12.4.0
AARCH64 gfortran 12.5.0
AARCH64 gfortran 13.1.0
AARCH64 gfortran 13.2.0
AARCH64 gfortran 13.3.0
AARCH64 gfortran 13.4.0
AARCH64 gfortran 14.1.0
AARCH64 gfortran 14.2.0
AARCH64 gfortran 14.3.0
AARCH64 gfortran 15.1.0
AARCH64 gfortran 15.2.0
AARCH64 gfortran 4.9.4
AARCH64 gfortran 5.5.0
AARCH64 gfortran 6.4
AARCH64 gfortran 7.3
AARCH64 gfortran 8.2
ARM (32bit) gfortran 10.5.0
ARM (32bit) gfortran 11.4.0
ARM (32bit) gfortran 12.1.0
ARM (32bit) gfortran 12.2.0
ARM (32bit) gfortran 12.3.0
ARM (32bit) gfortran 12.4.0
ARM (32bit) gfortran 12.5.0
ARM (32bit) gfortran 13.1.0
ARM (32bit) gfortran 13.2.0
ARM (32bit) gfortran 13.3.0
ARM (32bit) gfortran 13.4.0
ARM (32bit) gfortran 14.1.0
ARM (32bit) gfortran 14.2.0
ARM (32bit) gfortran 14.3.0
ARM (32bit) gfortran 15.1.0
ARM (32bit) gfortran 15.2.0
ARM (32bit) gfortran 6.4
ARM (32bit) gfortran 7.3
ARM (32bit) gfortran 8.2
HPPA gfortran 14.2.0
HPPA gfortran 14.3.0
HPPA gfortran 15.1.0
HPPA gfortran 15.2.0
LFortran 0.42.0
LFortran 0.43.0
LFortran 0.44.0
LFortran 0.45.0
LFortran 0.46.0
LFortran 0.47.0
LFortran 0.48.0
LFortran 0.49.0
LFortran 0.50.0
LFortran 0.51.0
LFortran 0.52.0
LOONGARCH64 gfortran 12.2.0
LOONGARCH64 gfortran 12.3.0
LOONGARCH64 gfortran 12.4.0
LOONGARCH64 gfortran 12.5.0
LOONGARCH64 gfortran 13.1.0
LOONGARCH64 gfortran 13.2.0
LOONGARCH64 gfortran 13.3.0
LOONGARCH64 gfortran 13.4.0
LOONGARCH64 gfortran 14.1.0
LOONGARCH64 gfortran 14.2.0
LOONGARCH64 gfortran 14.3.0
LOONGARCH64 gfortran 15.1.0
LOONGARCH64 gfortran 15.2.0
MIPS gfortran 12.1.0
MIPS gfortran 12.2.0
MIPS gfortran 12.3.0
MIPS gfortran 12.4.0
MIPS gfortran 12.5.0
MIPS gfortran 13.1.0
MIPS gfortran 13.2.0
MIPS gfortran 13.3.0
MIPS gfortran 13.4.0
MIPS gfortran 14.1.0
MIPS gfortran 14.2.0
MIPS gfortran 14.3.0
MIPS gfortran 15.1.0
MIPS gfortran 15.2.0
MIPS gfortran 4.9.4
MIPS gfortran 5.5.0
MIPS gfortran 9.5.0
MIPS64 gfortran 12.1.0
MIPS64 gfortran 12.2.0
MIPS64 gfortran 12.3.0
MIPS64 gfortran 12.4.0
MIPS64 gfortran 12.5.0
MIPS64 gfortran 13.1.0
MIPS64 gfortran 13.2.0
MIPS64 gfortran 13.3.0
MIPS64 gfortran 13.4.0
MIPS64 gfortran 14.1.0
MIPS64 gfortran 14.2.0
MIPS64 gfortran 14.3.0
MIPS64 gfortran 15.1.0
MIPS64 gfortran 15.2.0
MIPS64 gfortran 4.9.4
MIPS64 gfortran 5.5.0
MIPS64 gfortran 9.5.0
MIPS64el gfortran 12.1.0
MIPS64el gfortran 12.2.0
MIPS64el gfortran 12.3.0
MIPS64el gfortran 12.4.0
MIPS64el gfortran 12.5.0
MIPS64el gfortran 13.1.0
MIPS64el gfortran 13.2.0
MIPS64el gfortran 13.3.0
MIPS64el gfortran 13.4.0
MIPS64el gfortran 14.1.0
MIPS64el gfortran 14.2.0
MIPS64el gfortran 14.3.0
MIPS64el gfortran 15.1.0
MIPS64el gfortran 15.2.0
MIPS64el gfortran 4.9.4
MIPS64el gfortran 5.5.0
MIPS64el gfortran 9.5.0
MIPSel gfortran 12.1.0
MIPSel gfortran 12.2.0
MIPSel gfortran 12.3.0
MIPSel gfortran 12.4.0
MIPSel gfortran 12.5.0
MIPSel gfortran 13.1.0
MIPSel gfortran 13.2.0
MIPSel gfortran 13.3.0
MIPSel gfortran 13.4.0
MIPSel gfortran 14.1.0
MIPSel gfortran 14.2.0
MIPSel gfortran 14.3.0
MIPSel gfortran 15.1.0
MIPSel gfortran 15.2.0
MIPSel gfortran 4.9.4
MIPSel gfortran 5.5.0
MIPSel gfortran 9.5.0
POWER gfortran 12.1.0
POWER gfortran 12.2.0
POWER gfortran 12.3.0
POWER gfortran 12.4.0
POWER gfortran 12.5.0
POWER gfortran 13.1.0
POWER gfortran 13.2.0
POWER gfortran 13.3.0
POWER gfortran 13.4.0
POWER gfortran 14.1.0
POWER gfortran 14.2.0
POWER gfortran 14.3.0
POWER gfortran 15.1.0
POWER gfortran 15.2.0
POWER64 gfortran 12.1.0
POWER64 gfortran 12.2.0
POWER64 gfortran 12.3.0
POWER64 gfortran 12.4.0
POWER64 gfortran 12.5.0
POWER64 gfortran 13.1.0
POWER64 gfortran 13.2.0
POWER64 gfortran 13.3.0
POWER64 gfortran 13.4.0
POWER64 gfortran 14.1.0
POWER64 gfortran 14.2.0
POWER64 gfortran 14.3.0
POWER64 gfortran 15.1.0
POWER64 gfortran 15.2.0
POWER64 gfortran trunk
POWER64le gfortran 12.1.0
POWER64le gfortran 12.2.0
POWER64le gfortran 12.3.0
POWER64le gfortran 12.4.0
POWER64le gfortran 12.5.0
POWER64le gfortran 13.1.0
POWER64le gfortran 13.2.0
POWER64le gfortran 13.3.0
POWER64le gfortran 13.4.0
POWER64le gfortran 14.1.0
POWER64le gfortran 14.2.0
POWER64le gfortran 14.3.0
POWER64le gfortran 15.1.0
POWER64le gfortran 15.2.0
POWER64le gfortran trunk
RISC-V 32-bits gfortran (trunk)
RISC-V 32-bits gfortran 12.1.0
RISC-V 64-bits gfortran (trunk)
RISC-V 64-bits gfortran 12.1.0
RISCV (32bit) gfortran 11.4.0
RISCV (32bit) gfortran 12.2.0
RISCV (32bit) gfortran 12.3.0
RISCV (32bit) gfortran 12.4.0
RISCV (32bit) gfortran 12.5.0
RISCV (32bit) gfortran 13.1.0
RISCV (32bit) gfortran 13.2.0
RISCV (32bit) gfortran 13.3.0
RISCV (32bit) gfortran 13.4.0
RISCV (32bit) gfortran 14.1.0
RISCV (32bit) gfortran 14.2.0
RISCV (32bit) gfortran 14.3.0
RISCV (32bit) gfortran 15.1.0
RISCV (32bit) gfortran 15.2.0
RISCV64 gfortran 11.4.0
RISCV64 gfortran 12.2.0
RISCV64 gfortran 12.3.0
RISCV64 gfortran 12.4.0
RISCV64 gfortran 12.5.0
RISCV64 gfortran 13.1.0
RISCV64 gfortran 13.2.0
RISCV64 gfortran 13.3.0
RISCV64 gfortran 13.4.0
RISCV64 gfortran 14.1.0
RISCV64 gfortran 14.2.0
RISCV64 gfortran 14.3.0
RISCV64 gfortran 15.1.0
RISCV64 gfortran 15.2.0
SPARC LEON gfortran 12.2.0
SPARC LEON gfortran 12.3.0
SPARC LEON gfortran 12.4.0
SPARC LEON gfortran 12.5.0
SPARC LEON gfortran 13.1.0
SPARC LEON gfortran 13.2.0
SPARC LEON gfortran 13.3.0
SPARC LEON gfortran 13.4.0
SPARC LEON gfortran 14.1.0
SPARC LEON gfortran 14.2.0
SPARC LEON gfortran 14.3.0
SPARC LEON gfortran 15.1.0
SPARC LEON gfortran 15.2.0
SPARC gfortran 12.2.0
SPARC gfortran 12.3.0
SPARC gfortran 12.4.0
SPARC gfortran 12.5.0
SPARC gfortran 13.1.0
SPARC gfortran 13.2.0
SPARC gfortran 13.3.0
SPARC gfortran 13.4.0
SPARC gfortran 14.1.0
SPARC gfortran 14.2.0
SPARC gfortran 14.3.0
SPARC gfortran 15.1.0
SPARC gfortran 15.2.0
SPARC64 gfortran 12.2.0
SPARC64 gfortran 12.3.0
SPARC64 gfortran 12.4.0
SPARC64 gfortran 12.5.0
SPARC64 gfortran 13.1.0
SPARC64 gfortran 13.2.0
SPARC64 gfortran 13.3.0
SPARC64 gfortran 13.4.0
SPARC64 gfortran 14.1.0
SPARC64 gfortran 14.2.0
SPARC64 gfortran 14.3.0
SPARC64 gfortran 15.1.0
SPARC64 gfortran 15.2.0
Tricore gfortran 11.3.0 (EEESlab)
flang-trunk
flang-trunk-fc1
power64 AT12.0
power64 AT13.0
power64le AT12.0
power64le AT13.0
s390x gfortran 12.1.0
s390x gfortran 12.2.0
s390x gfortran 12.3.0
s390x gfortran 12.4.0
s390x gfortran 12.5.0
s390x gfortran 13.1.0
s390x gfortran 13.2.0
s390x gfortran 13.3.0
s390x gfortran 13.4.0
s390x gfortran 14.1.0
s390x gfortran 14.2.0
s390x gfortran 14.3.0
s390x gfortran 15.1.0
s390x gfortran 15.2.0
x86 nvfortran 24.11
x86 nvfortran 24.9
x86 nvfortran 25.1
x86 nvfortran 25.3
x86 nvfortran 25.5
x86 nvfortran 25.7
x86-64 gfortran (trunk)
x86-64 gfortran 10.1
x86-64 gfortran 10.2
x86-64 gfortran 10.3
x86-64 gfortran 10.3 (assertions)
x86-64 gfortran 10.4
x86-64 gfortran 10.4 (assertions)
x86-64 gfortran 10.5
x86-64 gfortran 10.5 (assertions)
x86-64 gfortran 11.1
x86-64 gfortran 11.1 (assertions)
x86-64 gfortran 11.2
x86-64 gfortran 11.2 (assertions)
x86-64 gfortran 11.3
x86-64 gfortran 11.3 (assertions)
x86-64 gfortran 11.4
x86-64 gfortran 11.4 (assertions)
x86-64 gfortran 12.1
x86-64 gfortran 12.1 (assertions)
x86-64 gfortran 12.2
x86-64 gfortran 12.2 (assertions)
x86-64 gfortran 12.3
x86-64 gfortran 12.3 (assertions)
x86-64 gfortran 12.4
x86-64 gfortran 12.4 (assertions)
x86-64 gfortran 12.5
x86-64 gfortran 12.5 (assertions)
x86-64 gfortran 13.1
x86-64 gfortran 13.1 (assertions)
x86-64 gfortran 13.2
x86-64 gfortran 13.2 (assertions)
x86-64 gfortran 13.3
x86-64 gfortran 13.3 (assertions)
x86-64 gfortran 13.4
x86-64 gfortran 13.4 (assertions)
x86-64 gfortran 14.1
x86-64 gfortran 14.1 (assertions)
x86-64 gfortran 14.2
x86-64 gfortran 14.2 (assertions)
x86-64 gfortran 14.3
x86-64 gfortran 14.3 (assertions)
x86-64 gfortran 15.1
x86-64 gfortran 15.1 (assertions)
x86-64 gfortran 15.2
x86-64 gfortran 15.2 (assertions)
x86-64 gfortran 4.9.4
x86-64 gfortran 5.5
x86-64 gfortran 6.3
x86-64 gfortran 7.1
x86-64 gfortran 7.2
x86-64 gfortran 7.3
x86-64 gfortran 8.1
x86-64 gfortran 8.2
x86-64 gfortran 8.3
x86-64 gfortran 8.4
x86-64 gfortran 8.5
x86-64 gfortran 9.1
x86-64 gfortran 9.2
x86-64 gfortran 9.3
x86-64 gfortran 9.4
x86-64 ifort 19.0.0
x86-64 ifort 2021.1.2
x86-64 ifort 2021.10.0
x86-64 ifort 2021.11.0
x86-64 ifort 2021.2.0
x86-64 ifort 2021.3.0
x86-64 ifort 2021.4.0
x86-64 ifort 2021.5.0
x86-64 ifort 2021.6.0
x86-64 ifort 2021.7.0
x86-64 ifort 2021.7.1
x86-64 ifort 2021.8.0
x86-64 ifort 2021.9.0
x86-64 ifx (latest)
x86-64 ifx 2021.1.2
x86-64 ifx 2021.2.0
x86-64 ifx 2021.3.0
x86-64 ifx 2021.4.0
x86-64 ifx 2022.0.0
x86-64 ifx 2022.1.0
x86-64 ifx 2022.2.0
x86-64 ifx 2022.2.1
x86-64 ifx 2023.0.0
x86-64 ifx 2023.1.0
x86-64 ifx 2023.2.1
x86-64 ifx 2024.0.0
Options
Source code
! kiss_mkl.F90 -- Procedural interface to oneMKL RCI ISS ! ! This module provides a procedural interface around the ! reverse-communication-based solvers provided in MKL. To use ! these, the caller has to implement a matvec subroutine, which ! is passed as a procedure pointer. ! ! Only double precision is available. ! module kiss_mkl implicit none private public :: dp public :: rci_iss_cache public :: matvec_fun public :: pcg integer, parameter :: dp = kind(1.0d0) type, abstract :: rci_iss_cache integer :: n integer :: ipar(128) real(dp) :: dpar(128) real(dp), allocatable :: tmp(:) integer :: nrestart = 0 procedure(matvec_fun), pointer :: psolve => null() contains procedure(matvec_fun), deferred :: matvec end type abstract interface subroutine matvec_fun(cache,x,y) import rci_iss_cache, dp class(rci_iss_cache) :: cache real(dp), intent(in) :: x(cache%n) real(dp), intent(out) :: y(cache%n) end subroutine end interface real(dp), parameter :: DEFAULT_RTOL = 1.0d-6 real(dp), parameter :: DEFAULT_ATOL = 0 INTERFACE SUBROUTINE DCG(n,x,b,rci_request,ipar,dpar,tmp) INTEGER n, rci_request DOUBLE PRECISION x( * ), b( * ), dpar( * ) DOUBLE PRECISION tmp( n, * ) INTEGER ipar( * ) END SUBROUTINE END INTERFACE INTERFACE SUBROUTINE DCG_INIT(n,x,b,rci_request,ipar,dpar,tmp) INTEGER n, rci_request DOUBLE PRECISION x( * ), b( * ), dpar( * ) DOUBLE PRECISION tmp( n, * ) INTEGER ipar( * ) END SUBROUTINE END INTERFACE INTERFACE SUBROUTINE DCG_CHECK(n,x,b,rci_request,ipar,dpar,tmp) INTEGER n, rci_request DOUBLE PRECISION x( * ), b( * ), dpar( * ) DOUBLE PRECISION tmp( n, * ) INTEGER ipar( * ) END SUBROUTINE END INTERFACE INTERFACE SUBROUTINE DCG_GET(n,x,b,rci_request,ipar,dpar,tmp,itercount) INTEGER n, rci_request, itercount DOUBLE PRECISION x( * ), b( * ), dpar( * ) DOUBLE PRECISION tmp( n, * ) INTEGER ipar( * ) END SUBROUTINE END INTERFACE contains subroutine pcg(cache,x,b,info,rtol,atol,maxiter,silent) class(rci_iss_cache), intent(inout) :: cache real(dp), intent(inout) :: x(cache%n) real(dp), intent(in) :: b(cache%n) integer, intent(out) :: info real(dp), intent(in), optional :: rtol, atol integer, intent(in), optional :: maxiter logical, intent(in), optional :: silent integer :: rci_request, itercount associate(n=>cache%n,ipar=>cache%ipar,dpar=>cache%dpar,tmp=>cache%tmp) call dcg_init(n,x,b,rci_request,ipar,dpar,tmp) if (rci_request /= 0) error stop "Failure in dcg_init" ! Silence warnings and errors if (present(silent)) then if (silent) ipar(6:7) = 0 end if if (present(rtol)) dpar(1) = rtol if (present(atol)) dpar(2) = atol if (present(maxiter)) ipar(5) = maxiter ! Let MKL do the convergence test ipar(8) = 1 ipar(9) = 1 ipar(10) = 0 ! Preconditioning if (associated(cache%psolve)) ipar(11) = 1 ! Let MKL check zero norm of generated vector ipar(12) = 1 call dcg_check(n,x,b,rci_request,ipar,dpar,tmp) if (rci_request /= 0) error stop "Failure in dcg_check" ! FIXME: if ipar(6) == 0 or ipar(7) == 0, we must handles ! errors ourselves revcom: do call dcg(n,x,b,rci_request,ipar,dpar,tmp) if (rci_request == 0) then info = 0 return end if select case(rci_request) case(1) ! Matvec call cache%matvec(tmp(1),tmp(n+1)) case(3) ! Preconditioner call cache%psolve(tmp(2*n+1),tmp(3*n+1)) case default error stop "in iterate loop, unknown request" end select end do revcom call dcg_get(n,x,b,rci_request,ipar,dpar,tmp,itercount) info = itercount end associate end subroutine pcg end module kiss_mkl
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree