Static Data Flow Primitives Part I - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Static Data Flow Primitives Part I

Description:

... Output or Local fields compile to make sure the primitive ... Utilities Compile. Use Utilities $EDITOR. Utilities View Generated Code. 26. Laboratory SDF 1 ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 36
Provided by: williami1
Category:

less

Transcript and Presenter's Notes

Title: Static Data Flow Primitives Part I


1
Static Data Flow Primitives Part I
  • William I. LundgrenGedae, Inc.Telephone 856
    231 4458Fax 856 231 1403Email
    gedae_at_gedae.comWebsite www.gedae.com

2
Overview
  • Parts I, II and III of this lecture introduce the
    syntax of primitives and describes the
    implementation of primitives with static data
    flow.
  • For your reference and a complete listing of
    reserved words, modifiers and functions refer to
    the Primitive Programmers Manual and release
    notes.

3
Overview(continued)
  • Examples in Part I, II and III of this lecture
  • vx_multV illustrates
  • Structure of primitives
  • Informational fields
  • Data fields
  • Structure of input and output declarations
  • Stream data declarations
  • Vector tokens
  • Methods
  • Unity data flow
  • Apply method with
  • E function library
  • granularity reserved word and granularity loop

4
Overview(continued)
  • Examples in Part I, II and III of this lecture
    (continued)
  • mx_vx illustrates
  • Matrix tokens
  • Non-unity produce data flow parameter
  • Primitive with no methods
  • Parameter outputs
  • mx_rpart illustrates
  • Family notation
  • mx_delay illustrates
  • delay data flow parameter
  • vx_fft illustrates
  • Start and ClassReset methods

5
Overview(continued)
  • Examples in Part I, II and III of this lecture
    (continued)
  • m_rpartf illustrates
  • Forwarding a pointer to avoid memory copy
  • m_rfconcat illustrates
  • Setting a family of input pointers to output row
    partitions
  • mt_N_rpart illustrates
  • Tiles
  • Iteration
  • Streaming tiles from a matrix as a pointer
  • mt_N_cconcat illustrates
  • Setting a stream of input tile pointers output
    column partitions
  • mt_iter illustrates
  • Iteration without an apply method

6
Example vx_multV
  • Name vx_multV
  • Type static
  • Comment "Multiplication by Constant Real Vector
  • outn inn Vn Level 2 Tested"
  • Keyword "meta arithmetic","meta
    multiplication", multiply
  • Input
  • stream complex inN
  • float VN
  • Output
  • inplace stream complex outN in

Key Informational fields Data fields
Include field Methods
7
Example vx_multV(continued)
  • Include
  • include lte_crvmul.hgt
  • Apply
  • int g
  • for (g0 gltgranularity g)
  • e_crvmul(in,2,V,1,in,2,N) / complex vector
    real vector mult /
  • in N

Key Informational fields Data fields
Include field Methods
8
Informational Fieldsvx_multV
  • Name identifies the primitive
  • Type defines the primitive type for the Gedae
    parser
  • Comment documents this primitive
  • Keyword provides descriptors used by the search
    tool
  • Example
  • Name vx_multV
  • Type static
  • Comment "Multiplication by Constant Real Vector
  • outi ini Vi
  • Level 2 Tested"
  • Keyword "meta arithmetic","meta
    multiplication",multiply

9
Data Fieldsvx_multV
  • Input / Output defines the data flow modifiers,
    data element type, data name, token parameters
    and data flow parameters for a data input /
    output
  • Local defines the data element type, data name
    and token parameters for a local
  • Example
  • Input
  • stream complex inN
  • float VN
  • Output
  • inplace stream complex outN in

10
Data Declaration Structurevx_multV
  • The following description of the syntax of a data
    definition provides the general structure of data
    declaration

Data element type
Data name
Data flow parameters
In place modifier
inplace stream complex F out N(1) in
Data flow descriptors
Token parameters
In place identifier
Instantiation parameter
11
Include Fieldvx_multV
  • Include contains include directives, auxiliary
    code and any other code that needs to be included
    in the .c file generated by Gedae
  • Example
  • Include
  • include lte_crvmul.hgt

12
Methodsvx_multV
  • Apply contains extended C-code that implements
    the processing
  • Gedae reserved word granularity the number of
    box firings in 1 execution
  • The granularity must be accounted for in every
    apply method. In this example, it is accounted
    for with a granularity loop.
  • Example
  • Apply
  • int g
  • for (g0 gltgranularity g)
  • ltlt granularity loop contents omitted gtgt

13
Methodsvx_multV (continued)
  • Apply (continued)
  • Gedae has defined an API for vector functions
  • The library is called the E library
  • E library functions generally consist of 1 or 2
    inputs each with a stride, an output with a
    stride and a number of data elements to process
  • The input pointer, in, has to be incremented by
    the vector size
  • Example (apply method contents)
  • e_crvmul(in,2,V,1,in,2,N) / complex vector real
    vector mult /
  • in N

14
Data Arrangement in Memory
  • Gedae allocates a flat memory buffer for each
    stream input
  • In the case of a vector it allocates granularity
    DI N BpDE where
  • granularity is the number of firings per
    execution
  • DI is the consme/produce of the input/output
  • DEpT is data elements per token (or N, the vector
    size )
  • BpDE is the bytes per data element
  • Gedae assigns a pointer to the buffer to a
    variable with the name of the input. In this case
    the input is float in.
  • The author of the primitive must increment the
    variable in as the Apply method steps through the
    processing

Vector 1
Vector 2
Vector 3
in
in 6
in 12
15
Example mx_vx
  • Name mx_vx
  • Type static
  • Comment "Convert Matrix to Vectors
  • Matrix dumped row by row.
  • out(i)j inij
  • Level 2 Tested"
  • Keyword "meta identity transformations","meta
    conversions","meta tokentype"

Key Informational fields Data fields
Include field Methods
16
Example mx_vx(continued)
  • Input
  • stream complex inR1C
  • Output
  • inplace stream complex outC(R1) in
  • int R R1
  • / no apply method as function only causes buffer
    to be reinterpreted inplace /

Key Informational fields Data fields
Include field Methods
17
Data Fieldsmx_vx
  • Input The input shown is a matrix token as
    indicated by the 2 pairs of square brackets in
    larger font.
  • Output The first output shown has an produce of
    R1. Since the input has R1 rows, the output will
    need R1 vectors.
  • Output The second output does not have a stream
    modifier so it is a parameter. The output value
    is set in the declaration.
  • Example
  • Input
  • stream complex inR1C
  • Output
  • inplace stream complex outC(R1) in
  • int R R1

18
Data Arrangement in Memory
  • The diagram below indicates how the memory
    content has not changed just the interpretation
    of the data in that memory.
  • The example illustrated has a granularity of 3
    and a matrix size of 2 rows x 3 columns

Matrix 1
Matrix 2
Matrix 3
Row 1
Row 2
Row 1
Row 2
Row 1
Row 2
in
in 6
in 12
Vector 1
Vector 2
Vector 3
Vector 4
Vector 5
Vector 6
19
Methodsmx_vx (continued)
  • Apply No Apply method is needed since the data
    on the input and output buffers are the same, and
    the data does not need to be rearranged.
  • / no Apply method as function only causes
    buffer to be reinterpreted inplace /

20
Laboratory SDF 1Objective
  • In this laboratory you will build a static
    primitive. At the completion of this laboratory
    you should
  • Be able to add a custom primitive to a graph
  • Understand the primitive syntax, specifically
  • Name field
  • Type field
  • Comment field
  • Input field for declaring input data,
    specifically
  • stream modifier
  • data type declaration
  • consume syntax
  • Output field for declaring output data

21
Laboratory SDF 1Objective (continued)
  • Understand the primitive syntax, specifically
    (continued)
  • Apply method for processing the input and local
    data, and producing the output data. Specifically
    you should understand
  • granularity loops
  • Use of input and output pointers
  • Use of the primitive editor
  • Location and use of primitive templates

22
Laboratory SDF 1Instructions
  • Open the graph
  • training/Introduction/SDF_Primitive_Lab1/test_rang
    e
  • In that graph open the flow graph
  • test_range.range

23
Laboratory SDF 1Instructions (continued)
  • Use the add box dialog (EditgtAdd box) to add
  • training/Introduction/SDF_Primitive_Lab1/vx_multV
  • Select the Create Primitive button as shown in
    the dialog below

24
Laboratory SDF 1Instructions (continued)
  • Explore the Primitive Editor shown below

Warning! Anytime you change the Input, Output or
Local fields compile to make sure the primitive
is correct and then exit Gedae and reenter.
25
Laboratory SDF 1Instructions (continued)
  • Explore the Primitive Editor shown below
    (continued)
  • Look at all the menu items and particularly note
  • FilegtOpen Template
  • The whole Bookmarks menu
  • UtilitiesgtCompile
  • Use UtilitiesgtEDITOR
  • UtilitiesgtView Generated Code

26
Laboratory SDF 1Instructions (continued)
  • Create a box per the following specifications
  • There is 1 stream input with data type complex
  • There is 1 parameter inputs with data type float
  • The stream output data type is complex
  • The box multiplies the stream complex input
    element by element with the parameter float input
    using the following equation
  • outn.re inn.re Vn
  • outn.im inn.im Vn
  • The scheme is illustrated on the next chart

27
Laboratory SDF 1Instructions (continued)
  • Create a box per the following specifications
    (continued)
  • The box uses a vector of 4 complex values in
    stream memory and a vector of float values in
    parameter memory. The input and output are shown
    as 2 memories, but they are the really the same
    memory.
  • The illustration uses N 4 and granularity 2
  • The double lines indicate that both the real and
    imaginary parts are multiplied

Firing 1
Firing 2
For clarity of the diagram, only the first 2
multiplies for each vector are shown.
in
in 4
28
Laboratory SDF 1Work Time
  • We will allow about ¾ hour to complete the above
    exercises.

29
Laboratory SDF 1Solution vx_multV
  • Name vx_multV
  • Type static
  • Comment "Multiplication by Constant Real Vector
  • outn inn Vn"

30
Laboratory SDF 1 (continued) Solution vx_multV
  • Input
  • stream complex inN
  • float VN
  • Output
  • inplace stream complex outN in

31
Laboratory SDF 1 (continued) Solution vx_multV
  • Apply
  • int g, n
  • for ( g0 gltgranularity g)
  • for (n0 nltN n)
  • inn.re inn.re Vn
  • inn.im inn.im Vn
  • in N

32
Laboratory SDF 1 (continued)Solution vx_multV
  • Name the vx_ identifies the primitive as
    processing a complex vector of data
  • Type defines the primitive type for the Gedae
    parser
  • Comment documents this primitive
  • Keyword provides descriptors used by the search
    tool
  • Example
  • Name vx_multV
  • Type static
  • Comment "Multiplication by Constant Real Vector
  • outn inn Vn"

33
Laboratory SDF 1 (continued)Solution vx_multV
  • Input / Output defines the data flow modifiers,
    data element type, data name, token parameters
    and data flow parameters for a data input /
    output
  • Example
  • Input
  • stream complex inN
  • float VN
  • Output
  • inplace stream complex outN in

34
Laboratory SDF 1 (continued)Solution vx_multV
  • Apply contains extended C-code that implements
    the processing
  • Again, the granularity loop must be implemented
  • There is an additional loop, n, to process the
    elements of the vector.
  • Apply
  • int g, n
  • for ( g0 gltgranularity g)
  • for (n0 nltN n)
  • inn.re inn.re Vn
  • inn.im inn.im Vn
  • in N

35
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com