From dd0474955adde987309895dd79317f7f02e68cec Mon Sep 17 00:00:00 2001 From: Xiaochun Tong Date: Thu, 19 Oct 2023 18:54:03 -0400 Subject: [PATCH] update submod; autodiff with callables --- luisa_compute/tests/autodiff.rs | 14 +++++++++----- luisa_compute_sys/LuisaCompute | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/luisa_compute/tests/autodiff.rs b/luisa_compute/tests/autodiff.rs index dbd0902..d419ea9 100644 --- a/luisa_compute/tests/autodiff.rs +++ b/luisa_compute/tests/autodiff.rs @@ -1371,11 +1371,15 @@ fn autodiff_callable2() { let callable = Callable::, Expr, Expr) -> Expr>::new( &device, track!(|x, y, t| { - switch::>(t) - .case(0, || x * 4.0) - .case(1, || x * 2.0) - .case(2, || y * 0.5) - .finish() + let ret = 0.0f32.var(); + outline(|| { + *ret = switch::>(t) + .case(0, || x * 4.0) + .case(1, || x * 2.0) + .case(2, || y * 0.5) + .finish(); + }); + **ret }), ); let kernel = Kernel::::new( diff --git a/luisa_compute_sys/LuisaCompute b/luisa_compute_sys/LuisaCompute index 8eab5cb..e91b0e8 160000 --- a/luisa_compute_sys/LuisaCompute +++ b/luisa_compute_sys/LuisaCompute @@ -1 +1 @@ -Subproject commit 8eab5cb80eafcba6c969258fb8c63b1105580703 +Subproject commit e91b0e8c6d92fb11f9729dc3875d19ef55820bd9