[go: up one dir, main page]

Menu

[r30]: / client / testspe.cpp  Maximize  Restore  History

Download this file

42 lines (28 with data), 697 Bytes

 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
41
#include "speclient.h"
using namespace cb;
int main(int argc, char** argv)
{
SPEClient sc;
sc.connect(argv[1], atoi(argv[2]));
STREAM s;
s.m_strDataFile = "stream.dat";
s.m_iUnitSize = 8;
sc.createJob(s, "myProc");
sc.run();
while (true)
{
char* res;
int size;
if ((-1 == sc.read(res, size)) || (0 == size))
break;
cout << "read one block " << size << endl;
for (int i = 0; i < size; i += 4)
cout << *(int*)(res + i) << endl;
}
sc.releaseJob();
return 0;
}
// user defined process
//int myProc(const char* unit, const int& size, char* result, int& rsize, const char* param, const int& psize)
//{
//}