Hello,

I was trying to implement multiplication of 2D array by a single constant using raspi's GPU. I read the documentation that Broadcom released and I think I "so-so" understand the concept of using mailbox.c to access GPU.

The thing is I have very little experience with writing assembler code. Thus, all my attempts to write simple code for multiplication failed. My guide was

http://rpiplayground.wordpress.com/2014 ... ofit-pt-1/
Later, I discovered this(gemm) example. I have got it running on my Pi. However I would like to give it my own input : A and B square matrices

where A is a regular matrix I want to multiply by a constant c and B is diagonal matrix with the multiply constant.

since A*c == A * B.

However upon looking into the code I didn't grasp where can I change what the gpu multiplies.

Code: Select all

```
const int inputChannels = 363;
const int inputHeight = 3025;
const int outputChannels = 96;
Buffer* input = new Buffer(Dimensions(inputHeight, inputChannels));
```

What do these constants represent ? Somehow I fail to imagine how is the code defining what matrices is it going to multiply...

I think it should be in the arguments of

Code: Select all

```
void qpu_cblas_sgemm(
int order,
int transposeA,
int transposeB,
int m,
int n,
int k,
float alpha,
uint32_t a,
float aMin,
float aMax,
int aBitsPerElement,
int lda,
uint32_t b,
int ldb,
float beta,
uint32_t c,
int ldc)
```

but again I can't figure out how the matrices are represented by this arguments.

My last attempt to understand the code was compiling the code with

*-g* flag so I could

*sudo gdb --tui ./gemm*
Even this didn't help me much in understanding code since the line cursor just jumps as if from higher line numbers to lower sometimes.

I thought that I might just not understand the interpretation if

*gdb* so I tried it with

*ddd* but the result is same.

Long story short

Please could you somehow help me with implementing my own inputs for matrix multiplication using GPU? Or at least understanding the code.

Thank you in advance.