-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make seeds and extract_jacobian gpu-friendly
Use broadcast/macro consistently Fix jac Add AllocationsTest.jl
- Loading branch information
1 parent
4c7495d
commit 23ed88e
Showing
5 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module AllocationsTest | ||
|
||
using ForwardDiff | ||
using BenchmarkTools | ||
|
||
include(joinpath(dirname(@__FILE__), "utils.jl")) | ||
|
||
@testset "Test seed! allocations" begin | ||
x = rand(1000) | ||
cfg = ForwardDiff.GradientConfig(nothing, x) | ||
|
||
balloc = @ballocated ForwardDiff.seed!($(cfg.duals), $x, $(cfg.seeds)) | ||
@test balloc == 0 | ||
|
||
balloc = @ballocated ForwardDiff.seed!($(cfg.duals), $x, $(cfg.seeds[1])) | ||
@test balloc == 0 | ||
|
||
index = 1 | ||
balloc = @ballocated ForwardDiff.seed!($(cfg.duals), $x, $index, $(cfg.seeds)) | ||
@test balloc == 0 | ||
|
||
index = 1 | ||
balloc = @ballocated ForwardDiff.seed!($(cfg.duals), $x, $index, $(cfg.seeds[1])) | ||
@test balloc == 0 | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters