Debian Codegraph @

third_party/etc2comp/EtcTool/EtcMemTest.h

raw
1 /*
2 * Copyright 2015 The Etc2Comp Authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #pragma once
18
19 #include "EtcConfig.h"
20
21 #include "Etc.h"
22
23 #include "EtcSourceImage.h"
24 #include "EtcFile.h"
25 #include "EtcMath.h"
26 #include "EtcImage.h"
27 #include "EtcErrorMetric.h"
28 #include "EtcBlock4x4EncodingBits.h"
29 #include "EtcFileHeader.h"
30
31 #include <assert.h>
32 #include <stdlib.h>
33 #include <string.h>
34
35 #define MAX_JOBS 1024
36 using namespace Etc;
37
38 int RunMemTest(bool verboseOutput, size_t numTestIterations);
39
40
41
42
43
44 /*int getMem()
45 {
46
47 int tSize = 0, resident = 0, share = 0;
48 ifstream buffer("/proc/self/statm");
49 buffer >> tSize >> resident >> share;
50 buffer.close();
51
52 long page_size_kb = sysconf(_SC_PAGE_SIZE) / 1024; // in case x86-64 is configured to use 2MB pages
53 double rss = resident * page_size_kb;
54 cout << "RSS - " << rss << " kB\n";
55
56 double shared_mem = share * page_size_kb;
57 cout << "Shared Memory - " << shared_mem << " kB\n";
58
59 cout << "Private Memory - " << rss - shared_mem << "kB\n";
60 return 0;
61 }*/