aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/hvx
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-02-09 16:33:49 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-02-09 16:47:02 -0800
commit3c1187f072f3db2460ab8c07b5d5ac40cf14a28f (patch)
tree3283c7c189f57356c95f37f1a4f761f67f92820d /tensorflow/contrib/hvx
parentc0fc1b998ddbc838a479e295dfd9c0ad75d28f48 (diff)
Fix and refactor hexagon controller to catch up with latest hexagon_nn libarry
Change: 147097908
Diffstat (limited to 'tensorflow/contrib/hvx')
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_impl/graph_functions_wrapper.c10
-rw-r--r--tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c15
2 files changed, 13 insertions, 12 deletions
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 567485b035..3b3ce2cdc9 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
@@ -39,8 +39,8 @@ 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_dummy_int_data_299x299[];
-extern uint8_t inception_sample_int_data_224x224[];
-extern float inception_dummy_float_data_299x299_299x299[];
+extern uint8_t inception_dummy_int_data_224x224[];
+extern float inception_dummy_float_data_299x299[];
enum InceptionVersion {
INCEPTION_V1,
@@ -282,10 +282,10 @@ void hexagon_controller_DumpPerf(uint32_t nn_id) {
unsigned long long int total_cycles = 0;
unsigned long long int cum_cycles = 0;
unsigned long long int counter = 0;
- int n_nodes;
+ unsigned int n_nodes;
int i;
TFMLOGD("Perf dump follows:");
- if (hexagon_nn_get_perfinfo(nn_id, info, MAX_NODES,&n_nodes) != 0) {
+ if (hexagon_nn_get_perfinfo(nn_id, info, MAX_NODES, &n_nodes) != 0) {
TFMLOGE("perf info failure");
return;
}
@@ -321,7 +321,7 @@ void hexagon_controller_DumpNodeName(uint32_t nn_id) {
unsigned long long int total_cycles = 0;
unsigned long long int cum_cycles = 0;
unsigned long long int counter = 0;
- int node_count;
+ unsigned int node_count;
int i;
TFMLOGD("Perf dump follows:");
if (hexagon_nn_get_perfinfo(id, info, MAX_NODES, &node_count) != 0) {
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 fe329e2f59..e3d72d5bb0 100644
--- a/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c
+++ b/tensorflow/contrib/hvx/hexagon_controller/src_impl/hexagon_controller.c
@@ -39,9 +39,9 @@ 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_299x299_299x299[];
+extern float inception_dummy_float_data_299x299[];
-#define GEMM_WRAPPER_VERSION 1
+#define HEXAGON_CONTROLLER_VERSION 91
// allocate print bufsize in advance @MB
#define PRINT_BUFSIZE (2 * 1024 * 1024)
@@ -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_299x299_299x299);
+ sizeof(float), (uint8_t*)inception_dummy_float_data_299x299);
} else {
hexagon_controller_CopyByteNodeData(
INCEPTION_PARAM_BATCHES, INCEPTION_PARAM_HEIGHT_V3,
@@ -157,12 +157,12 @@ void hexagon_controller_PrintGraph(uint32_t id) {
}
int hexagon_controller_GetWrapperVersion() {
- return GEMM_WRAPPER_VERSION;
+ return HEXAGON_CONTROLLER_VERSION;
}
int hexagon_controller_GetHexagonBinaryVersion() {
int retval = 0;
- hexagon_nn_GetHexagonBinaryVersion(&retval);
+ hexagon_nn_version(&retval);
return retval;
}
@@ -229,7 +229,8 @@ bool hexagon_controller_CopyByteNodeData(
int hexagon_controller_InitHexagonWithMaxAttributes(
int enable_dcvs, int bus_usage, int version) {
- TFMLOGI("Init hexagon with max attributes");
+ TFMLOGI("Init hexagon with max attributes (Controller version = %d)",
+ HEXAGON_CONTROLLER_VERSION);
const int MCPS = 1000;
const int MBPS = 12000;
@@ -250,7 +251,7 @@ int hexagon_controller_InitHexagonWithMaxAttributes(
};
int retval = 0;
if (!enable_dcvs) {
- retval = hexagon_nn_disableDcvs();
+ retval = hexagon_nn_disable_dcvs();
if (retval) {
TFMLOGE("Failed to disable DSP DCVS: %x\n", retval);
}