From eb14d463cc26f89c559dbea1e589c7749ecf2ef5 Mon Sep 17 00:00:00 2001 From: dolphin8 Date: Mon, 23 Jul 2018 20:09:06 +0800 Subject: [PATCH] android toolchain --- tools/net-detail.awk | 91 +++++++++++++++++++++++++ tools/toolchains/arm-android-neon.cmake | 5 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 tools/net-detail.awk diff --git a/tools/net-detail.awk b/tools/net-detail.awk new file mode 100644 index 0000000000..84d0166ac7 --- /dev/null +++ b/tools/net-detail.awk @@ -0,0 +1,91 @@ +BEGIN { +print "digraph G {" +} +/op:/ { + id++ + opname[id] = $NF +} +/input/ { + type = "input" + para = $NF + if (input[id]) { + input[id] = input[id] "|" + } + input[id] = input[id] "<" para ">" para +} +/output/ { + type = "output" + para = $NF + if (output[id]) { + output[id] = output[id] "|" + } + output[id] = output[id] "<" para ">" para +} +/attr/ { + type = "attr" + aname = $NF + if (attr_key[id]) { + attr_key[id] = attr_key[id] "|" + attr_value[id] = attr_value[id] "|" + } + attr_key[id] = attr_key[id] $NF +} +/argument/ { + if (type == "attr") { + split($0, arr, " - ") + attr_value[id] = attr_value[id] arr[2] + } else if ((type == "input") || (type == "output")) { + if (!var2id[$NF]) { + var_id++ + var[var_id] = $NF + var2id[$NF] = var_id + } + varid = var2id[$NF] + lid++ + if (type == "input") { + line[lid] = "var_" varid " -> " "op_" id ":<" para ">" + if (xout[$NF]) { + xi++ + xline[xi] = "xop_" xout[$NF] " -> " "xop_" id + } + } else if (type == "output") { + line[lid] = "op_" id ":<" para ">" " -> " "var_" varid + xout[$NF] = id + } + } +} +/var name/ { + varname = $NF + vid = var2id[varname] +} +/var tensor desc dim / { + if (tensor[vid]) tensor[vid] = tensor[vid] " x " + tensor[vid] = tensor[vid] $NF +} +END { + +print "subgraph cluster_G0 {" +for (i = 1; i <= id; i++) { + print "xop_" i "[label=\"" i ". " opname[i] "\"]" +} +for (i = 1; i <= xi; i++) { + print xline[i] +} +print "}" + +for (i = 1; i <= id; i++) { +print "op_" i "[group=op;shape=record;label=\"{{" input[i] "}|" i ". " opname[i] "|{" output[i] "}}\"]" +} +for (i = 1; i <= var_id; i++) { +print "var_" i "[label=\"" var[i] " [" tensor[i] "]\"]" +} +for (i = 1; i <= lid; i++) { +print line[i] +} +for (i = 1; i <= id; i++) { +print "attr_" i "[shape=record;label=\"{" attr_key[i] "}|{" attr_value[i] "}\"]" +print "attr_" i " -> " "op_" i ":" +} +print "}" +} + diff --git a/tools/toolchains/arm-android-neon.cmake b/tools/toolchains/arm-android-neon.cmake index f2fa600b90..5e431059a9 100644 --- a/tools/toolchains/arm-android-neon.cmake +++ b/tools/toolchains/arm-android-neon.cmake @@ -1,2 +1,5 @@ set(ANDROID_ARM_NEON ON) -include("${CMAKE_CURRENT_LIST_DIR}/../android-cmake/android.toolchain.cmake") \ No newline at end of file +set(ANDROID_PIE TRUE) +set(ANDROID_STL "c++_static") +set(ANDROID_PLATFORM "android-22") +include("${CMAKE_CURRENT_LIST_DIR}/../android-cmake/android.toolchain.cmake") -- GitLab