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

Convert C code to use only int64_t internally #64

Open
astrofrog opened this issue Oct 15, 2017 · 5 comments
Open

Convert C code to use only int64_t internally #64

astrofrog opened this issue Oct 15, 2017 · 5 comments

Comments

@astrofrog
Copy link
Member

At the moment there is a lot of typecasting going on in the C code between int and int64_t. As suggested by @cdeil it would be a lot simpler if we just used int64_t throughout, although there may be a few remaining cases where this is really not needed.

@cdeil cdeil added this to the 0.3 milestone Oct 17, 2017
@lpsinger
Copy link
Contributor

Hmm, what about providing both 32-bit and 64-bit ufuncs?

@astrofrog
Copy link
Member Author

Just to clarify, the issue is that internally for calculations related to indices, 32-bit ints are usually not enough - and the C code currently uses 32-bit ints in places. I think I've switched all the ones that matter to 64-bit, but this issue was just suggesting we could just convert all of them. This is not necessarily related to the int type of the indices passed to the cython functions/ufuncs.

@lpsinger
Copy link
Contributor

But I don't think that you can represent Numpy arrays that require 64-bit indices on a 32-bit machine, can you?

@astrofrog
Copy link
Member Author

astrofrog commented May 20, 2018

@lpsinger - that's true - but just to be clear you can still request for example a 64-bit HEALPix index from e.g. lonlat_to_healpix on a 32-bit machine (and we do test that that works in the CI). So you don't need a 32-bit version of that function. But I agree that I think if you wanted to actually use that index in an array it would be an issue.

@astrofrog
Copy link
Member Author

Just to be clear the original issue here was more about the underlying C library which is not super consistent in when it uses 32- vs 64-bit integers, including on a 64-bit platform (that part of the code knows nothing about Numpy arrays). I think you are talking about the cython or ufunc layer?

@cdeil cdeil modified the milestones: 0.3, 0.4 Oct 24, 2018
@cdeil cdeil modified the milestones: 0.4, 0.5 Jun 5, 2019
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

3 participants