-
Notifications
You must be signed in to change notification settings - Fork 0
/
VirtMatrixThreads.h
40 lines (32 loc) · 1.2 KB
/
VirtMatrixThreads.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <assert.h>
#include "Allocator.h"
using namespace std;
/**
Thread code for VirtSquareMatrix
*/
// data for thread
typedef struct ThreadData {
size_t numthreads; // number of threads
void *upperrow; // pointer to lead row
void *b; // pointer to RHS for leading row
size_t stepsright; // active row length in XMM registers
size_t shiftdown; // offset to next row
size_t numstepsdown; // number of rows below lead row
size_t rowoffset; // offset down in rows from leading row
void init(const size_t numThreads)
{
numthreads = numThreads;
upperrow = b = NULL;
stepsright = shiftdown = numstepsdown = 0;
rowoffset = 1;
}
} ThreadData;
// thread function
void ThreadProc4(ThreadData *data);
// thread function
void ThreadProc8(ThreadData *data);
// thread function
void ThreadProcFloat(ThreadData *data);
// thread function
void ThreadProcDouble(ThreadData *data);