-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Utilities for splitting and unsplitting mode objects (#1979)
* Utilities for splitting and unsplitting mode objects * Remove Manifest * Rename and add tests * Add ABI tests * Fix tests * Add set_abi on mode type * Rename to Split and Combined
- Loading branch information
Showing
3 changed files
with
126 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using EnzymeCore | ||
using EnzymeCore: InlineABI, ReverseModeSplit, Split, Combined, set_runtime_activity, set_err_if_func_written, set_abi | ||
using Test | ||
|
||
@testset "Split / unsplit mode" begin | ||
@test Split(Reverse) == ReverseSplitNoPrimal | ||
@test Split(ReverseWithPrimal) == ReverseSplitWithPrimal | ||
@test Split(ReverseSplitNoPrimal) == ReverseSplitNoPrimal | ||
@test Split(ReverseSplitWithPrimal) == ReverseSplitWithPrimal | ||
|
||
@test Split(set_runtime_activity(Reverse)) == set_runtime_activity(ReverseSplitNoPrimal) | ||
@test Split(set_err_if_func_written(Reverse)) == set_err_if_func_written(ReverseSplitNoPrimal) | ||
@test Split(set_abi(Reverse, InlineABI)) == set_abi(ReverseSplitNoPrimal, InlineABI) | ||
|
||
@test Split(Reverse, Val(:ReturnShadow), Val(:Width), Val(:ModifiedBetween), Val(:ShadowInit)) == ReverseModeSplit{false,:ReturnShadow,false,:Width,:ModifiedBetween,EnzymeCore.DefaultABI,false,false,:ShadowInit}() | ||
|
||
@test Combined(Reverse) == Reverse | ||
@test Combined(ReverseWithPrimal) == ReverseWithPrimal | ||
@test Combined(ReverseSplitNoPrimal) == Reverse | ||
@test Combined(ReverseSplitWithPrimal) == ReverseWithPrimal | ||
|
||
@test Combined(set_runtime_activity(ReverseSplitNoPrimal)) == set_runtime_activity(Reverse) | ||
@test Combined(set_err_if_func_written(ReverseSplitNoPrimal)) == set_err_if_func_written(Reverse) | ||
@test Combined(set_abi(ReverseSplitNoPrimal, InlineABI)) == set_abi(Reverse, InlineABI) | ||
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