forked from makortel/pixel-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.h
27 lines (20 loc) · 777 Bytes
/
input.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
#ifndef input_h_
#define input_h_
#include <fstream>
#include "pixelgpudetails.h"
struct alignas(128) Input {
SiPixelFedCablingMapGPU cablingMap;
unsigned int word[pixelgpudetails::MAX_FED_WORDS];
unsigned char fedId[pixelgpudetails::MAX_FED_WORDS];
unsigned int wordCounter;
};
inline Input read_input() {
Input ret;
std::ifstream file{"dump.bin", std::ios::binary};
file.read(reinterpret_cast<char *>(&ret.cablingMap), sizeof(SiPixelFedCablingMapGPU));
file.read(reinterpret_cast<char *>(&ret.wordCounter), sizeof(unsigned int));
file.read(reinterpret_cast<char *>(&ret.word), sizeof(unsigned int) * ret.wordCounter);
file.read(reinterpret_cast<char *>(&ret.fedId), sizeof(unsigned char) * ret.wordCounter / 2);
return ret;
}
#endif // input_h_