Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Include types.h instead of global.h #891

Merged
merged 4 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/dlk_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ limitations under the License.
#include <sstream>
#include <fstream>
#include <vector>
#include "global.h"
#include "types.h"

template <class T_SIZE, class T>
struct Diff {
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/add.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.

#include <functional>

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/average_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_AVERAGE_POOL_H_INCLUDED
#define DLK_FUNC_AVERAGE_POOL_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

struct avg_pooling_parameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_BATCH_NORMALIZATION_H_INCLUDED
#define DLK_FUNC_BATCH_NORMALIZATION_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

void func_BatchNormalizationOptimized(const TensorView<T_FLOAT, MemoryLayout::NHWC>& input,
Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/concat_on_depth.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
#include <tuple>
#include <type_traits>

#include "global.h"
#include "types.h"
#include "tensor_view.h"
#include "time_measurement.h"

Expand Down
12 changes: 7 additions & 5 deletions blueoil/converter/templates/include/func/depth_to_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_DEPTH_TO_SPACE_H_INCLUDED
#define DLK_FUNC_DEPTH_TO_SPACE_H_INCLUDED

#include "global.h"
#include "types.h"
#include "time_measurement.h"
#include "tensor_view.h"

Expand Down Expand Up @@ -48,8 +48,9 @@ inline void func_DepthToSpace(const TensorView<float, MemoryLayout::NHWC>& input
Measurement::Stop();
}

inline void func_DepthToSpace(const TensorView<QUANTIZED_PACKED, MemoryLayout::HWChBCl>& input,
const TensorView<QUANTIZED_PACKED, MemoryLayout::HWChBCl>& output,
template <typename T>
void func_DepthToSpace(const TensorView<QuantizedPacked<T>, MemoryLayout::HWChBCl>& input,
const TensorView<QuantizedPacked<T>, MemoryLayout::HWChBCl>& output,
T_UINT a, T_UINT b, T_UINT kernel_size, T_UINT stride) {
Measurement::Start("DepthToSpace");

Expand Down Expand Up @@ -79,8 +80,9 @@ inline void func_DepthToSpace(const TensorView<QUANTIZED_PACKED, MemoryLayout::H
Measurement::Stop();
}

inline void func_DepthToSpace(const TensorView<QUANTIZED_PACKED, MemoryLayout::ChHWBCl>& input,
const TensorView<QUANTIZED_PACKED, MemoryLayout::ChHWBCl>& output,
template <typename T>
void func_DepthToSpace(const TensorView<QuantizedPacked<T>, MemoryLayout::ChHWBCl>& input,
const TensorView<QuantizedPacked<T>, MemoryLayout::ChHWBCl>& output,
T_UINT a, T_UINT b, T_UINT kernel_size, T_UINT stride) {
Measurement::Start("DepthToSpace");

Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/leaky_relu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_LEAKY_RELU_H_INCLUDED
#define DLK_FUNC_LEAKY_RELU_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/unary_op.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/matmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_MATMUL_H_INCLUDED
#define DLK_FUNC_MATMUL_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

void func_Matmul(const TensorView<T_FLOAT, MemoryLayout::NC>& input,
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/max.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_MAX_H_INCLUDED
#define DLK_FUNC_MAX_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/max_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_MAX_POOLING_H_INCLUDED
#define DLK_FUNC_MAX_POOLING_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

struct max_pooling_parameters {
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/minimum.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_MINIMUM_H_INCLUDED
#define DLK_FUNC_MINIMUM_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/mul.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_MUL_H_INCLUDED
#define DLK_FUNC_MUL_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/pad.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef DLK_FUNC_PAD_H_INCLUDED
#define DLK_FUNC_PAD_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

void func_Pad(const TensorView<T_FLOAT, MemoryLayout::NHWC>& input,
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/real_div.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_REAL_DIV_H
#define DLK_FUNC_REAL_DIV_H

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/relu.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_RELU_H_INCLUDED
#define DLK_FUNC_RELU_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/unary_op.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_RESIZE_NEAREST_NEIGHBOR_H_INCLUDED
#define DLK_FUNC_RESIZE_NEAREST_NEIGHBOR_H_INCLUDED

#include "global.h"
#include "types.h"
#include "time_measurement.h"
#include "tensor_view.h"

Expand Down Expand Up @@ -51,8 +51,9 @@ inline void func_ResizeNearestNeighbor(const TensorView<float, MemoryLayout::NHW
}


inline void func_ResizeNearestNeighbor(const TensorView<QUANTIZED_PACKED, MemoryLayout::HWChBCl>& input,
const TensorView<QUANTIZED_PACKED, MemoryLayout::HWChBCl>& output) {
template <typename T>
void func_ResizeNearestNeighbor(const TensorView<QuantizedPacked<T>, MemoryLayout::HWChBCl>& input,
const TensorView<QuantizedPacked<T>, MemoryLayout::HWChBCl>& output) {
Measurement::Start("ResizeNearestNeighbor");

const auto in_shape = input.get_shape();
Expand Down Expand Up @@ -83,8 +84,9 @@ inline void func_ResizeNearestNeighbor(const TensorView<QUANTIZED_PACKED, Memory
}


inline void func_ResizeNearestNeighbor(const TensorView<QUANTIZED_PACKED, MemoryLayout::ChHWBCl>& input,
const TensorView<QUANTIZED_PACKED, MemoryLayout::ChHWBCl>& output) {
template <typename T>
void func_ResizeNearestNeighbor(const TensorView<QuantizedPacked<T>, MemoryLayout::ChHWBCl>& input,
const TensorView<QuantizedPacked<T>, MemoryLayout::ChHWBCl>& output) {
Measurement::Start("ResizeNearestNeighbor");

const auto in_shape = input.get_shape();
Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/include/func/softmax.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef DLK_FUNC_SOFTMAX_H_INCLUDED
#define DLK_FUNC_SOFTMAX_H_INCLUDED

#include "global.h"
#include "types.h"
#include "tensor_view.h"

void func_Softmax(const TensorView<T_FLOAT, MemoryLayout::NC>& input,
Expand Down
1 change: 0 additions & 1 deletion blueoil/converter/templates/include/func/sub.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.
#ifndef DLK_FUNC_SUB_H_INCLUDED
#define DLK_FUNC_SUB_H_INCLUDED

#include "global.h"
#include "tensor_view.h"
#include "func/impl/binary_op.h"
#include "time_measurement.h"
Expand Down
1 change: 1 addition & 0 deletions blueoil/converter/templates/include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
#ifndef TYPES_H
#define TYPES_H

#include <climits>
#include <type_traits>
#include "func/impl/pop_count.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#include <cmath>
#include <memory>

#include "global.h"
#include "types.h"
#include "func/batch_normalization.h"
#include "time_measurement.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#include <cmath>
#include <memory>

#include "global.h"
#include "types.h"
#include "func/batch_normalization.h"
#include "time_measurement.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/src/func/matmul.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include "global.h"
#include "types.h"
#include "func/matmul.h"
#include "time_measurement.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/src/func/max_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ limitations under the License.
==============================================================================*/
#include <cassert>
#include <cstring>
#include "global.h"
#include "types.h"
#include "func/max_pool.h"
#include "time_measurement.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/src/func/pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "global.h"
#include "types.h"
#include "func/pad.h"
#include "time_measurement.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/src/func/softmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.

#include <cmath>

#include "global.h"
#include "types.h"
#include "func/softmax.h"
#include "time_measurement.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#include <cmath>
#include <memory>

#include "global.h"
#include "types.h"
#include "func/batch_normalization.h"
#include "time_measurement.h"

Expand Down
2 changes: 1 addition & 1 deletion blueoil/converter/templates/src/write_to_file.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "global.h"
#include "types.h"
#include <string>
#include <fstream>

Expand Down