Skip to content

Commit

Permalink
update submod
Browse files Browse the repository at this point in the history
  • Loading branch information
shiinamiyuki committed Nov 22, 2023
1 parent 29a4b03 commit dc8cf05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
23 changes: 19 additions & 4 deletions luisa_compute/examples/vecadd.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use luisa::prelude::*;
use luisa_compute as luisa;
use std::env::current_exe;
#[tracked]

fn main() {
luisa::init_logger();
luisa::init_logger_verbose();
let args: Vec<String> = std::env::args().collect();
assert!(
args.len() <= 2,
Expand All @@ -29,7 +29,7 @@ fn main() {
name: Some("vecadd".into()),
..Default::default()
},
&|buf_z| {
&track!(|buf_z| {
// z is pass by arg
let buf_x = &x; // x and y are captured
let buf_y = &y;
Expand All @@ -39,9 +39,24 @@ fn main() {
let vx = 2.0_f32.var(); // create a local mutable variable
*vx += x; // store to vx
buf_z.write(tid, vx + y);
},
}),
);
kernel.dispatch([1024, 1, 1], &z);
let z_data = z.view(..).copy_to_vec();
println!("{:?}", &z_data[0..16]);
{
let s = device.default_stream();
let t = std::time::Instant::now();
let times = 1000;
let s = s.scope();
for _ in 0..times {

s.submit_with_callback([], ||{
std::hint::black_box(());
});
s.synchronize();
}
let elapsed = t.elapsed().as_micros();
println!("{} us", elapsed as f32 / times as f32);
}
}
2 changes: 1 addition & 1 deletion luisa_compute_sys/LuisaCompute
Submodule LuisaCompute updated 50 files
+4 −0 .gitmodules
+2 −0 docs/.gitignore
+20 −0 docs/Makefile
+7 −0 docs/api/accel.rst
+7 −0 docs/api/buffer.rst
+4 −0 docs/api/builtin.rst
+7 −0 docs/api/func.rst
+7 −0 docs/api/gui.rst
+7 −0 docs/api/image2d.rst
+7 −0 docs/api/image3d.rst
+62 −0 docs/conf.py
+59 −0 docs/index.rst
+35 −0 docs/make.bat
+3 −0 docs/tutorials/autodiff.md
+19 −0 docs/tutorials/installation.md
+24 −0 docs/tutorials/quickstart.md
+1 −0 include/luisa/core/first_fit.h
+4 −4 include/luisa/core/stl/fixed_map.h
+4 −4 include/luisa/core/stl/vector_map.h
+2 −1 include/luisa/core/string_scratch.h
+3 −3 include/luisa/dsl/func.h
+15 −2 include/luisa/dsl/rtx/curve.h
+14 −14 include/luisa/dsl/sugar.h
+3 −3 include/luisa/gui/window.h
+10 −4 include/luisa/vstl/hash_map.h
+42 −9 src/backends/common/hlsl/hlsl_codegen.cpp
+10 −4 src/backends/common/hlsl/hlsl_codegen.h
+19 −5 src/backends/cuda/cuda_stream.cpp
+2 −1 src/backends/cuda/cuda_stream.h
+58 −13 src/backends/dx/DXApi/LCCmdBuffer.cpp
+17 −7 src/backends/dx/DXApi/ext.cpp
+12 −7 src/backends/dx/Resource/ReadbackBuffer.cpp
+21 −19 src/backends/dx/Resource/ReadbackBuffer.h
+2 −8 src/backends/dx/Resource/UploadBuffer.cpp
+52 −4 src/core/first_fit.cpp
+2 −1 src/core/string_scratch.cpp
+42 −35 src/dsl/rtx/curve.cpp
+39 −0 src/ext/CMakeLists.txt
+1 −0 src/ext/imgui
+1 −1 src/ext/spdlog
+4 −4 src/gui/window.cpp
+6 −1 src/py/export_dlpack.cpp
+6 −3 src/py/luisa/buffer.py
+5 −9 src/py/py_stream.cpp
+2 −2 src/rust/CMakeLists.txt
+0 −1 src/rust/Cargo.toml
+1 −0 src/tests/CMakeLists.txt
+4 −4 src/tests/test_curve.cpp
+93 −66 src/tests/test_curve_pbrt.cpp
+369 −0 src/tests/test_curve_pbrt_diffuse.cpp

0 comments on commit dc8cf05

Please sign in to comment.