[BUG] opencl-interop `get_device_type` always returns `DeviceType::ALL`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the get_device_type function shown in the issue and compare its return mapping with the AFCL_DEVICE_TYPE_UNKNOWN value and cl-sys DeviceType definitions linked in the report. Confirm the intended handling of the ArrayFire unknown value and verify that it no longer reports DeviceType::ALL.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Rust
- Stars
- 827
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arrayfire/arrayfire-rust
-
Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
arrayfire/arrayfire-rust#388 ·
-
Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
arrayfire/arrayfire-rust#387 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
arrayfire/arrayfire-rust#386 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
arrayfire/arrayfire-rust#384 ·
-
Bug
Difficulty 5/5 Over a week Newbie friendliness 35/100
arrayfire/arrayfire-rust#385 · 1 comment ·
All issues in arrayfire/arrayfire-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug team:backend track:services-maintenance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cowprotocol/services#4950 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·