问题:
I'm currently using permute in a gfor loop in the code below. It works fine when K is less 9. However I get the following error when K greater than or equal to 9.
Error using permute
src/cuda/circshift.cpp:129: CUDA runtime error: invalid configuration argument (9)
(src/matlab/calls/permute.cpp:86)
Error in test_permute (line 17)
temp1 = permute(temp,[2 3 1]);
Why is this happening and what can I do to get around it? Perhaps, it's a bug? Given that I have 6 GB of memory on my GPU, it doesn't seem like there should be a problem for matrices of this size. Thanks!
Code:
clear
K = 9;
W = grand(513,K,40);
Z = grand(K,40,1913);
zeros_mat = gzeros(513,K,1913);
gfor q = 1:2
temp_W = W(:,:,q);
temp_Z = Z(:,q,:);
W_tile = bsxfun(@plus, zeros_mat,temp_W);
Z_tile = permute(temp_Z, [2 1 3]);
temp = bsxfun(@plus,W_tile,Z_tile);
temp1 = permute(temp,[2 3 1]);
gend