Add GPU support for node graph

This commit is contained in:
Dennis
2022-08-01 23:44:18 -07:00
committed by Keavon Chambers
parent bfe21cb179
commit aa5e6f43f6
11 changed files with 232 additions and 52 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ pub struct CacheNode<'n, CachedNode: Node<'n, Input>, Input> {
}
impl<'n, CashedNode: Node<'n, Input>, Input> Node<'n, Input> for CacheNode<'n, CashedNode, Input> {
type Output = &'n CashedNode::Output;
fn eval(&'n self, input: &'n Input) -> Self::Output {
fn eval(&'n self, input: Input) -> Self::Output {
self.cache.get_or_init(|| self.node.eval(input))
}
}