-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Docs on ccall and array order #41986
Comments
I think it would be worth pointing out there that Julia uses Fortran-standard order with columns first, while C codes often use rows first, although there is no standard. |
I don't think there is anything to be done here: there is no standard way to store matrices in C; so you simply need to know about the C code you are calling and what data format it uses. At best, one could add a sentence somewhere pointing out just that. |
...
What do yous mean? It is literally part of the C standard. No? From the C-2x standard working draft September 25, 2019 ISO/IEC 9899:202x (E)
Even if we go back to the C-89 standard, i.e. ANSI C.
This has always been part of the standard.
I feel like there unquestionably is. Regardless, we absolutely can have a short paragraph or two explaining how julia stores things in memory, and contrasting that to what you will normally get out of a C or Fortran compiler. |
Sorry I misread (100% my fault resp that of my brain) your question as pertaining to matrices; not double/multi indexed arrays; those are indeed standarized. |
When
ccall
ing some code that returned an arrays in C order, I found that my results was all out of order.Adding some
permutedim
s fixed it.But I can't find any docs on C vs Fortran order when doing ccalls.
It isn't mentioned at all on
https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/index.html
The only place it is mentioned as far as i cabn tell is in the performance tips section.
The text was updated successfully, but these errors were encountered: