Compute Library
 23.11
generic.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2023 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 
25 #pragma once
26 
27 #include "utils.hpp"
28 #include "depthwise.hpp"
29 
30 #include <functional>
31 
32 namespace arm_conv {
33 namespace depthwise {
34 namespace interleaves {
35 
37 {
38  const unsigned int kernel_rows;
39  const unsigned int kernel_cols;
40  const size_t weight_element_size;
41  const bool include_bias;
42  const size_t bias_element_size;
43  const bool premultiply;
46  const unsigned int accumulator_depth_vl;
47  std::function<bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos;
48 
49  unsigned int kernel_points(void) const { return kernel_cols * kernel_rows; }
50 
52  unsigned int kernel_rows,
53  unsigned int kernel_cols,
54  size_t weight_element_size,
55  bool include_bias,
56  size_t bias_element_size,
57  bool premultiply,
60  unsigned int accumulator_depth_vl,
61  std::function<bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos
62  );
63 };
64 
66  const PackingArguments &packing_args,
67  const DepthwiseArgs &args
68 );
69 
71  const PackingArguments &packing_args,
72  const DepthwiseArgs &args,
73  void *buffer_raw,
74  const void *biases_raw,
75  const void *weights_raw,
76  size_t ld_weight_col,
77  size_t ld_weight_row
78 );
79 
80 } // namespace interleaves
81 } // namespace depthwise
82 } // namespace arm_conv
arm_conv::depthwise::interleaves::PackingArguments::vl_type
arm_gemm::VLType vl_type
Definition: generic.hpp:44
arm_conv::depthwise::interleaves::PackingArguments
Definition: generic.hpp:36
GemmTuner.args
args
Definition: GemmTuner.py:679
arm_conv::depthwise::depthwise
template UniqueDepthwiseCommon< float > depthwise(const DepthwiseArgs &, const Nothing &)
arm_conv::depthwise::interleaves::PackingArguments::kernel_rows
const unsigned int kernel_rows
Definition: generic.hpp:38
arm_conv::depthwise::interleaves::PackingArguments::kernel_points
unsigned int kernel_points(void) const
Definition: generic.hpp:49
arm_conv::depthwise::interleaves::pack_parameters_generic
void pack_parameters_generic(const PackingArguments &packing_args, const DepthwiseArgs &args, void *buffer_raw, const void *biases_raw, const void *weights_raw, size_t ld_weight_col, size_t ld_weight_row)
Definition: generic.cpp:67
arm_conv::depthwise::interleaves::PackingArguments::accumulator_depth_vl
const unsigned int accumulator_depth_vl
Definition: generic.hpp:46
arm_conv::depthwise::interleaves::get_storage_size_generic
size_t get_storage_size_generic(const PackingArguments &packing_args, const DepthwiseArgs &args)
Definition: generic.cpp:45
arm_conv::depthwise::interleaves::PackingArguments::PackingArguments
PackingArguments(unsigned int kernel_rows, unsigned int kernel_cols, size_t weight_element_size, bool include_bias, size_t bias_element_size, bool premultiply, arm_gemm::VLType vl_type, size_t accumulator_element_size, unsigned int accumulator_depth_vl, std::function< bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos)
Definition: generic.cpp:33
arm_conv::depthwise::interleaves::PackingArguments::premultiply
const bool premultiply
Definition: generic.hpp:43
arm_conv::depthwise::interleaves::PackingArguments::accumulator_element_size
const size_t accumulator_element_size
Definition: generic.hpp:45
arm_conv::depthwise::interleaves::PackingArguments::bias_element_size
const size_t bias_element_size
Definition: generic.hpp:42
arm_gemm::VLType
VLType
Definition: utils.hpp:80
arm_conv::depthwise::interleaves::PackingArguments::kernel_cols
const unsigned int kernel_cols
Definition: generic.hpp:39
utils.hpp
arm_conv
Definition: addressing.cpp:30
arm_conv::depthwise::interleaves::PackingArguments::include_bias
const bool include_bias
Definition: generic.hpp:41
arm_conv::depthwise::interleaves::PackingArguments::weight_element_size
const size_t weight_element_size
Definition: generic.hpp:40
arm_conv::depthwise::interleaves::PackingArguments::get_weight_pos
std::function< bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos
Definition: generic.hpp:47