[vsipl++] [patch] Fix stride for CBE float vmul
Jules Bergmann
jules at codesourcery.com
Wed Dec 24 19:28:16 UTC 2008
Don McCoy wrote:
> Jules Bergmann wrote:
>> Stride is passed down in elements, not bytes!
>>
>>
> This looks good, but I had a couple of minor questions/comments.
Don,
Thanks for looking over this!
>> Rand<T> gen(0, 0);
>> - A = gen.randu(size);
>> - B = gen.randu(size);
>> +// A = gen.randu(size);
>> +// B = gen.randu(size);
>>
> Did you mean to leave this commented out?
Good catch! No, I didn't mean to leave this in, but I made a second
silent checkin afterwards that fixed it.
>
>>
>> @@ -61,7 +61,7 @@
>> std::cout << "A(i) * B(i) = " << A(i) * B(i) << std::endl;
>> }
>> #endif
>> - test_assert(almost_equal(Z(i), A(i) * B(i)));
>> + test_assert(almost_equal(Z.get(i), A(i) * B(i)));
>>
> For consistency, should we use .get for all accesses (or drop it)? I
> guess for tests we ought to always use it, in my opinion.
Using get() is probably best.
Here it is a correctness issue. If A is split complex, A(i) returns an
Lvalue_proxy, and no operator*() can be found to handle it. Using
A.get(i) returns a complex, and all is fine.
-- Jules
--
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
More information about the vsipl++
mailing list