[BUG] opencl-interop `get_device_type` always returns `DeviceType::ALL`
还没有人认领这个 Issue。
评估
调研方向
从 issue 中显示的 get_device_type 函数开始,将其返回值映射与 AFCL_DEVICE_TYPE_UNKNOWN 值以及报告中链接的 cl-sys DeviceType 定义进行比较。确认对 ArrayFire unknown 值的预期处理,并验证它不再报告 DeviceType::ALL。
由索引模型根据 Issue 内容生成。
描述
Description
The get_device_type function transmutes the value -1 into DeviceType or returns DeviceType::ALL; however, the enum variant that corresponds to the value (-1i32 as u64) is DeviceType::ALL. This does not seem to be the intended behaviour.
///// Fetch Active ArrayFire device's type i.e. CPU/GPU/Accelerator etc.
pub fn get_device_type() -> DeviceType {
let mut out: i32 = 0;
let err_val = unsafe { afcl_get_device_type(&mut out as *mut c_int) };
handle_error_general(AfError::from(err_val));
match out {
-1 => unsafe { mem::transmute(out as u64) },
_ => DeviceType::ALL,
}
}
The value of -1 corresponds to AFCL_DEVICE_TYPE_UNKNOWN in arrayfire, whilst -1 corresponds to CL_DEVICE_TYPE_ALL in cl-sys
- 主要语言
- Rust
- 星标
- 827
- 派生
- 59
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
arrayfire/arrayfire-rust 的其他 Issue
-
Bug
难度 1/5 1 小时以内 新手友好度 88/100
arrayfire/arrayfire-rust#388 ·
-
Bug
难度 1/5 1 小时以内 新手友好度 88/100
arrayfire/arrayfire-rust#387 ·
-
Bug
难度 2/5 1-3 小时 新手友好度 78/100
arrayfire/arrayfire-rust#386 ·
-
Bug
难度 2/5 1-3 小时 新手友好度 76/100
arrayfire/arrayfire-rust#384 ·
-
Bug
难度 5/5 一周以上 新手友好度 35/100
arrayfire/arrayfire-rust#385 · 1 条评论 ·
查看 arrayfire/arrayfire-rust 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gitbutlerapp/gitbutler#15998 · 1 条评论 ·
-
bug triage:deciding
难度 1/5 1 小时以内 新手友好度 88/100
open-telemetry/otel-arrow#4132 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100