[vsipl++] [patch] pwarp

Jules Bergmann jules at codesourcery.com
Thu Dec 13 18:56:30 UTC 2007


Stefan Seefeld wrote:
> Jules Bergmann wrote:
> 
>> Why can't we just test the spe_program_handle_t* for uniqueness?  Then
>> we can decentralize the selection of the right spe_program_handle_t* to
>> the PPU bridge functions, and task_manager will just have to remember
>> the last task loaded to avoid the extra reload.
> 
> Indeed, the spe_program_handle pointer is unique, too. However:
> 
> 1) if we don't use embedded images, a call to get_image() will actually
> load the kernel first, so we'd need to add some more cachine logic.

get_image() still returns a (presumably) unique pointer to an image right?

A bridge function might look like:


template <typename T>
Choose;

template <>
struct Choose<float>
{
private:
   static spe_program_handle_t* image_;

public:
   static spe_program_handle_t* image()
   {
     if (image_ == NULL)
       image_ get_image(path...)
     return image_;
   }
};

... other specializations for other types ...


template <typename T>
...
vmul(...)
{
   spe_program_handle_t* pgm = Choose<T>::image();

   ... = task_manager.instance(pgm)
}


> 2) With SDK 3.0 (which we are going to adapt sooner or later anyhow), we
> don't have access to that any more, or at least not in that raw form.

You mean ALF 3.0, right?  I'm assuming libspe2 doesn't take away 
functionality.

What does ALF 3.0 force us to do here?

				-- jules


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



More information about the vsipl++ mailing list