Feature request: slice/slices, mapslices
Could we have this feature in julia: http://arrayfire.org/docs/group__array__mem__slice.htm? And does it allow mapslices into AFArray?
That's just an alias to indexing, so slice(a, i) = a[:, :, i]
Thanks. In that case, could you support create_seq(::Base.Slice{Base.OneTo{Int64}})? Then mapslices should work!
I don't think that's enough to support mapslices :(
Thanks, I've added mapslices to the title. Is it likely to be supported in the near future? It seems useful.
Can current ArrayFire.jl do similarly to the following C++ code snippet?
int n = 8, int m = 8; // dimensions
int t = 10; // number of different matricies
array A = randu(m,n,t); // many matricies
array B = randu(m,n); // one matrix
array C = zeros(m,n,t); // destination
// multiply C=A*B for all A, at the same time
gfor (array i, A.dims(2)) {
C(span,span,i) = matmul(A(span,span,i), B);
}
print( A );
print( B );
print( C );
ref: https://stackoverflow.com/questions/13051326/multiplying-hundreds-of-matrices-using-cuda
a = rand(AFArray, 3, 3, 9)
b = rand(AFArray, 3, 3, 9)
a * b
Would do 9 matrix multiplies of 3x3 slices
Many thanks!
You might need the latest version of ArrayFire for this to work, was only added recently https://github.com/arrayfire/arrayfire/pull/1898