summaryrefslogtreecommitdiff
path: root/runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc')
-rw-r--r--runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc b/runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc
new file mode 100644
index 000000000..3cf3ae3c2
--- /dev/null
+++ b/runtimes/neurun/backend/cpu/kernel/ReshapeLayer.cc
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * 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 "ReshapeLayer.h"
+
+namespace neurun
+{
+namespace backend
+{
+namespace cpu
+{
+namespace kernel
+{
+
+ReshapeLayer::ReshapeLayer() : _inputData(), _outputData(), _inputShape(), _outputShape()
+{
+ // DO NOTHING
+}
+
+void ReshapeLayer::reshapeGeneric()
+{
+ size_t count = sizeOfData(_inputShape.type, _inputShape.dimensions);
+ memcpy(_outputData.v, _inputData.v, count);
+}
+
+void ReshapeLayer::configure(uint8_t *inputData, const Shape &inputShape, uint8_t *outputData,
+ const Shape &outputShape)
+{
+ _inputData.u8 = inputData;
+ _inputShape = inputShape;
+ _outputData.u8 = outputData;
+ _outputShape = outputShape;
+}
+
+void ReshapeLayer::run() { reshapeGeneric(); }
+
+} // namespace kernel
+} // namespace cpu
+} // namespace backend
+} // namespace neurun