24.04
GpuKernelComponentFactory.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
#ifndef SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_GPUKERNELCOMPONENTFACTORY
25
#define SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_GPUKERNELCOMPONENTFACTORY
26
27
#include "
src/dynamic_fusion/sketch/gpu/components/IGpuKernelComponent.h
"
28
29
#include "
Types.h
"
30
#include <memory>
31
32
namespace
arm_compute
33
{
34
namespace
experimental
35
{
36
namespace
dynamic_fusion
37
{
38
/** Factory class that creates new instances of @ref IGpuKernelComponent by assigning new component ids
39
*/
40
class
GpuKernelComponentFactory
41
{
42
public
:
43
/** Create a new kernel component
44
*
45
* @tparam T Any polymorphic type descending from @ref IGpuKernelComponent
46
* @tparam Args Argument types to construct the kernel component
47
*
48
* @param[in] args Arguments to construct the kernel component
49
*
50
* @return std::unique_ptr<IGpuKernelComponent>
51
*/
52
template
<
typename
T,
typename
... Args>
53
std::unique_ptr<IGpuKernelComponent>
create
(Args &&...
args
)
54
{
55
return
std::make_unique<T>(_count++, std::forward<Args>(
args
)...);
56
}
57
58
private
:
59
ComponentId
_count{0};
60
};
61
62
}
// namespace dynamic_fusion
63
}
// namespace experimental
64
}
// namespace arm_compute
65
#endif
/* SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_GPUKERNELCOMPONENTFACTORY */
GemmTuner.args
args
Definition:
GemmTuner.py:679
arm_compute::experimental::dynamic_fusion::GpuKernelComponentFactory
Factory class that creates new instances of IGpuKernelComponent by assigning new component ids.
Definition:
GpuKernelComponentFactory.h:40
Types.h
arm_compute::experimental::dynamic_fusion::GpuKernelComponentFactory::create
std::unique_ptr< IGpuKernelComponent > create(Args &&...args)
Create a new kernel component.
Definition:
GpuKernelComponentFactory.h:53
arm_compute::experimental::dynamic_fusion::ComponentId
int32_t ComponentId
Uniquely identifies a kernel component within a workload.
Definition:
Types.h:37
arm_compute
Copyright (c) 2017-2024 Arm Limited.
Definition:
introduction.dox:24
IGpuKernelComponent.h
src
dynamic_fusion
sketch
gpu
components
GpuKernelComponentFactory.h
Generated on Mon Apr 29 2024 10:53:58 for Compute Library by
1.8.17