-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix adjoint memory leak in ExpressionGraph
There was a circular reference between adjoints and their parent expressions that prevented them from being freed. The adjoints are now unlinked when they're no longer needed. The Hessian tests were instrumented to confirm all Expressions were freed at the end of each test. PoolResource and PoolAllocator were restructured to take the chunk size at runtime for ease of use, and the default chunk size was reduced to 16384.
- Loading branch information
Showing
6 changed files
with
86 additions
and
54 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 was deleted.
Oops, something went wrong.
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,12 @@ | ||
// Copyright (c) Sleipnir contributors | ||
|
||
#include "sleipnir/util/Pool.hpp" | ||
|
||
namespace sleipnir { | ||
|
||
PoolResource& GlobalPoolResource() { | ||
static PoolResource pool{16384}; | ||
return pool; | ||
} | ||
|
||
} // namespace sleipnir |
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