arrayfire / arrayfire/arrayfire-rust

[BUG] `Array::get_backend()` can never return `OPENCL`

オープン 初心者向け
#387 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Bug
主要言語
Rust
スター
827
フォーク
59
PR マージ指標
30日以内にマージされた PR はありません

説明

[`src/core/array.rs:392-404`](https://github.com/arrayfire/arrayfire-rust/blob/master/src/core/array.rs#L392-L404):

```rust
match (err_val, ret_val) {
(0, 1) => Backend::CPU,
(0, 2) => Backend::CUDA,
(0, 3) => Backend::OPENCL,
_ => Backend::DEFAULT,
}
```

`af_backend` is a bit-flag enum, not sequential (`include/af/defines.h:414-417`, v3.8.0):

```c
AF_BACKEND_DEFAULT = 0,
AF_BACKEND_CPU = 1,
AF_BACKEND_CUDA = 2,
AF_BACKEND_OPENCL = 4
```

There is no backend with value 3. An OpenCL-created array returns 4, falls through to the wildcard, and is reported as `Backend::DEFAULT`.

**Fix:** `(0, 4) => Backend::OPENCL`.

---

Found by Claude Opus 5

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with src/core/array.rs:392-404 and compare the backend values in include/af/defines.h:414-417. Update the mapping so an OpenCL-created array is reported as Backend::OPENCL, then run the existing test suite or backend-related tests to verify the result.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
backend
issue の種類
バグ
難易度
1/5
見積もり時間
1時間未満
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
88/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。