Add GPU support for node graph

This commit is contained in:
Dennis
2022-04-24 11:58:31 +02:00
committed by Keavon Chambers
parent 49c171b419
commit f6e4dbf3e3
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))
}
}