File: ocloc_concat.h

package info (click to toggle)
intel-compute-runtime 25.48.36300.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,652 kB
  • sloc: cpp: 939,022; lisp: 2,090; sh: 722; makefile: 162; python: 21
file content (57 lines) | stat: -rw-r--r-- 1,687 bytes parent folder | download
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
53
54
55
56
57
/*
 * Copyright (C) 2022-2025 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once

#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/utilities/arrayref.h"
#include "shared/source/utilities/const_stringref.h"

#include <cstdint>
#include <string>
#include <vector>

namespace AOT {
enum PRODUCT_CONFIG : uint32_t; // NOLINT(readability-identifier-naming)
}
class OclocArgHelper;
namespace NEO {
namespace Ar {
struct Ar;
}

class OclocConcat : NEO::NonCopyableAndNonMovableClass {
  public:
    using ErrorCode = uint32_t;

    OclocConcat() = delete;
    OclocConcat(OclocArgHelper *argHelper) : argHelper(argHelper){};
    ErrorCode initialize(const std::vector<std::string> &args);
    ErrorCode concatenate();
    void printHelp();

    static constexpr ConstStringRef commandStr = "concat";
    static constexpr ConstStringRef helpMessage = R"===(
ocloc concat - concatenates fat binary files
Usage: ocloc concat <fat binary> <fat binary> ... [-out <concatenated fat binary file name>]
)===";

  protected:
    ErrorCode checkIfFatBinariesExist();
    MOCKABLE_VIRTUAL Ar::Ar decodeAr(ArrayRef<const uint8_t> arFile, std::string &outErrors, std::string &outWarnings);
    AOT::PRODUCT_CONFIG getAOTProductConfigFromBinary(ArrayRef<const uint8_t> binary, std::string &outErrors);
    ErrorCode parseArguments(const std::vector<std::string> &args);
    void printMsg(ConstStringRef fileName, const std::string &message);

    OclocArgHelper *argHelper;
    std::vector<std::string> fileNamesToConcat;
    std::string fatBinaryName = "concat.ar";
};

static_assert(NEO::NonCopyableAndNonMovable<OclocConcat>);

} // namespace NEO