[vsipl++] [patch] New example showing how to use Tensor subviews
Stefan Seefeld
stefan at codesourcery.com
Thu Oct 8 22:23:06 UTC 2009
On 10/08/2009 05:50 PM, Don McCoy wrote:
> This example shows two ways to use a sub-matrix view of a Tensor, first
> as direct reference and secondly through a persistent subview that
> references the original view.
>
> Ok to commit?
While I'm happy to see more documentation / examples, I have some minor
issues:
> Index: examples/tensor_subview.cpp
> ===================================================================
> --- examples/tensor_subview.cpp (revision 0)
> +++ examples/tensor_subview.cpp (revision 0)
I believe we should stop adding things directly to examples/.
One of the yet-to-be-written chapters is an introduction about blocks
and views, and this is what I believe your example fits nicely into.
Thus I'd like to propose to put the above into
examples/views/tensor_subview.cpp, i.a. make 'views/' a new
subdirectory, dedicated to explaining the various view APIs.
> +using namespace std;
> +using namespace vsip;
> +using namespace vsip_csl;
I think we should also avoid to use namespace directives too freely, as
that has the potential of creating name clashes or ambiguities. Notably,
as soon as you use 'vsip' and 'vsip_csl', 'impl' becomes ambiguous...
Other than that, I think your example is fine.
Thanks,
Stefan
--
Stefan Seefeld
CodeSourcery
stefan at codesourcery.com
(650) 331-3385 x718
More information about the vsipl++
mailing list