summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4202eca)
raw | patch | inline | side by side (parent: 4202eca)
author | Ajay Jayaraj <ajayj@ti.com> | |
Mon, 21 May 2018 20:47:04 +0000 (15:47 -0500) | ||
committer | Ajay Jayaraj <ajayj@ti.com> | |
Mon, 21 May 2018 21:57:58 +0000 (16:57 -0500) |
(MCT-984)
12 files changed:
examples/imagenet/Makefile | patch | blob | history | |
examples/imagenet/main.cpp | patch | blob | history | |
examples/segmentation/Makefile | patch | blob | history | |
examples/segmentation/main.cpp | patch | blob | history | |
examples/ssd_multibox/Makefile | patch | blob | history | |
examples/ssd_multibox/main.cpp | patch | blob | history | |
tidl_api/Makefile | patch | blob | history | |
tidl_api/make.buildid | [new file with mode: 0644] | patch | blob |
tidl_api/make.inc | patch | blob | history | |
viewer/Makefile | patch | blob | history | |
viewer/dot_graph.cpp | patch | blob | history | |
viewer/main.cpp | patch | blob | history |
index a5da07567f22f2bcaaea90e788efc9a35101c944..10efeae3de445f9f6777e26b57ac0fde450142d4 100644 (file)
include ../make.common
-CXXFLAGS += $(shell pkg-config --cflags opencv)
-LIBS += $(shell pkg-config --libs opencv)
+LIBS += -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio\
+ -lopencv_imgproc -lopencv_core
SOURCES = main.cpp imagenet_classes.cpp
index 744fb85db1a978e50aa998d28c1e7c3b063ef01a..8fe89127e7b9f2e336821e82201308f075a001be 100644 (file)
std::string config = "j11_v2";
std::string input_file = "../test/testvecs/input/objects/cat-pet-animal-domestic-104827.jpeg";
int num_devices = 1;
- DeviceType device_type = DeviceType::DLA;
+ DeviceType device_type = (num_dla > 0 ? DeviceType::DLA:DeviceType::DSP);
ProcessArgs(argc, argv, config, num_devices, device_type, input_file);
std::cout << "Input: " << input_file << std::endl;
index e9dc8bf67033365e9100cb46d8a9ea44932a73e0..4df3278a159dec1a4002c464de914392abb0df7d 100644 (file)
include ../make.common
-CXXFLAGS += $(shell pkg-config --cflags opencv)
-LIBS += $(shell pkg-config --libs opencv)
+LIBS += -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio\
+ -lopencv_imgproc -lopencv_core
SOURCES = main.cpp object_classes.cpp
index 786d6ee60db5a6ef41d4490c7ba11d56d0b76548..ec183286182124ee94991f84a5d4592ed608ff6d 100644 (file)
std::string config = DEFAULT_CONFIG;
std::string input_file = DEFAULT_INPUT;
int num_devices = 1;
- DeviceType device_type = DeviceType::DLA;
+ DeviceType device_type = (num_dla > 0 ? DeviceType::DLA:DeviceType::DSP);
ProcessArgs(argc, argv, config, num_devices, device_type, input_file);
if ((object_class_table = GetObjectClassTable(config)) == nullptr)
index 559067c25277f470bb11901b508ad7d79b368148..3eba80317338903566ccc4ea4cac664e3f60a01c 100644 (file)
include ../make.common
-CXXFLAGS += $(shell pkg-config --cflags opencv)
-LIBS += $(shell pkg-config --libs opencv)
+LIBS += -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio\
+ -lopencv_imgproc -lopencv_core
SOURCES = main.cpp ../segmentation/object_classes.cpp
$(EXE): $(TIDL_API_LIB) $(HEADERS) $(SOURCES)
- $(CXX) $(CXXFLAGS) $(SOURCES) $(TIDL_API_LIB) \
- $(LDFLAGS) $(LIBS) -o $@
+ $(CXX) $(CXXFLAGS) $(SOURCES) $(TIDL_API_LIB) $(LDFLAGS) $(LIBS) -o $@
clean::
$(RM) -f frame_*.png multibox_*.png
index 7fa3b23b38830755881896a330bab4aff8507d33..c3d9c8e7036de5bc41935d3101509cc0422174b7 100644 (file)
// If there are no devices capable of offloading TIDL on the SoC, exit
uint32_t num_dla = Executor::GetNumDevices(DeviceType::DLA);
uint32_t num_dsp = Executor::GetNumDevices(DeviceType::DSP);
- if (num_dla == 0 && num_dsp == 0)
+ if (num_dla == 0 || num_dsp == 0)
{
- std::cout << "TI DL not supported on this SoC." << std::endl;
+ std::cout << "ssd_multibox requires both DLA and DSP for execution."
+ << std::endl;
return EXIT_SUCCESS;
}
diff --git a/tidl_api/Makefile b/tidl_api/Makefile
index 37bbc1b3c74dde5071fee7f3a0dd12a2fd1764ed..bc0a416c398f5dc6543ac314ed5eff75bee127eb 100644 (file)
--- a/tidl_api/Makefile
+++ b/tidl_api/Makefile
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
-MAJOR_VER=1
-MINOR_VER=0
-PATCH_VER=0
-
-ifeq ($(shell git rev-parse --short HEAD 2>&1 1>/dev/null; echo $$?),0)
-BUILD_SHA?=$(shell git rev-parse --short HEAD)
-endif
-
LIB_NAME = tidl_api.a
DSP_SRCFILE = dsp/ocl_wrapper.cl
DSP_OUTFILE = dsp/ocl_wrapper.dsp_h
all: $(LIB_NAME) $(LIB_IMGUTIL_NAME)
include make.inc
+include make.buildid
+
RM = rm
AR = ar
HEADERS += inc/configuration.h inc/execution_object.h inc/executor.h
HEADERS += inc/imgutil.h
-.PHONY: $(BUILD_ID)
-BUILD_ID := -D_BUILD_VER=$(shell echo "" | \
- awk '{ printf ("%02d.%02d.%02d", $(MAJOR_VER), \
- $(MINOR_VER), $(PATCH_VER)); }') \
- -D_BUILD_SHA=$(BUILD_SHA)
-
ifeq ($(BUILD), debug)
CXXFLAGS += -Og -g -ggdb
$(AR) cr $@ $(HOST_OBJ_FILES)
-$(LIB_IMGUTIL_NAME): CXXFLAGS += $(shell pkg-config --cflags opencv)
-
$(LIB_IMGUTIL_NAME): $(HOST_OBJ_IMGUTIL_FILES)
$(AR) cr $@ $(HOST_OBJ_IMGUTIL_FILES)
diff --git a/tidl_api/make.buildid b/tidl_api/make.buildid
--- /dev/null
+++ b/tidl_api/make.buildid
@@ -0,0 +1,39 @@
+# Copyright (c) 2018 Texas Instruments Incorporated - http://www.ti.com/
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of Texas Instruments Incorporated nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+MAJOR_VER=1
+MINOR_VER=0
+PATCH_VER=0
+
+ifeq ($(shell git rev-parse --short HEAD 2>&1 1>/dev/null; echo $$?),0)
+BUILD_SHA?=$(shell git rev-parse --short HEAD)
+endif
+
+.PHONY: $(BUILD_ID)
+BUILD_ID := -D_BUILD_VER=$(shell echo "" | \
+ awk '{ printf ("%02d.%02d.%02d", $(MAJOR_VER), \
+ $(MINOR_VER), $(PATCH_VER)); }') \
+ -D_BUILD_SHA=$(BUILD_SHA)
diff --git a/tidl_api/make.inc b/tidl_api/make.inc
index 32635c08415d4e21bc5399e59b9d726537b778b5..aee34fe37be9e891f908385396d97a5a6fb67a92 100644 (file)
--- a/tidl_api/make.inc
+++ b/tidl_api/make.inc
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
-
# ------------------------------------------------------------------------------
#
# If making on x86 assume cross compile for ARM target
diff --git a/viewer/Makefile b/viewer/Makefile
index 4ea538467e01b763c192c1bcbdbebc13c5a96582..d94171247eeec2d8059b5b8c11a9b3a7ca0a284a 100644 (file)
--- a/viewer/Makefile
+++ b/viewer/Makefile
# -m32 required on x86 to ensure consistent layout of struct sTIDL_Network_t
ifeq ($(TARGET),x86)
CXX = g++
- CXXFLAGS = -m32 -static
- LDFLAGS =
+ CXXFLAGS += -m32 -static
else
include $(TIDL_API_DIR)/make.inc
endif
+include $(TIDL_API_DIR)/make.buildid
+
CXXFLAGS += -o3
#CXXFLAGS += -g -ggdb
CXXFLAGS += --std=c++11 -Wall -Werror
CXXFLAGS += -Iinc -I$(TIDL_API_DIR)/inc -I$(TIDL_API_DIR)/src
+CXXFLAGS += $(BUILD_ID)
+
SOURCES = main.cpp tidl_viewer.cpp dot_graph.cpp $(TIDL_API_DIR)/src/util.cpp
-$(EXE): $(TIDL_API_LIB) $(HEADERS) $(SOURCES)
+$(EXE): $(HEADERS) $(SOURCES)
mkdir -p $(TARGET)
- $(CXX) $(CXXFLAGS) $(SOURCES) $(TIDL_API_LIB) $(LDFLAGS) -o $@
+ $(CXX) $(CXXFLAGS) $(SOURCES) $(LDFLAGS) -o $@
clean::
$(RM) $(EXE) *.dot *.svg
diff --git a/viewer/dot_graph.cpp b/viewer/dot_graph.cpp
index e281c195c186a281421e822d30fcf167a6ad63d2..15a291f9709d189bda59e8b15c18796a028a82f1 100644 (file)
--- a/viewer/dot_graph.cpp
+++ b/viewer/dot_graph.cpp
else if (p.poolingType == TIDL_AveragePooling)
s += " Average";
- s+= "\\n" + std::to_string(p.kernelW) + "x" + std::to_string(p.kernelH);
+ if (p.kernelW != 0 && p.kernelH != 0)
+ s+= "\\n" + std::to_string(p.kernelW) + "x" + std::to_string(p.kernelH);
return s;
}
diff --git a/viewer/main.cpp b/viewer/main.cpp
index c44e98f7098a3a816a71e9fa0a373ed58d19692f..c766b104794629ef127e61a1dd917016cb1862ab 100644 (file)
--- a/viewer/main.cpp
+++ b/viewer/main.cpp
}
}
+#define STRING(S) XSTRING(S)
+#define XSTRING(S) #S
void DisplayHelp()
{
+ std::string version = STRING(_BUILD_VER);
+ version += ".";
+ version += STRING(_BUILD_SHA);
+
std::cout << "Usage: tidl_viewer -d <dot file name> <network binary file>\n"
- "Options: \n"
+ << "Version: " << version << std::endl
+ << "Options: \n"
" -p Print network layer info\n"
" -h Display this help message\n";
}