Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summation of vector elements using QPULib #68

Open
NazaninDelazimi opened this issue Oct 31, 2018 · 1 comment
Open

Summation of vector elements using QPULib #68

NazaninDelazimi opened this issue Oct 31, 2018 · 1 comment

Comments

@NazaninDelazimi
Copy link

Hi,
I use this code that you suggested befor but receive this error what is the problem ?

Int v;
...
v = v + rotate(8, v);
v = v + rotate(4, v);
v = v + rotate(2, v);
v = v + rotate(1, v);

D.cpp:13:20: error: call of overloaded ‘rotate(int, Int&)’ is ambiguous
v = v + rotate(1, v);
^
In file included from ../Lib/QPULib.h:4:0,
from ID.cpp:1:
../Lib/Source/Int.h:61:9: note: candidate: IntExpr rotate(IntExpr, IntExpr)
IntExpr rotate(IntExpr a, IntExpr b);
^~~~~~
../Lib/Source/Int.h:62:11: note: candidate: FloatExpr rotate(FloatExpr, IntExpr)
FloatExpr rotate(FloatExpr a, IntExpr b);

thank you.

@robiwano
Copy link

robiwano commented Nov 1, 2018

The rotate functions takes operand to rotate as first argument, and amount to rotate as second, so:

v = v + rotate(v, 8);
v = v + rotate(v, 4);
v = v + rotate(v, 2);
v = v + rotate(v, 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants