[vsipl++] [patch] Multiply-add user-defined kernel

Jules Bergmann jules at codesourcery.com
Mon Sep 1 11:40:03 UTC 2008


Don McCoy wrote:
> This kernel extends the user-defined kernel framework to allow functions
> having three inputs and one output.  Multiply-add is used as a test case
> for this.  At this time, only scalar floats and complex-interleaved
> floats are supported.
> 
> A few other minor corrections are included with this patch.
> 
> Ok to commit?

Don, this looks good. -- Jules


> +    length_type isize;
> +    length_type osize;
> +    length_type dtl_size;
> +    {

Why is this region scoped?

> +      ukp.pre_chunks = 0;
> +      isize = vh0.buffer_size() + vh1.buffer_size() + vh2.buffer_size();
> +      osize = vh3.buffer_size();
> +      dtl_size = vh0.dtl_size() + vh1.dtl_size() + vh2.dtl_size() + vh3.dtl_size();
> +    }


>  struct Pinfo
>  {
> -  unsigned int dim;
> -  unsigned int l_total_size;
> -  unsigned int l_offset[3];
> -  unsigned int l_size[3];
> -  signed int   l_stride[3];
> -  signed int   g_offset[3];
> -  signed int   o_leading[3];
> -  signed int   o_trailing[3];
> +  unsigned int dim;            // dimensions in this sub-block
> +  unsigned int l_total_size;   // total elements for this iteration
> +  unsigned int l_offset[3];    // offset to beginning of data (if alignment
> +                               //  was required for DMA)

				     offset to beginning of chunk
				     (if overlap is requested, or if alignment
				      is required for DMA).

> +  unsigned int l_size[3];      // elements per dimension for this iteration
> +  signed int   l_stride[3];    // next-element stride in each dimension
> +  signed int   g_offset[3];    // offset from block origin 

				     local chunk's offset in global view.

> +  signed int   o_leading[3];   // 

				     leading overlap

> +  signed int   o_trailing[3];  // 

				     trailing overlap
>  };


> Index: tests/GNUmakefile.inc.in
> ===================================================================
> --- tests/GNUmakefile.inc.in	(revision 218845)
> +++ tests/GNUmakefile.inc.in	(working copy)
> @@ -40,7 +40,8 @@
>  tests_cxx_sources += $(wildcard $(srcdir)/tests/ref-impl/*.cpp)
>  
>  # These need to be linked with -lvsip_csl
> -tests_csl_cxx_sources := $(wildcard $(srcdir)/tests/tutorial/*.cpp)
> +tests_csl_cxx_sources := $(wildcard $(srcdir)/tests/tutorial/*.cpp) \
> +                         $(wildcard $(srcdir)/tests/ukernel/*.cpp)

Is it necessary to link with -lvsip_csl?

-- 
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705



More information about the vsipl++ mailing list