aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/hvx
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-01-17 15:22:42 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-01-17 15:51:07 -0800
commit7a7d4af00a53a3043d661463d9bb87efda1fa8a8 (patch)
treea0be0fc830c086511f97aad79c144f935b572d23 /tensorflow/contrib/hvx
parentc058a01d99621c7220c57e4f8c5ee6efd163ed03 (diff)
Add dummy function and data for inception inference on HVX
Change: 144763407
Diffstat (limited to 'tensorflow/contrib/hvx')
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v1_graph_init.c16
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_float_data.c16
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_int_data.c17
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_graph_init.c16
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c6
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c4
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/target/make/android.min45
7 files changed, 102 insertions, 18 deletions
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v1_graph_init.c b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v1_graph_init.c
new file mode 100644
index 0000000000..3ca5532c38
--- /dev/null
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v1_graph_init.c
@@ -0,0 +1,16 @@
+/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+
+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.
+==============================================================================*/
+
+void init_graph_v1(int nn_id) {}
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_float_data.c b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_float_data.c
new file mode 100644
index 0000000000..dc61ae754a
--- /dev/null
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_float_data.c
@@ -0,0 +1,16 @@
+/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+
+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.
+==============================================================================*/
+
+float inception_dummy_float_data_299x299[299*299*3] = {};
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_int_data.c b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_int_data.c
new file mode 100644
index 0000000000..27e1ca40b9
--- /dev/null
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_dummy_int_data.c
@@ -0,0 +1,17 @@
+/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+
+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 <stdint.h>
+uint8_t inception_dummy_int_data_299x299[299*299*3] = {};
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_graph_init.c b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_graph_init.c
new file mode 100644
index 0000000000..9def665827
--- /dev/null
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_dummy_data/inception_v3_graph_init.c
@@ -0,0 +1,16 @@
+/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+
+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.
+==============================================================================*/
+
+void init_graph(int nn_id) {}
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c b/tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c
index f91a4b57d9..567485b035 100644
--- a/tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c
@@ -38,9 +38,9 @@ static float s_output_values[300 * 300 * 3 * 4];
extern void init_graph(uint32_t id);
extern void init_graph_v1(uint32_t id);
-extern uint8_t inception_sample_int_data_299x299[];
+extern uint8_t inception_dummy_int_data_299x299[];
extern uint8_t inception_sample_int_data_224x224[];
-extern float inception_dummy_float_data[];
+extern float inception_dummy_float_data_299x299_299x299[];
enum InceptionVersion {
INCEPTION_V1,
@@ -245,7 +245,7 @@ bool hexagon_controller_ExecuteInceptionDummyData(uint32_t nn_id) {
const bool success = hexagon_controller_ExecuteGraph(
nn_id, INCEPTION_PARAM_BATCHES, INCEPTION_PARAM_HEIGHT_V3,
INCEPTION_PARAM_WIDTH_V3, INCEPTION_PARAM_DEPTH,
- (uint8_t *)inception_sample_int_data_299x299,
+ (uint8_t *)inception_dummy_int_data_299x299,
INCEPTION_PARAM_HEIGHT_V3 * INCEPTION_PARAM_WIDTH_V3 *
INCEPTION_PARAM_DEPTH,
&out_batches, &out_height, &out_width, &out_depth,
diff --git a/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c b/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c
index 33a37bf77a..fe329e2f59 100644
--- a/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c
@@ -39,7 +39,7 @@ static const uint32_t OUTPUT_PARAM_MAX_LINE_SIZE = 1000;
// extern pre-generated inception dummy data
extern uint8_t inception_dummy_int_data_224x224[];
extern uint8_t inception_dummy_int_data_299x299[];
-extern float inception_dummy_float_data[];
+extern float inception_dummy_float_data_299x299_299x299[];
#define GEMM_WRAPPER_VERSION 1
@@ -78,7 +78,7 @@ void hexagon_controller_InitInputNodeDataToInceptionDummyData(int version) {
hexagon_controller_CopyByteNodeData(
INCEPTION_PARAM_BATCHES, INCEPTION_PARAM_HEIGHT_V3,
INCEPTION_PARAM_WIDTH_V3, INCEPTION_PARAM_DEPTH,
- sizeof(float), (uint8_t*)inception_dummy_float_data);
+ sizeof(float), (uint8_t*)inception_dummy_float_data_299x299_299x299);
} else {
hexagon_controller_CopyByteNodeData(
INCEPTION_PARAM_BATCHES, INCEPTION_PARAM_HEIGHT_V3,
diff --git a/tensorflow/contrib/hvx/hexagon_controller/target/make/android.min b/tensorflow/contrib/hvx/hexagon_controller/target/make/android.min
index 8564b19be4..4770d31c56 100644
--- a/tensorflow/contrib/hvx/hexagon_controller/target/make/android.min
+++ b/tensorflow/contrib/hvx/hexagon_controller/target/make/android.min
@@ -1,17 +1,23 @@
-/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
+#
+# 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.
+# ==============================================================================
-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.
-==============================================================================*/
+$(info ------------------------------------------)
+$(info --- V = $(V))
+$(info --- GLUE_DIR = $(GLUE_DIR))
+$(info --- HEXAGON_SDK_ROOT = $(HEXAGON_SDK_ROOT))
+$(info ------------------------------------------)
INCDIRS += ../../../libs/common/adspmsgd/ship/android_Release
@@ -27,11 +33,24 @@ hexagon_controller_lib_QAICIDLS += \
interface/hexagon_nn \
$(MAKE_D_DSPCV_INCDIR)/dspCV
+# hexagon controller library
hexagon_controller_lib_C_SRCS += \
src_impl/hexagon_controller \
src_impl/graph_functions_wrapper \
src_soc_interface/soc_interface
+# dummy data
+hexagon_controller_lib_C_SRCS += \
+src_dummy_data/inception_v1_graph_init \
+src_dummy_data/inception_v3_dummy_float_data \
+src_dummy_data/inception_v3_dummy_int_data \
+src_dummy_data/inception_v3_graph_init
+
+# hexagon interface
+hexagon_controller_lib_C_SRCS += \
+$V/hexagon_nn_stub \
+$V/dspCV_stub
+
hexagon_controller_lib_DLLS += libadsprpc
hexagon_controller_lib_LIBS += rpcmem adspmsgd
hexagon_controller_lib_LD_FLAGS += -llog