Manipulating arrays within GPU arrayfun
显示 更早的评论
I am trying to use GPU arrayfun to perform computations on various subsets of a large array. However it appears that manipulating arrays is not supported by GPU arrayfun. The following minimal example gives the error "Function passed as first input argument contains unsupported or unknown function 'colon'".
function test()
bigarray = rand(5,5);
param = [1 2 3 4];
param = gpuArray(param); %CPU version gives no error
function res=func(p)
subarray = bigarray(p:p+1,1:5);
res = sum(sum(subarray));
end
arrayfun(@func,param)
end
Is there a workaround to the problem?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 GPU Computing in MATLAB 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!