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

fix overflow bug in the dot product #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

btel
Copy link

@btel btel commented Jan 27, 2015

The dot example gives wrong result due to an overflow in int32 accumulator. This PR fixes it by working with int64 arrays instead. To make this change feasible the following changes were implemented:

  • introduced int64 bit types
  • fixed visit_Loop method of TypeInfer to use consistently int32 on start, increment and end condition,
  • second argument to alloca was change to keyword argument for compatiblity with the new llvmpy

@btel
Copy link
Author

btel commented Jan 27, 2015

Great tutorial! Thanks for the work.

@btel
Copy link
Author

btel commented Jan 27, 2015

BTW I did not have time to update numpile.py, but it should be easily done.

@sdiehl
Copy link
Owner

sdiehl commented Jan 27, 2015

It's hard to read the git diff for the changes to the type inference from the IPython notebook dump. Can you make the change in numpile.py?

@btel
Copy link
Author

btel commented Jan 27, 2015

done! you should see it in the PR.

@sdiehl
Copy link
Owner

sdiehl commented Jan 27, 2015

LGTM, I'll just pull it and make sure everything builds fine.

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

Successfully merging this pull request may close these issues.

None yet

2 participants