From 61afe5b63f88af9774cc215440f63b843b30dff0 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 16 Oct 2024 21:52:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E8=AF=95=E8=BF=99=E6=A0=B7=E5=91=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d53bc70..9ce92d5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,7 +50,7 @@ fn main() -> anyhow::Result<()> { let property = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; let queue = match CommandQueue::create_default_with_properties( &context, - property, + 0, 10, // 写死试试, 看起来没问题 ) { Ok(q) => q, @@ -149,9 +149,13 @@ fn main() -> anyhow::Result<()> { .set_global_work_size(worker_count as usize) .enqueue_nd_range(&queue)? }; + let start_tick = std::time::Instant::now(); kernel_event.wait()?; + let end_tick = std::time::Instant::now(); queue.finish()?; + println!("外置计时: {:?}", end_tick - start_tick); + if !output.is_fine_grained() { unsafe { queue.enqueue_svm_map(CL_BLOCKING, CL_MAP_WRITE, &mut output, &[]) }?; }