-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
use copy_to in assign() and ref() where possible #190
Comments
The only place where memcpy can be used is in ref() and assign() when the input is a Range1. Otherwise, we need a strided memcpy. BLAS has such a thing, but in the case of openblas, it turns out to be significantly slower than memcpy on large regions. |
I think that something like this should cover most cases for ref, and the same can be done for assign. function ref{T}(A::Array{T}, I::Range1) |
We should avoid using |
Yes, I was trying to avoid it. Do we have such copy functions defined? I was in fact thinking of doing exactly the same. |
I just pushed a semi-working draft of this to the arrays branch. It only works for ref (not assign), and it's not complete. In some cases it seems to give an improvement in the range of 2-fold or so. Not as big a deal as the linear indexing from a couple days ago, and it's more code, but perhaps still worth doing. Testing this: start from master and run test/arrayperf.jl. Then switch to arrays, make, and do the same thing. Only the "whole array" and "contiguous blocks" of "ref" are relevant. @JeffBezanson, one hitch will be turning on the passing of Colon() objects---you can see that for now I bypassed that issue by making changes to arrayperf. Colons in successive dimensions are combined until the first non-colon index, allowing a single memcpy call to handle multiple dimensions when possible. For dimensions after the first non-colon index, any remaining colons need to be replaced by Range1{Int}s, which in this branch is currently done at runtime by the function replace_colons (in array.jl). It would be nice to get rid of replace_colons: in some cases, e.g., the non-contiguous cases, this function can make the performance worse than what's currently in master. So: rather than changing the compiler so that all colons pass though, can we keep the compiler's current behavior for those colons that need to be replaced? I.e., the ones after the first non-colon index? |
* Add in Rényi entropies. * Add in comments on which entropies are used * Add in dependency for Distributions, and qualification for span() as it is in Distributions and StatsBase. * Add in Renyi entropy tests. * Removed dependences on Distributions.jl. * Adding in testing for generalised probability distributions (sum(p) != 1). * No longer variable length. * Unnecessary qualification now tests don't use Distributions.jl. * Correct to american spelling.
assign is a kernel for cat and some other functions.
The text was updated successfully, but these errors were encountered: