parallel perfix sum in matlab

Hi
I need a code about (perfix sum) by matlab
help me please

Answers (1)

In MATLAB, CUMSUM calculates the prefix sum. You can run this in parallel on a gpuArray like so:
x = gpuArray.rand(1, 100); % random vector
c = cumsum(x);

2 Comments

hadi
hadi on 20 Oct 2014
Edited: hadi on 20 Oct 2014
thanks
but gpuarray have error in matlab:
Cannot find an exact (case-sensitive) match for 'gpuarray'.
Do you want: gpuArray (in C:\Program Files\MATLAB\R2011b\toolbox\distcomp\gpu\gpuArray.m)?
what can I do?
You need to use gpuArray as the error suggests, not gpuarray.

Sign in to comment.

Tags

Asked:

on 19 Oct 2014

Commented:

on 20 Oct 2014

Community Treasure Hunt

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

Start Hunting!