MLIR-AIE
version.h
Go to the documentation of this file.
1/**
2 * SPDX-License-Identifier: Apache-2.0
3 * Copyright (C) 2019-2021 Xilinx, Inc. All rights reserved.
4 * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
5 */
6
7#ifndef _XRT_VERSION_H_
8#define _XRT_VERSION_H_
9
10static const char xrt_build_version[] = "2.20.0";
11
12static const char xrt_build_version_branch[] = "master";
13
14static const char xrt_build_version_hash[] =
15 "6771f4d86fa616b8908d86d0999ee802074a32d8";
16
17static const char xrt_build_version_hash_date[] =
18 "Wed, 30 Apr 2025 16:34:04 -0700";
19
20static const char xrt_build_version_date_rfc[] =
21 "Thu, 01 May 2025 15:25:03 -0700";
22
23static const char xrt_build_version_date[] = "2025-05-01 15:25:03";
24
25static const char xrt_modified_files[] = "";
26
27#define XRT_DRIVER_VERSION "2.20.0,6771f4d86fa616b8908d86d0999ee802074a32d8"
28
29#define XRT_VERSION(major, minor) ((major << 16) + (minor))
30#define XRT_VERSION_CODE XRT_VERSION(2, 20)
31#define XRT_MAJOR(code) ((code >> 16))
32#define XRT_MINOR(code) (code - ((code >> 16) << 16))
33#define XRT_PATCH 0
34#define XRT_HEAD_COMMITS 8219
35#define XRT_BRANCH_COMMITS -1
36
37#ifdef __cplusplus
38#include <iostream>
39#include <string>
40
41namespace xrt::version {
42
43inline void print(std::ostream &output) {
44 output << " XRT Build Version: " << xrt_build_version << std::endl;
45 output << " Build Version Branch: " << xrt_build_version_branch
46 << std::endl;
47 output << " Build Version Hash: " << xrt_build_version_hash << std::endl;
48 output << " Build Version Hash Date: " << xrt_build_version_hash_date
49 << std::endl;
50 output << " Build Version Date: " << xrt_build_version_date_rfc
51 << std::endl;
52
53 std::string modified_files(xrt_modified_files);
54 if (modified_files.empty())
55 return;
56
57 const std::string &delimiters = ","; // Our delimiter
58 std::string::size_type last_pos = 0;
59 int running_index = 1;
60 while (last_pos < modified_files.length() + 1) {
61 if (running_index == 1)
62 output << " Current Modified Files: ";
63 else
64 output << " ";
65
66 output << running_index++ << ") ";
67
68 auto pos = modified_files.find_first_of(delimiters, last_pos);
69
70 if (pos == std::string::npos)
71 pos = modified_files.length();
72
73 output << modified_files.substr(last_pos, pos - last_pos) << std::endl;
74
75 last_pos = pos + 1;
76 }
77}
78
79} // namespace xrt::version
80#endif // __cplusplus
81
82#endif