Skip to content

Commit

Permalink
Test hypot error with CI (#990)
Browse files Browse the repository at this point in the history
* hypot test

* Remove other tests

* fix

* Revert "Remove other tests"

This reverts commit 5ea8cb9.

---------

Co-authored-by: William S. Moses <[email protected]>
  • Loading branch information
jgreener64 and wsmoses authored Aug 8, 2023
1 parent ba4cc81 commit 21763d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7160,6 +7160,9 @@ function ptr_rule(direction::Cint, ret::API.CTypeTreeRef, args::Ptr{API.CTypeTre
end

function inout_rule(direction::Cint, ret::API.CTypeTreeRef, args::Ptr{API.CTypeTreeRef}, known_values::Ptr{API.IntList}, numArgs::Csize_t, val::LLVM.API.LLVMValueRef)::UInt8
if numArgs != 1
return UInt8(false)
end
inst = LLVM.Instruction(val)
ce = operands(inst)[1]
while isa(ce, ConstantExpr)
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ end
end
@test autodiff(Reverse, f9, Active, Active(2.0))[1][1] == 8
@test autodiff(Forward, f9, Duplicated(2.0, 1.0))[1] == 8

f10(x) = hypot(x, 2x)
@test autodiff(Reverse, f10, Active, Active(2.0))[1][1] == sqrt(5)
end

@testset "Taylor series tests" begin
Expand Down

0 comments on commit 21763d7

Please sign in to comment.