'if' and 'while' statements within a SIMD architecture and its memory architecture

I am doing some past exam papers and I found two interesting questions which I cannot answer due to them not being extensively covered in the lecture notes given to me by my lecturer.

The questions go like this:

"Explain the mechanism a SIMD computer uses to support conditional statements like if and while."

SIMD is essentially a class of parallel computers in Flynn's taxonomy and it describes computers with multiple processing elements that perform the same operation on multiple data points simultaneously. SIMD is also referred to as vector processing which leads to believe that I should have all my computations made to handle vectors as input than anything else, or am I thinking too much in a 'sequential' manner?

and:

"Would you regard SIMD as a shared or a distributed memory architecture? Explain your choice."

It is a shared memory architecture as it uses data and instruction pools from which it can do its processes. I am struggling with answering this question as I cannot come up with a proper way of expressing myself in order to answer it.

• Your thinking is right, and conditional statements are the curse of SIMD processing (you can't continue filling up the pipeline, if you run into conditional statement). Think of techniques that mitigate this problem? – randomsurfer_123 Jan 1 '18 at 18:58
• I cannot come up with a proper example for it. I thought of writing a simple program which works on a vector of integers and adds the number one to them so it would need a vector input and will output a vector. Would that be a sufficient answer? – Green Manalishi Jan 1 '18 at 19:26
• @GreenManalishi Where is the if / while condition in this? How would you implement "for (i = 0; i < 100; ++i) if (x [i] > 0) y [i] += z [i];" ? Once for the case that 99% of all x[i] are greater than 0, once for the case that 50% are greater than 0, assuming that the developer knows which one is the case. – gnasher729 Jan 1 '18 at 22:33
• I assumed that while statement will be on to look for a constant vector input and the if statement would be used for incoming and outgoing input (i.e if inputVal==0 {skip} or something in those lines). But I do agree it is a silly example but I really cannot come up with anything.... – Green Manalishi Jan 1 '18 at 23:08
• I gave you an example. – gnasher729 Jan 2 '18 at 18:57