Skip to content

Commit eec1139

Browse files
committed
Use implicit interface in square example
1 parent 27b7edc commit eec1139

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

enzyme/test/Fortran/ReverseMode/square.f90

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
! RUN: if [ %llvmver -ge 13 ]; then ifx -flto -O3 -c %s -o /dev/stdout | %opt %loadEnzyme -enzyme -o %t && ifx -flto -O3 %t -o %t1 && %t1 | FileCheck %s; fi
55

66
module math
7-
interface
8-
subroutine square__enzyme_autodiff(fn, x, dx)
9-
interface
10-
real function fn_decal(a)
11-
real, intent(in) :: a
12-
end function
13-
end interface
14-
procedure(fn_decal) :: fn
15-
real, intent(in) :: x
16-
real, intent(inout) :: dx
17-
end subroutine
18-
end interface
197
contains
208
real function square( x )
219
real, intent(in) :: x
@@ -26,13 +14,14 @@ end module math
2614
program app
2715
use math
2816
implicit none
17+
external :: __enzyme_autodiff
2918
real :: x, dx
3019

3120
x = 3
3221
print *, square(x)
3322

3423
dx = 0
35-
call square__enzyme_autodiff(square, x, dx);
24+
call __enzyme_autodiff(square, x, dx);
3625

3726
print *, dx
3827
end program app

0 commit comments

Comments
 (0)