From 11777b58e9c89a9496bf0f11db16fd9b085afc36 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 6 Jun 2013 13:30:06 -0700 Subject: gras: moved config structs into own header --- include/gras/CMakeLists.txt | 1 + include/gras/block.hpp | 107 +------------------------------------------- include/gras/block.i | 1 + include/gras/hier_block.i | 1 + include/gras/top_block.hpp | 23 +--------- 5 files changed, 5 insertions(+), 128 deletions(-) (limited to 'include/gras') diff --git a/include/gras/CMakeLists.txt b/include/gras/CMakeLists.txt index 7f37b1a..d0e3cfa 100644 --- a/include/gras/CMakeLists.txt +++ b/include/gras/CMakeLists.txt @@ -6,6 +6,7 @@ install(FILES exception.i chrono.hpp block.hpp + block_config.hpp block.i element.hpp element.i diff --git a/include/gras/block.hpp b/include/gras/block.hpp index 5a6e5e2..72ae9b9 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -3,6 +3,7 @@ #ifndef INCLUDED_GRAS_BLOCK_HPP #define INCLUDED_GRAS_BLOCK_HPP +#include #include #include #include @@ -16,112 +17,6 @@ namespace gras { -//! Configuration parameters for an input port -struct GRAS_API InputPortConfig -{ - InputPortConfig(void); - - //! The size of an item in bytes - size_t item_size; - - /*! - * Set an input reserve requirement such that work is called - * with an input buffer at least reserve items in size. - * - * Default = 1. - */ - size_t reserve_items; - - /*! - * Constrain the input buffer allocation size: - * The scheduler may accumulate multiple buffers - * into a single larger buffer under failure conditions. - * The maximum size of this accumulated buffer - * is constrained by this maximum_items setting. - * - * Default = 0 aka disabled. - */ - size_t maximum_items; - - /*! - * Set buffer inlining for this port config. - * Inlining means that the input buffer can be used as an output buffer. - * The goal is to make better use of cache and memory bandwidth. - * - * By default, inlining is disabled on all input ports. - * The user should enable inlining on an input port - * when it is understood that the work function will read - * before writting to a particular section of the buffer. - * - * The scheduler will inline a buffer when - * * inlining is enabled on the particular input port - * * block holds the only buffer reference aka unique - * * the input buffer has the same affinity as the block - * * the input port has a buffer look-ahead of 0 - * - * Default = false. - */ - bool inline_buffer; - - /*! - * Preload the input queue with num preload items. - * All items preloaded into the buffer will be 0. - * This is used to implement zero-padding for - * things like sliding dot products/FIR filters. - * - * - Increasing the preload at runtime will - * inject more items into the input queue. - * - Decreasing the preload at runtime will - * consume random items from the input queue. - * - * Default = 0. - */ - size_t preload_items; - - /*! - * Force this block done when input port is done. - * When the upstream feeding this port declares done, - * this block will mark done once upstream notifies. - * The primary usage is to modify the done logic - * for the purposes of unit test confiruability. - * - * If the force done option is false, the block will - * not mark done when this port's upstream is done. - * However, this block will mark done when all - * input ports are done, reguardless of this setting. - * - * Default = true. - */ - bool force_done; -}; - -//! Configuration parameters for an output port -struct GRAS_API OutputPortConfig -{ - OutputPortConfig(void); - - //! The size of an item in bytes - size_t item_size; - - /*! - * Set an output reserve requirement such that work is called - * with an output buffer at least reserve items in size. - * - * Default = 1. - */ - size_t reserve_items; - - /*! - * Constrain the output buffer allocation size: - * The user might set a small maximum items - * to reduce the amount of buffered items - * waiting for processing in downstream queues. - * - * Default = 0 aka disabled. - */ - size_t maximum_items; -}; - struct GRAS_API Block : Element { //! Contruct an empty/null block diff --git a/include/gras/block.i b/include/gras/block.i index 5c62f7e..6ac1d5c 100644 --- a/include/gras/block.i +++ b/include/gras/block.i @@ -13,6 +13,7 @@ %import %include %include +%include %include //////////////////////////////////////////////////////////////////////// diff --git a/include/gras/hier_block.i b/include/gras/hier_block.i index da57e3d..376bbf4 100644 --- a/include/gras/hier_block.i +++ b/include/gras/hier_block.i @@ -8,6 +8,7 @@ %} %import +%include %include #endif /*INCLUDED_GRAS_HIER_BLOCK_I*/ diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp index 17f1e30..415c03e 100644 --- a/include/gras/top_block.hpp +++ b/include/gras/top_block.hpp @@ -3,33 +3,12 @@ #ifndef INCLUDED_GRAS_TOP_BLOCK_HPP #define INCLUDED_GRAS_TOP_BLOCK_HPP +#include #include namespace gras { -struct GRAS_API GlobalBlockConfig -{ - GlobalBlockConfig(void); - - /*! - * Constrain the maximum number of items that - * work can be called with for all output ports. - * - * Default = 0 aka disabled. - */ - size_t maximum_output_items; - - /*! - * Set the global memory node affinity. - * Blocks that have not been explicitly set, - * will take on this new buffer_affinity. - * - * Default = -1 aka no affinity. - */ - long buffer_affinity; -}; - struct GRAS_API TopBlock : HierBlock { TopBlock(void); -- cgit