File: test_payload.cpp

package info (click to toggle)
vart 2.5-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 4,404 kB
  • sloc: cpp: 30,188; python: 7,493; sh: 969; makefile: 37; ansic: 36
file content (52 lines) | stat: -rw-r--r-- 1,723 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright 2021 Xilinx Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "payload.hpp"

using namespace vitis::ai::trace;
using namespace std;

int main(void) {
  auto cu_device_id = 1;
  auto cu_core_id = 0;
  auto cu_addr = 0x1234567890;
  auto cu_fingerprint = 0x158161909596;

  auto x = tracePayload<int>("workload", 1234567);

  // Method 2
  auto z2 = trace("dev_id", cu_device_id, "core_id", cu_core_id);
  auto z4 = trace("dev_id", cu_device_id, "core_id", cu_core_id, "cu_addr",
                  cu_addr, "cu_fig", cu_fingerprint);

  auto e = trace(pair("dev_id", cu_device_id), pair("core_id", cu_core_id),
                 pair("cu_addr", cu_addr), pair("cu_fig", cu_fingerprint));

  cout << "payload size: " << sizeof(x) << endl;
  cout << "auto z2 size: " << sizeof(z2) << endl;
  cout << "auto z4 size: " << sizeof(z4) << endl;

  cout << "----------------------" << endl;
  // Method 3

  auto iii = make_pl_inf(99.9, 8, 'c');
  auto iiii = make_pl_inf(99.9, 8, 'c', 33);
  iiii.dump();
  // cout << "i3 sizeof: " << sizeof(iii) << ", i4 sizeof: " << sizeof(iiii) <<
  // endl; cout << "i3 size: " << iii.size() << ", i4 size: " << iiii.size() <<
  // endl;
  return 0;
}