I think that you could use sub(A,:,2:2:4) for BLAS, but not sub(A,:,[2,4])
because the indexing has to be with ranges for BLAS to be able to extract
the right elements of the matrix.

2015-03-29 17:34 GMT-04:00 Dominique Orban <[email protected]>:

> Sorry if this is another [:] kind of question, but I can't seem to find
> the right syntax to call BLAS.gemm! on part of an array. The piece of code
>
> julia> n = 10; m = 5; idx = [2, 4];
> julia> C = rand(n, m); A = rand(n, m); B = rand(m, m);
> julia> BLAS.gemm!('N', 'N', 1.0, A[:,idx], B[:,idx], 1.0, C[:,idx]);
>
> won't modify C. I'm simply trying to do
>
> C[:,idx] += A[:,idx] * B[:,idx];
>
> What's the right syntax here?
>
> It seems ArrayViews.jl might be the way to go, but it doesn't let me do
> view(A, :, idx).
>
> Thanks!
>

Reply via email to