Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct {
- int threadNum;
- int maxThreads;
- } multParam;
- void *multiplier(void *param)
- {
- int i, j, k, currentRow = 0;
- multParam *threadData = (multParam *)(param);
- currentRow = threadData->threadNum;
- for (i = 0; currentRow < N; i++)
- {
- for (j = 0; j < P; j++)
- {
- C[currentRow][j] = 0;
- for (k = 0; k < M; k++)
- {
- C[currentRow][j] += A[currentRow][k] * B[k][j];
- }
- }
- currentRow = (i * threadData->maxThreads) + threadData->threadNum;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement