Re: [eigen] New(?) way to make using SIMD easier |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] New(?) way to make using SIMD easier
- From: Rohit Garg <rpg.314@xxxxxxxxx>
- Date: Tue, 24 Nov 2009 20:52:31 +0530
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=8lOPpPKgfDKZvcmPPhh4QAN02LJo335gN6UySmaBmIc=; b=w6iSoVlCDYv0ZFepkjNyJGvkNHEZi8u91oklRd/t6G/ac+5OXZ9FSxweOrUopws3IH 8Sxr/NWIRhuyXTLcUcC8uWTwdWcsMcJjYezmwBdxPgswgPgvZ9tHj3KPFfMs/EtnVNn1 X/Lz4CtnrIz28hvN0yCjyl7YIQnq8x2JGVfAk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=J83MfycWM63cN3AuYbhPECuRPlXcoZzk27jjQ1lCI4CKhM6Fv0U49AHwmdIy/D651P knXeu0igI+j3PuBvDQIFTBYhYN4kfVeiD1+zfCkI39jhmiU2nNzklRs48Td6QPes/Dpu BZlRLLSqPa6usl7o9Y932MbMqnYnEQfdqvQn8=
On Tue, Nov 24, 2009 at 8:06 PM, Mark Borgerding <mark@xxxxxxxxxxxxxx> wrote:
> Just an idea:
> What if the user could write code like:
>
> VectorOperator( std::plus<SomeDataType>() , dstPtr , srcPtr1, srcPtr2 ,
> num );
>
> which would use a SIMD-optimized call if one exists, and use a generic
> algorithm otherwise.
Right now, you map the source pointers as vectors and execute the
standard eigen operations. Everything then is vectorized for you.
>
> Examples:
> 1. a functor std::plus<float> and float pointers: there could be a
> specialization that uses _mm_add_ps (on x86) to add 4 floats at a time
> 2. a functor std::multiplies<double> and double pointers: the
> specialization would be to use _mm_mul_pd to add 2 doubles at a time
>
> It might even be used to detect special conditions. e.g. If CUDA processing
> is enabled and the source pointers are device memory It performs all
> calculations on the device. Then brings the result back to the host only if
> the destination resides in host memory.
>
> Does this offer any advantages in development speed/clarity or in
> flexibility over Eigen's current method of using SIMD? I admit I am fairly
> ignorant of the current state of Eigen SIMD.
>
>
>
>
>
--
Rohit Garg
http://rpg-314.blogspot.com/
Senior Undergraduate
Department of Physics
Indian Institute of Technology
Bombay