summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8876795)
raw | patch | inline | side by side (parent: 8876795)
author | Ajay Jayaraj <ajayj@ti.com> | |
Thu, 19 Apr 2018 18:27:36 +0000 (13:27 -0500) | ||
committer | Ajay Jayaraj <ajayj@ti.com> | |
Thu, 19 Apr 2018 18:49:32 +0000 (13:49 -0500) |
(MCT-964)
25 files changed:
diff --git a/docs/source/api.rst b/docs/source/api.rst
--- /dev/null
+++ b/docs/source/api.rst
@@ -0,0 +1,9 @@
+******************
+TINN API Reference
+******************
+
+.. doxygennamespace:: tinn
+ :project: TINN
+ :members:
+
+
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 6edf0e88abbf7bf7bd4d604b5a8e9fec606ea319..85379f73e500fee5b222e353795cc2b6f266b1ac 100644 (file)
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
master_doc = 'index'
# General information about the project.
-project = u'TI Neural Network API User\'s Guide'
+project = u'TI Neural Network API'
copyright = u'2018, Texas Instruments Incorporated'
# The version info for the project you're documenting, acts as replacement for
# -- Breathe extension to integrate doxygen output --
breathe_projects = {
-"TIDL":"../../tinn_api/doxygen/xml/",
+"TINN":"../../tinn_api/doxygen/xml/",
}
index d46fe38dfe413a66b4f756bc21a07a90a87bc577..1cb553a0747f66a82ac28a76d2d3d80fe2e28b2a 100644 (file)
+**********
Disclaimer
**********
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". TI AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY TI. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM TI.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.
-
-
-Important Notice
-****************
-Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as "components") are sold subject to TI's terms and conditions of sale supplied at the time of order acknowledgment.
-
-TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI's terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed.
-
-TI assumes no liability for applications assistance or the design of Buyers' products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers' products and applications, Buyers should provide adequate design and operating safeguards.
-
-TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.
-
-Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions.
-
-Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
-
-Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications.
-
-In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI's goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms.
-
-No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use.
-
-Only those TI components which TI has specifically designated as military grade or "enhanced plastic" are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.
-
-TI has specifically designated certain components which meet ISO/TS16949 requirements, mainly for automotive use. Components which have not been so designated are neither designed nor intended for automotive use; and TI will not be responsible for any failure of such components to meet such requirements.
diff --git a/docs/source/example.rst b/docs/source/example.rst
--- /dev/null
+++ b/docs/source/example.rst
@@ -0,0 +1,92 @@
+******************
+Using the TINN API
+******************
+
+This example illustrates using the TI Neural Network (TINN) API to offload deep learning network processing from a Linux application to the C66x DSPs or DLAs on AM57x devices.
+
+Step 1
+======
+
+Determine if there are any TINN capable devices on the AM57x SoC:
+
+.. code-block:: c++
+
+ uint32_t num_dla = Executor::GetNumDevices(DeviceType::DLA);
+ uint32_t num_dsp = Executor::GetNumDevices(DeviceType::DSP);
+
+Step 2
+======
+Create a Configuration object by reading it from a file or by initializing it directly. The example below parses a configuration file and initializes the Configuration object. See ``tidl/testvecs/config/infer`` for examples of configuration files.
+
+.. code::
+
+ Configuration configuration;
+ bool status = configuration.ReadFromFile(config_file);
+
+.. note::
+ Refer TINN Translation Tool documentation for creating TINN network and parameter binary files from TensorFlow and Caffe.
+
+Step 3
+======
+Create an Executor with the approriate device type, set of devices and a configuration. In the snippet below, an Executor is created on 2 DLAs.
+
+.. code-block:: c++
+
+ DeviceIds ids = {DeviceId::ID0, DeviceId::ID1};
+ Executor executor(DeviceType::DLA, ids, configuration);
+
+Step 4
+======
+Get the set of available ExecutionObjects and allocate input and output buffers for each ExecutionObject.
+
+.. code-block:: c++
+
+ const ExecutionObjects& execution_objects = executor.GetExecutionObjects();
+ int num_eos = execution_objects.size();
+
+ // Allocate input and output buffers for each execution object
+ std::vector<void *> buffers;
+ for (auto &eo : execution_objects)
+ {
+ ArgInfo in = { ArgInfo(malloc(frame_sz), frame_sz)};
+ ArgInfo out = { ArgInfo(malloc(frame_sz), frame_sz)};
+ eo->SetInputOutputBuffer(in, out);
+
+ buffers.push_back(in.ptr());
+ buffers.push_back(out.ptr());
+ }
+
+
+
+Step 5
+======
+Run the network on each input frame. The frames are processed with available execution objects in a pipelined manner with additional num_eos iterations to flush the pipeline (epilogue).
+
+.. code-block:: c++
+
+ for (int frame_idx = 0; frame_idx < configuration.numFrames + num_eos; frame_idx++)
+ {
+ ExecutionObject* eo = execution_objects[frame_idx % num_eos].get();
+
+ // Wait for previous frame on the same eo to finish processing
+ if (eo->ProcessFrameWait())
+ WriteFrame(*eo, output_data_file);
+
+ // Read a frame and start processing it with current eo
+ if (ReadFrame(*eo, frame_idx, configuration, input_data_file))
+ eo->ProcessFrameStartAsync();
+ }
+
+
+
+Putting it together
+===================
+The code snippet :ref:`tidl_main` illustrates using the API to offload a network.
+
+.. literalinclude:: ../../examples/test/main.cpp
+ :name: tidl_main
+ :caption: examples/test/main.cpp
+ :lines: 161-195,213-218,220-225
+ :linenos:
+
+For a complete example of using the API, refer ``tinn/examples/opencl/tidl/main.cpp`` on the EVM filesystem.
diff --git a/docs/source/index.rst b/docs/source/index.rst
index cba030c9e79064aeb32defc3bcb1a348bd3c7993..1e49db60dfaef415a4fdeb53736deac860dcb088 100644 (file)
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
:maxdepth: 3
intro
+ example
+ api
+ notice
disclaimer
.. image:: images/platform_red.png
diff --git a/docs/source/intro.rst b/docs/source/intro.rst
index c2e595cbdf8f9d5027802baa0876f7d0c88b9868..46a775d68409710c4a52d2939fe6ff22fbdc468f 100644 (file)
--- a/docs/source/intro.rst
+++ b/docs/source/intro.rst
-*******************************
-TI Deep Learning (TIDL) example
-*******************************
+************
+Introduction
+************
-This example illustrates using the TI Neural Network (TINN) API to offload deep learning network processing from a Linux application to the C66x DSPs or DLAs on AM57x devices.
+The TI Neural Network (TINN) API is a C++ API to abstract lower level OpenCL host APIs for custom devices. The TINN API enables AM57x applications to leverage DLAs or DSPs for deep learning. The API:
-OpenCL v1.2 added support for custom devices. The OpenCL runtime for a custom device implements the standard OpenCL host API functions. However, a custom device does not support OpenCL-C programs. Host programs can invoke a fixed set of kernels built into the runtime. The DLAs on AM57x SoCs are modeled as OpenCL custom devices with a fixed set of built-in kernels corresponding to TIDL.
-
-The TINN API is a C++ API to abstract lower level OpenCL host APIs for custom devices. The TINN API enables AM57x applications to leverage DLAs or DSPs for deep learning. The API:
-
-* Enables easy integration of TIDL into other frameworks such as OpenCV
+* Enables easy integration of TINN into other frameworks such as OpenCV
* Is low overhead - OpenCL APIs account for ~1.5% of overall per frame processing time (224x224 frame with 3 channels)
-* Provides an example of using the OpenCL DLAs custom device TIDL kernels
-* Provides a common abstraction for running TIDL networks on DLAs or C66x DSPs
-
-.. note::
- DLA: TI Deep Learning Accelerator, also known as EVE.
+* Provides an example of using the OpenCL DLAs custom device kernels
+* Provides a common abstraction for running networks on DLAs or C66x DSPs
-TINN API
---------
+OpenCL v1.2 added support for custom devices. The OpenCL runtime for a custom device implements the standard OpenCL host API functions. However, a custom device does not support OpenCL-C programs. Host programs can invoke a fixed set of kernels built into the runtime. The DLAs on AM57x SoCs are modeled as OpenCL custom devices with a fixed set of built-in kernels.
The figure below describes the relationship between TINN APIs, the user's application and OpenCL host APIs.
-.. figure:: ../images/tinn_api.png
+.. figure:: images/tinn_api.png
The API consistes of 3 classes with simple user interfaces:
* Executor
* ExecutionObject
-Using the TINN API
-++++++++++++++++++
-
-Step 1
-======
-
-Determine if there are any TIDL capable devices on the AM57x SoC:
-
-.. code-block:: c++
-
- uint32_t num_dla = Executor::GetNumDevicesSupportingTIDL(DeviceType::DLA);
- uint32_t num_dsp = Executor::GetNumDevicesSupportingTIDL(DeviceType::DSP);
-
-Step 2
-======
-Create a Configuration object by reading it from a file or by initializing it directly. The example below parses a configuration file and initializes the Configuration object. See ``tidl/testvecs/config/infer`` for examples of configuration files.
-
-.. code::
-
- Configuration configuration;
- bool status = configuration.ReadFromFile(config_file);
-
.. note::
- Refer TIDL Translation Tool documentation for creating TIDL network and parameter binary files from TensorFlow and Caffe.
-
-Step 3
-======
-Create an Executor with the approriate device type, set of devices and a configuration. In the snippet below, an Executor is created on 2 DLAs.
-
-.. code-block:: c++
-
- DeviceIds ids = {DeviceId::ID0, DeviceId::ID1};
- Executor executor(DeviceType::DLA, ids, configuration);
-
-Step 4
-======
-Get the set of available ExecutionObjects and allocate input and output buffers for each ExecutionObject.
-
-.. code-block:: c++
-
- const ExecutionObjects& execution_objects = executor.GetExecutionObjects();
- int num_eos = execution_objects.size();
-
- // Allocate input and output buffers for each execution object
- std::vector<void *> buffers;
- for (auto &eo : execution_objects)
- {
- ArgInfo in = { ArgInfo(malloc(frame_sz), frame_sz)};
- ArgInfo out = { ArgInfo(malloc(frame_sz), frame_sz)};
- eo->SetInputOutputBuffer(in, out);
-
- buffers.push_back(in.ptr());
- buffers.push_back(out.ptr());
- }
-
-
-
-Step 5
-======
-Run the network on each input frame. The frames are processed with available execution objects in a pipelined manner with additional num_eos iterations to flush the pipeline (epilogue).
-
-.. code-block:: c++
-
- for (int frame_idx = 0; frame_idx < configuration.numFrames + num_eos; frame_idx++)
- {
- ExecutionObject* eo = execution_objects[frame_idx % num_eos].get();
-
- // Wait for previous frame on the same eo to finish processing
- if (eo->ProcessFrameWait())
- WriteFrame(*eo, output_data_file);
-
- // Read a frame and start processing it with current eo
- if (ReadFrame(*eo, frame_idx, configuration, input_data_file))
- eo->ProcessFrameStartAsync();
- }
-
-
-
-Putting it together
-===================
-The code snippet :ref:`tidl_main` illustrates using the API to offload a network.
-
-.. literalinclude:: ../../../../examples/tidl/main.cpp
- :name: tidl_main
- :caption: /usr/share/ti/examples/opencl/tidl/main.cpp
- :lines: 160-193,211-216,218-223
- :linenos:
-
-For a complete example of using the API, refer ``/usr/share/ti/examples/opencl/tidl/main.cpp`` on the EVM filesystem.
-
-TINN API documentation
-----------------------
-
-.. doxygennamespace:: tidl
- :project: TIDL
- :members:
-
+ DLA: TI Deep Learning Accelerator, also known as EVE.
diff --git a/docs/source/notice.rst b/docs/source/notice.rst
--- /dev/null
+++ b/docs/source/notice.rst
@@ -0,0 +1,25 @@
+****************
+Important Notice
+****************
+
+Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as "components") are sold subject to TI's terms and conditions of sale supplied at the time of order acknowledgment.
+
+TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI's terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed.
+
+TI assumes no liability for applications assistance or the design of Buyers' products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers' products and applications, Buyers should provide adequate design and operating safeguards.
+
+TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.
+
+Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions.
+
+Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
+
+Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications.
+
+In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI's goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms.
+
+No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use.
+
+Only those TI components which TI has specifically designated as military grade or "enhanced plastic" are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use.
+
+TI has specifically designated certain components which meet ISO/TS16949 requirements, mainly for automotive use. Components which have not been so designated are neither designed nor intended for automotive use; and TI will not be responsible for any failure of such components to meet such requirements.
diff --git a/examples/test/Makefile b/examples/test/Makefile
index 86a111c5e47c151a8cf58db0a5526b6ff9a3a1d7..a1c5b5a469e9b66188c9e610971375509e9e7bc1 100644 (file)
--- a/examples/test/Makefile
+++ b/examples/test/Makefile
$(TINN_LIB):
$(MAKE) -C $(TINN_DIR) $(TINN_LIB_NAME)
-clean::
- $(RM) -f $(EXE) stats_tool_out.* *.out
+realclean: clean
$(MAKE) -C $(TINN_DIR) clean
$(MAKE) -C $(TINN_DIR)/dsp clean
+
+clean::
+ $(RM) -f $(EXE) stats_tool_out.* *.out
diff --git a/examples/test/main.cpp b/examples/test/main.cpp
index 5805620a5f094dd65c4993b18f3009b37c09c5d4..6a1fb60174ca4c80774061252ab711e883dcfc13 100644 (file)
--- a/examples/test/main.cpp
+++ b/examples/test/main.cpp
bool __TI_show_debug_ = false;
-using namespace tidl;
+using namespace tinn;
bool RunMultipleExecutors(const std::string& config_file_1,
const std::string& config_file_2,
signal(SIGABRT, exit);
signal(SIGTERM, exit);
- // If there are no devices capable of offloading TIDL on the SoC, exit
- uint32_t num_dla =
- Executor::GetNumDevicesSupportingTIDL(DeviceType::DLA);
- uint32_t num_dsp =
- Executor::GetNumDevicesSupportingTIDL(DeviceType::DSP);
+ // If there are no devices capable of offloading TINN 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)
{
std::cout << "TI DL not supported on this SoC." << std::endl;
__free_ddr(b);
}
- catch (tidl::Exception &e)
+ catch (tinn::Exception &e)
{
std::cerr << e.what() << std::endl;
status = false;
return status;
}
-namespace tidl {
+namespace tinn {
extern bool CompareFiles (const std::string &F1, const std::string &F2);
extern bool CompareFrames(const std::string &F1, const std::string &F2,
int numFrames, int width, int height);
index 173ee23caee32b64ac4c26382200658d10e6ac84..69c97cec5e3b6e702e5b1e8c8211e7c4db8bcb49 100644 (file)
#include "execution_object.h"
#include "configuration.h"
-using namespace tidl;
+using namespace tinn;
extern bool ReadFrame(ExecutionObject& eo,
int frame_idx,
for (auto b : buffers)
__free_ddr(b);
}
- catch (tidl::Exception &e)
+ catch (tinn::Exception &e)
{
std::cerr << e.what() << std::endl;
status = false;
index 0763dae49e1cfc1ac74465b143139b2181d9043d..52c8fcf09c616505bcc03707c37e2b8ff396aa8e 100644 (file)
#include <string>
#include <iostream>
-namespace tidl {
+namespace tinn {
/*! @class Configuration
@brief Specifies the configuration required for a network
index f34f055c959b590ee0f2a1deaffb2cd9d97c804a..b02a0bb85db7753c9f853be7cee141f43d5b25e7 100644 (file)
#include <memory>
-namespace tidl {
+namespace tinn {
class Kernel;
class Device;
std::unique_ptr<Impl> pimpl_m;
};
-} // namespace tidl
+} // namespace tinn
index 118794d857c932a9753fff00b7cefad086fce124..e2ce077280f1c26ea1e260972923bebd9edf6a2c 100644 (file)
--- a/tinn_api/inc/executor.h
+++ b/tinn_api/inc/executor.h
#include "configuration.h"
-namespace tidl {
+namespace tinn {
//! Enumerates types of devices available to offload the network.
enum class DeviceType { DSP, /**< Offload to C66x DSP */
//! available for TI DL.
//! @param device_type DSP or EVE/DLA device
//! @return number of devices available
- static uint32_t GetNumDevicesSupportingTIDL(DeviceType device_type);
+ static uint32_t GetNumDevices(DeviceType device_type);
//! @brief Returns a string corresponding to the API version
//!
//! @return The size of the buffer or scalar represented by ArgInfo
size_t size() const { return size_m; }
- // Only used by tidl::Device
+ // Only used by tinn::Device
Kind kind() const { return kind_m; }
bool isLocal() const { return (ptr_m == nullptr); }
std::string message_m;
};
-} // namespace tidl
+} // namespace tinn
index f79f629137b7db9096b6c4d07dbf06f6af3fce9f..7c6975cac98b3d4b2bc7989de4df17a057b45edf 100644 (file)
#include "configuration.h"
-using namespace tidl;
+using namespace tinn;
void Configuration::Print(std::ostream &os) const
{
index dd108bd5d7aa9967f079f37afa95ae894e99dbef..271ec199d77f72d95f6d9d2a1fdc753d5b0789d5 100644 (file)
namespace ascii = boost::spirit::ascii;
namespace ph = boost::phoenix;
-using namespace tidl;
+using namespace tinn;
template <typename Iterator>
struct ConfigParser : qi::grammar<Iterator, ascii::space_type>
index a90533b114b7d155ef5918b00212b03b0db69d9e..46606833e140e9b39482ba5446f5838fe389eed9 100644 (file)
#include "common_defines.h"
#include <string.h>
-using namespace tidl;
+using namespace tinn;
class ExecutionObject::Impl
{
sizeof(OCL_TIDL_InitializeParams));
shared_initialize_params_m->tidlHeapSize = extmem_heap_size;
- shared_initialize_params_m->l2HeapSize = tidl::internal::DMEM1_SIZE;
- shared_initialize_params_m->l1HeapSize = tidl::internal::DMEM0_SIZE;
+ shared_initialize_params_m->l2HeapSize = tinn::internal::DMEM1_SIZE;
+ shared_initialize_params_m->l1HeapSize = tinn::internal::DMEM0_SIZE;
shared_initialize_params_m->enableTrace = OCL_TIDL_TRACE_OFF;
// Setup kernel arguments for initialize
ArgInfo(shared_initialize_params_m.get(),
sizeof(OCL_TIDL_InitializeParams)),
device_m->type() == CL_DEVICE_TYPE_ACCELERATOR ?
- ArgInfo(nullptr, tidl::internal::DMEM1_SIZE):
+ ArgInfo(nullptr, tinn::internal::DMEM1_SIZE):
ArgInfo(nullptr, 4) };
k_initialize_m.reset(new Kernel(device_m,
index f7022cada8b11b145e15862bc0339544ab825457..8236a33b48e47f149949391bb8e2979a2e767ec0 100644 (file)
#include "trace.h"
-using namespace tidl;
+using namespace tinn;
using std::unique_ptr;
// on demand in the caller’s code where impl is not defined.
Executor::~Executor() = default;
-uint32_t Executor::GetNumDevicesSupportingTIDL(DeviceType device_type)
+uint32_t Executor::GetNumDevices(DeviceType device_type)
{
- return Device::GetNumDevicesSupportingTIDL(device_type);
+ return Device::GetNumDevices(device_type);
}
#define STRING(S) XSTRING(S)
void ExecutorImpl::InitializeNetworkCreateParam(TIDL_CreateParams *CP)
{
- CP->currCoreId = tidl::internal::CURR_CORE_ID;
- CP->currLayersGroupId = tidl::internal::CURR_LAYERS_GROUP_ID;
- CP->l1MemSize = tidl::internal::DMEM0_SIZE;
- CP->l2MemSize = tidl::internal::DMEM1_SIZE;
- CP->l3MemSize = tidl::internal::OCMC_SIZE;
-
- CP->quantHistoryParam1 = tidl::internal::QUANT_HISTORY_PARAM1;
- CP->quantHistoryParam2 = tidl::internal::QUANT_HISTORY_PARAM2;
- CP->quantMargin = tidl::internal::QUANT_MARGIN;
+ CP->currCoreId = tinn::internal::CURR_CORE_ID;
+ CP->currLayersGroupId = tinn::internal::CURR_LAYERS_GROUP_ID;
+ CP->l1MemSize = tinn::internal::DMEM0_SIZE;
+ CP->l2MemSize = tinn::internal::DMEM1_SIZE;
+ CP->l3MemSize = tinn::internal::OCMC_SIZE;
+
+ CP->quantHistoryParam1 = tinn::internal::QUANT_HISTORY_PARAM1;
+ CP->quantHistoryParam2 = tinn::internal::QUANT_HISTORY_PARAM2;
+ CP->quantMargin = tinn::internal::QUANT_MARGIN;
CP->optimiseExtMem = TIDL_optimiseExtMemL1;
}
index 35842cc069e121b2c4c597fb9d9034ade88ea1bc..d68e965c98fa45e0cb43317d9bb9f4a1fcf1774a 100644 (file)
#include "tidl_create_params.h" // for TIDL types
#include "execution_object.h"
-namespace tidl {
+namespace tinn {
// One instance across all devices available in the context
DeviceType core_type_m;
};
-} // namespace tidl
+} // namespace tinn
index 8275616a5443077f44d87264d780855489bb9fbc..e98a00ab9625e097c363a54c671a364c9245555a 100644 (file)
#include "ocl_util.h"
#include "trace.h"
-using namespace tidl;
+using namespace tinn;
static const char* error2string(cl_int err);
static void errorCheck(cl_int ret, int line);
}
// TI DL is supported on AM57x - EVE or C66x devices
-uint32_t Device::GetNumDevicesSupportingTIDL(DeviceType device_type)
+uint32_t Device::GetNumDevices(DeviceType device_type)
{
if (!PlatformIsAM57()) return 0;
index cac60b1a65fc14ce7cb2b130d096c76ba8561fe6..1f92fcede8961227d36392d3bf51b00698eee004 100644 (file)
#include <memory>
#include "executor.h"
-namespace tidl
+namespace tinn
{
typedef std::vector<ArgInfo> KernelArgs;
float GetFrequencyInMhz() const { return freq_in_mhz_m; }
- static uint32_t GetNumDevicesSupportingTIDL(DeviceType device_type);
+ static uint32_t GetNumDevices(DeviceType device_type);
protected:
index 121625a902d158c09c115cae82794f5422fb268d..ebd7181e2019665cba6200e986631762d17ec4b0 100644 (file)
#pragma once
-namespace tidl {
+namespace tinn {
namespace internal {
const size_t DMEM0_SIZE = 8*1024;
diff --git a/tinn_api/src/trace.cpp b/tinn_api/src/trace.cpp
index adaf72b4591c06a454c5f6e716c003367ca7da0d..bcf134058fdf3692050ff4c45ee65aa3d2e4f698 100644 (file)
--- a/tinn_api/src/trace.cpp
+++ b/tinn_api/src/trace.cpp
#include "trace.h"
-using namespace tidl;
+using namespace tinn;
#if defined(OA_ENABLE_TRACE)
diff --git a/tinn_api/src/trace.h b/tinn_api/src/trace.h
index bdbcb87a19b8fcfcb820e1a5feec5663e31a9070..93b7524ab31149c98a00a9444551dd315cc4da92 100644 (file)
--- a/tinn_api/src/trace.h
+++ b/tinn_api/src/trace.h
#include <cstdio>
#include <cstdarg>
-namespace tidl {
+namespace tinn {
/// Used to emit trace messages from runtime
class TRACE
diff --git a/tinn_api/src/util.cpp b/tinn_api/src/util.cpp
index 8683e7eb73d8324cf0c81d354da86a854220803d..41b829670c0d4a324cb903d07da457a95b243c72 100644 (file)
--- a/tinn_api/src/util.cpp
+++ b/tinn_api/src/util.cpp
#include <fstream>
#include <assert.h>
-using namespace tidl;
+using namespace tinn;
-std::size_t tidl::GetBinaryFileSize(const std::string &F)
+std::size_t tinn::GetBinaryFileSize(const std::string &F)
{
std::ifstream is;
is.open (F, std::ios::binary );
}
-bool tidl::ReadBinary(const std::string &F, char* buffer, int size)
+bool tinn::ReadBinary(const std::string &F, char* buffer, int size)
{
std::ifstream is;
is.open (F, std::ios::binary );
return true;
}
-bool tidl::CompareFiles(const std::string &F1, const std::string &F2)
+bool tinn::CompareFiles(const std::string &F1, const std::string &F2)
{
std::size_t s1 = GetBinaryFileSize(F1);
std::size_t s2 = GetBinaryFileSize(F2);
return false;
}
-bool tidl::CompareFrames(const std::string &F1, const std::string &F2,
+bool tinn::CompareFrames(const std::string &F1, const std::string &F2,
int numFrames, int width, int height)
{
bool status = true;
diff --git a/tinn_api/src/util.h b/tinn_api/src/util.h
index 10b9ef82cd7fa1911331a5e6001267fdf88ba93d..44316c7f1f53471bcd78384b1a87ba9e2256cccc 100644 (file)
--- a/tinn_api/src/util.h
+++ b/tinn_api/src/util.h
#include <cstddef>
#include "configuration.h"
-namespace tidl {
+namespace tinn {
std::size_t GetBinaryFileSize (const std::string &F);
bool ReadBinary (const std::string &F, char* buffer, int size);
bool CompareFrames(const std::string &F1, const std::string &F2,
int numFrames, int width, int height);
-} // namespace tidl
+} // namespace tinn