Recommended Project Directory Structure - 2023.2 English

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
UG1079
Release Date
2023-12-04
Version
2023.2 English

The following directory structure and coding practices are recommended for organizing your AI Engine projects to provide clarity and reuse.

  • All adaptive data flow (ADF) graph class definitions, that is, all the ADF graphs that are derived from graph class adf::graph, must be located in a header file. Multiple ADF graph definitions can be included in the same header file. This class header file should be included in the main application file where the actual top-level graph is declared in the file scope.
  • There should be no dependencies on the order that the header files are included. All header files must be self-contained and include all the other header files that they need.
  • There should be no file scoped variable or data-structure definitions in the graph header files. Any definitions (including static) must be declared in a separate source file that can be identified in the header property of the kernel where they are referenced (see Look-up Tables).
  • Only one source file is allowed to be specified as kernel source via adf::source. When sub-functions are defined as a library in separate source files (for example, util.hpp and util.cpp), the workaround is to:
    • Include all the library source files in a header file (for example, lib.hpp):
      #pragma once
      #include <util.hpp>
      #include <util.cpp>
    • And then include the header file lib.hpp in the kernel source file.