From ea6cd1554a38df666bc7108fd38f9bc1e954746b Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Wed, 16 Oct 2024 22:05:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E6=98=AF=E5=93=A5=E4=BB=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 3 +-- src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8637a5a..8b64565 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,4 @@ edition = "2021" [dependencies] anyhow = { version = "1.0", features = ["backtrace"] } -opencl3 = { version = "0.9.5", features = ["serde", -"cl_khr_create_command_queue"] } +opencl3 = { version = "0.9.5", features = ["serde"] } diff --git a/src/main.rs b/src/main.rs index 2710722..76ade9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,14 +48,14 @@ fn main() -> anyhow::Result<()> { let context = Context::from_device(&device).expect("Context::from_device failed"); let property = CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE; - let queue = match CommandQueue::create_with_properties_khr( + let queue = match CommandQueue::create_default_with_properties( &context, - device_id, - &[], // 写死试试, 看起来没问题 + 0, + 10, // 写死试试, 看起来没问题 ) { Ok(q) => q, Err(err) => { - println!("创建命令队列失败: {}", err); + println!("创建命令队列失败: {}, 属性: {}", err, 0); panic!(); } };