arrayfire / arrayfire/arrayfire

[BUG] Very simple snippet not working on OpenCL, about af::range, af::dim4 and af::where

Open
#3,414 2 comments 0 reactions 1 assignee Claimed by @umar456 View on GitHub
bug
Dominant language
C++
Stars
4.9k
Forks
555
Avg merge
1h 24m
Merged PRs (30d)
1

Description

Hi,

This very simple snippet is working on the CPU backend, but not on the OpenCL backend.

```
af::setBackend(AF_BACKEND_OPENCL);
af::setDevice(0);
af::info(); std::cout << std::endl;

af::array arrayA = af::range(af::dim4(101, 101, 101), 2, s32);
af::array tmpA = af::where(arrayA == 0);
std::cout << tmpA.dims(0) << std::endl;

af::array arrayB = af::range(af::dim4(141, 141, 141), 2, s32);
af::array tmpB = af::where(arrayB == 0);
std::cout << tmpB.dims(0) << std::endl;
```

I tried on version AF_3.7.3 as well as AF_3.8.3 and AF_3.8.2. None are working correctly on OpenCL. Indeed, on the CPU the answer of tmpB.dims(0) is 19881, but is 0 on OpenCL. The array tmpB, should not be empty.

The problem only appears when the size of the arrayB is getting bigger as arrayA does not cause any issues.

Let me know if you can't reproduce on your end and I could submit more details.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.