Skip to content

fix overflow bug in the dot product#2

Open
btel wants to merge 3 commits into
sdiehl:masterfrom
btel:master
Open

fix overflow bug in the dot product#2
btel wants to merge 3 commits into
sdiehl:masterfrom
btel:master

Conversation

@btel

@btel btel commented Jan 27, 2015

Copy link
Copy Markdown

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

btel commented Jan 27, 2015

Copy link
Copy Markdown
Author

Great tutorial! Thanks for the work.

@btel

btel commented Jan 27, 2015

Copy link
Copy Markdown
Author

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

@sdiehl

sdiehl commented Jan 27, 2015

Copy link
Copy Markdown
Owner

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

btel commented Jan 27, 2015

Copy link
Copy Markdown
Author

done! you should see it in the PR.

@sdiehl

sdiehl commented Jan 27, 2015

Copy link
Copy Markdown
Owner

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.

2 participants