Flip matrix gives a "divison by zero" exception

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

Flip matrix gives a "divison by zero" exception

Postby rm9 » Thu Jan 30, 2014 6:34 am

Hi,

I'm try to flip a matrix of size [249 1 50 20], this is the code:
Code: Select all
printdims(delta);
array flipped_delta = flip(delta, 0);


I get the following exception:
Code: Select all
Unhandled exception at 0x00000001801FCA92 (libafcu.dll) in r.exe: 0xC0000094: Integer division by zero.


What am I doing wrong?
thanks.
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am

Re: Flip matrix gives a "divison by zero" exception

Postby rm9 » Thu Jan 30, 2014 11:45 am

It seems like this is a bug due to the singleton dimension, if I remove it then it works correctly.
I wish it would always work since the dimension of this matrix are dynamic, could be 1, could be more, so it would be nice to have one working code instead of a condition.

Thanks.
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am

Re: Flip matrix gives a "divison by zero" exception

Postby shehzan » Thu Jan 30, 2014 11:51 am

Hi,

I have looked into the code you have provided and found that the problem exists in flipping the 4th dimension.
We will work on fixing this bug asap.

A quick and dirty fix for this is (to get you going while we fix this issue):
Code: Select all
array flipped(delta.dims());
for(int i = 0; i < delta.dims(3); i++) {
    flipped(span, span, span, i) = flip(delta(span, span, span, i), 0);
}
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Flip matrix gives a "divison by zero" exception

Postby shehzan » Thu Jan 30, 2014 11:52 am

I understand your concerns for it to work and we share those concerns.
We will fix this code immediately and make a release for it.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Flip matrix gives a "divison by zero" exception

Postby rm9 » Thu Jan 30, 2014 11:52 am

Thanks!
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am


Return to [archive-commercial] Programming & Development with ArrayFire

cron