Compute Library
 22.08
Utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifdef ENABLE_EXPERIMENTAL_DYNAMIC_FUSION
25 
26 #ifndef ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_UTILS
27 #define ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_UTILS
28 
30 
31 namespace arm_compute
32 {
33 namespace experimental
34 {
35 namespace dynamic_fusion
36 {
37 inline ::std::ostream &operator<<(::std::ostream &os, const CLBuildOptions::StringSet &build_opts)
38 {
39  for(const auto &opt : build_opts)
40  {
41  os << opt << ",";
42  }
43  return os;
44 }
45 inline ::std::ostream &operator<<(::std::ostream &os, const CLBuildOptions &cl_build_opts)
46 {
47  os << cl_build_opts.options();
48  return os;
49 }
50 
51 inline std::string to_string(const CLBuildOptions &cl_build_opts)
52 {
53  std::stringstream str;
54  str << cl_build_opts;
55  return str.str();
56 }
57 inline ::std::ostream &operator<<(::std::ostream &os, const ClKernelCode &code)
58 {
59  os << "name: " << code.name << std::endl;
60  os << "code: " << code.code << std::endl;
61  os << "build_opts: " << code.build_options << std::endl;
62  return os;
63 }
64 inline std::string to_string(const ClKernelCode &code)
65 {
66  std::stringstream str;
67  str << code;
68  return str.str();
69 }
70 
71 } // namespace dynamic_fusion
72 } // namespace experimental
73 } // namespace arm_compute
74 
75 #endif //ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_IMPL_UTILS
76 #endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */
inline ::std::ostream & operator<<(::std::ostream &os, const CLBuildOptions::StringSet &build_opts)
Definition: Utils.h:37
const StringSet & options() const
Gets the current options list set.
std::string to_string(const CLBuildOptions &cl_build_opts)
Definition: Utils.h:51
Copyright (c) 2017-2022 Arm Limited.
Contains kernel code to be compiled and run in a ClUnitWorkload.
Definition: ClWorkload.h:100
CLBuildOptions build_options
Kernel build options.
Definition: ClWorkload.h:110