Compute Library
 22.11
generic.hpp
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 
25 #pragma once
26 
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;
45  const unsigned int accumulator_depth_vl;
46  std::function<bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos;
47 
48  unsigned int kernel_points(void) const { return kernel_cols * kernel_rows; }
49 
51  unsigned int kernel_rows,
52  unsigned int kernel_cols,
53  size_t weight_element_size,
54  bool include_bias,
55  size_t bias_element_size,
56  arm_gemm::VLType vl_type,
57  size_t accumulator_element_size,
58  unsigned int accumulator_depth_vl,
59  std::function<bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos
60  );
61 };
62 
64  const PackingArguments &packing_args,
65  const DepthwiseArgs &args
66 );
67 
69  const PackingArguments &packing_args,
70  const DepthwiseArgs &args,
71  void *buffer_raw,
72  const void *biases_raw,
73  const void *weights_raw,
74  size_t ld_weight_col,
75  size_t ld_weight_row
76 );
77 
78 } // namespace interleaves
79 } // namespace depthwise
80 } // namespace arm_conv
std::function< bool(unsigned int, unsigned int &, unsigned int &)> get_weight_pos
Definition: generic.hpp:46
size_t get_storage_size_generic(const PackingArguments &packing_args, const DepthwiseArgs &args)
Definition: generic.cpp:45
PackingArguments(unsigned int kernel_rows, unsigned int kernel_cols, size_t weight_element_size, bool include_bias, size_t bias_element_size, 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
template UniqueDepthwiseCommon< float > depthwise(const DepthwiseArgs &, const Nothing &)
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