Hi hi,

I see, thanks.
However, my question was rather about packing multiple operations together,
and specifically scoping the necessary kernel generator object (or more
generally scoping the std::vector<statement> that has to be packed together
for generation/execution)
*bool code_generator::add(statement)*
returns false if the statement is unsupported (or could not be packed).
That way, if the generator does not support an operation, we can flush the
queue first (to ensure that as many operations as possible were packed
together), and then recurse further.The generation should be triggered when
the scheduler's queue is flushed... which means that
viennacl::ocl::flush(); Here is what I think would be appropriate

-> Have some
namespace viennacl{ namespace ocl{ generator::kernel_generator*
kernel_generator; } }
What should be its scope? We cannot really make it global since we're
header-only and making it static global will create an independent
kernel_generator in each compilation unit ...

-> viennacl::ocl::flush() should be rewritten into something like :
if(kernel_generator)
    viennacl::generator::enqueue(*kernel_generator); //triggers generation,
backend checking, and calls viennacl::ocl::enqueue on all the kernel.
clFlush();

However, this looks not really ideal to me... any other idea?

Best regards,
Philippe


2013/7/31 Karl Rupp <r...@iue.tuwien.ac.at>

> Hi,
>
> On 07/31/2013 03:48 PM, Philippe Tillet wrote:
> > Hi,
> >
> > I've explored a bit of the execute_*.hpp files, but I'm not sure how to
> > integrate the generator here, ie when to create the kernel generation
> > object, when to add statements for generation, where to trigger
> > generation, etc... Any idea?
>
> Have a look at e.g. execute_vector_assign.hpp, line 303: At this point
> it is clear that the scheduler cannot deal with the full statement and
> hence would need to introduce a temporary. Instead of unconditionally
> creating temporaries, one better asks the generator whether it can deal
> with the statement. If so, hand over the execution. If not, introduce
> temporaries and recurse further.
>
> (Note that execute_vector_assign.hpp and execute_matrix.hpp is
> essentially the same code. This will be unified soon, so I suggest to
> only work on execute_vector_assign.hpp for now)
>
> Best regards,
> Karli
>
>
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> _______________________________________________
> ViennaCL-devel mailing list
> ViennaCL-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viennacl-devel
>
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to