Use arrayfun when function has multiple inputs, being one the gpuArray

So, I have a gpuArray to which I would like to chunk into small pieces. I created a function to do exactly that:
function [ splitted_signal ] = ChunkSignals(b_factor, n_chunks, signal)
% Do things
My problem is, when I'm trying to use the function:
split2 = arrayfun(@ChunkSignalsb_factor, n_chunks, signal_2);
It doesn't work. How can I pass my signal (the gpuArray) as an input for this function? Or should I just skip it?
Since my goal here is to process a large data as fast as I can, using the GPU, I want to divide my signal into threads.
Thanks in advance.

댓글 수: 2

Adam
Adam 2015년 10월 30일
편집: Adam 2015년 10월 30일
Have you tried making n_chunks and b_factor into gpuArrays too?
I don't know much about using arrayfun on the gpu, but it is supported. I'm not sure if you can mix and match CPU and GPU inputs in it though. I would assume you would have to use ether the CPU overload or the GPU overload.
(Also I assume you just pasted your code in wrong as you are missing a comma after @ChunkSignals in your arrayfun)
Do you want it to work on each element of signal2 or the whole array at once?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 GPU Computing in MATLAB에 대해 자세히 알아보기

질문:

Ana
2015년 10월 30일

댓글:

2015년 10월 30일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by