Skip to content

Bug report: Problem with ArrayFire 3.7.0 and AF_BACKEND_CPU #2763

@sebastienleclaire

Description

@sebastienleclaire

Hi,

I want to thank you for your hard work on this release. I'm sorry to report a bug on release day.

Note that the following code snippet is extracted from my code base and give generally random different values with the AF_BACKEND_CPU at every execution even if seed is the same. This is a bug not present in version 3.6.4. The results are constants and I believe as expected with the CUDA and OpenCL backend. Note that i'm using the unified backend.

Note that the problem only occur when any one the following values are true:
af::array id1 = true ? ...
af::array id2 = true ? ...
af::array id3 = true ? ...

The problem does not occurred when changing only
af::array id0 = true ? ...
from true to false, while all the other idX are set to false.

Thank you for fixing. For my application, the version 3.7.0 with the CPU backend seems not usable.

Let me know if you have questions.


af::setBackend(AF_BACKEND_CPU);
af::info();

af::setSeed(0);

af::array signal = af::randu(31, 41, 12, 8, f64);

int dim0 = signal.dims(0);
int dim1 = signal.dims(1);
int dim2 = signal.dims(2);
int dim3 = signal.dims(3);

af::array id0 = false ? af::join(0, af::seq(dim0 - 1, dim0 - 1), af::seq(0, dim0 - 1), af::seq(0, 0)) : af::seq(0, dim0 - 1);
af::array id1 = true  ? af::join(0, af::seq(dim1 - 1, dim1 - 1), af::seq(0, dim1 - 1), af::seq(0, 0)) : af::seq(0, dim1 - 1);
af::array id2 = true  ? af::join(0, af::seq(dim2 - 1, dim2 - 1), af::seq(0, dim2 - 1), af::seq(0, 0)) : af::seq(0, dim2 - 1);
af::array id3 = true  ? af::join(0, af::seq(dim3 - 1, dim3 - 1), af::seq(0, dim3 - 1), af::seq(0, 0)) : af::seq(0, dim3 - 1);

signal = signal(id0, id1, id2, id3);

T theSum = af::sum<T>(abs(signal));

std::cout << "theSum: " << std::setprecision(16) << theSum << std::endl;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions