Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Programming Parallelism
SIMD
MIMD
#define START (n % 4)
#define START (n % 4)
Notice what
we are loading
into j_on_steroids?
#define START (n % 4)
#define START (n % 4)
We see that
j += START. Where
else do we notice
that START is bein
used to calculate?
#define START (n % 4)
#define START (n % 4)
#define J_INIT 1
Next will be
STEROIDS_INIT.
We see that this
Is being added
to the set1 of
START.
#define START (n % 4)
#define J_INIT 1
#define START (n % 4)
#define J_INIT 1
Since initial is
Added to set1.
Then, we can
see that we want
each field
Initialized
Differently.
#define START (n % 4)
#define J_INIT 1
Example:
If START = 2.
Want the vector
Going into main
Loop to contain
{3, 4, 5, 6}
#define START (n % 4)
#define J_INIT 1
{3, 4, 5, 6}
Therefore
{2, 2, 2, 2} +
{a, b, c, d}?
{1, 2, 3, 4}
#define START (n % 4)
#define J_INIT 1
#define STEROIDS_INIT \
{1, 2, 3, 4}
Last thing we
Want to find
Is where to
END the loop?
#define START (n % 4)
#define J_INIT 1
#define STEROIDS_INIT \
{1, 2, 3, 4}
Keep in mind
The constraints
Of the problem.
What is the
Last index that we
Need to keep track
#define START (n % 4)
#define J_INIT 1
#define STEROIDS_INIT \
{1, 2, 3, 4}
In differentiation
the nth term falls
off!
So this means
END = (n-1)