Hey Phoenix,
It is true that current GPU have way better floating point throughput than
any general purpose processor. But when you want to run your algo. on the
GPU there are always an overhead of copying data between CPU & GPU, drivers
and other system calls and you can gain performance even
I'm absolutely didn't get your explanation... What is the connection
between O(n^3) algorithms and staff you are talking about?
On Saturday, 7 April 2012 03:22:29 UTC-7, SAMMM wrote:
>
> This is becoz the GPU is multithreaded . In graphics there are three main
> steps , Application based work wh
@Atul007: Oops. Right. insert
if( !(n & 1) ) return 0;
before the first while statement.
Dave
On Saturday, April 7, 2012 1:41:53 PM UTC-5, atul007 wrote:
> e@Dave : just checkedit will fails for input
> small modification will make it work.
> On 7 Apr 2012 21:13, "Dave
e@Dave : just checkedit will fails for input
small modification will make it work.
On 7 Apr 2012 21:13, "Dave" wrote:
> @Atul007: A shorter and logically simpler version of this:
>
> bool IsOnesZerosOnes(unsigned int n)
> {
> while( n & 1 ) n >>= 1;
> if( !n ) return 0;
@Dave: yeahhrite ... +1 :)
On 7 Apr 2012 21:13, "Dave" wrote:
>
> @Atul007: A shorter and logically simpler version of this:
>
> bool IsOnesZerosOnes(unsigned int n)
> {
> while( n & 1 ) n >>= 1;
> if( !n ) return 0;
> while( !(n & 1 ) ) n >>= 1;
> while( n & 1 ) n >>= 1;
>
@SAMM: what about general mathematical computations such as matrix
multiplication which is O(n^3) as such? How do you relate your explanation
to such math computations or any algorithm of atleast O(n^3)?
On Sat, Apr 7, 2012 at 3:22 AM, SAMM wrote:
> This is becoz the GPU is multithreaded . In gr
@Atul007: A shorter and logically simpler version of this:
bool IsOnesZerosOnes(unsigned int n)
{
while( n & 1 ) n >>= 1;
if( !n ) return 0;
while( !(n & 1 ) ) n >>= 1;
while( n & 1 ) n >>= 1;
return !n;
}
The first while loop strips off the trailing ones.
If the result is n
This is becoz the GPU is multithreaded . In graphics there are three main
steps , Application based work where vertex Processing , read the data ,
pixel processing are done .
Secondly come the Culling which which determimes which portion will be
shown given the Line of sight . This also checks for