Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > The CPU vs the GPU contest.

Reply
Thread Tools

The CPU vs the GPU contest.

 
 
Skybuck Flying
Guest
Posts: n/a
 
      01-11-2007
Hello,

In this contest the CPU will face the GPU.

Which processor will execute the code/concept faster ?

// cpu/serial concept code is:

var
mTable : array of array of integer;
mRowCount : integer;
mColumnCount : integer;

procedure AllocateTable;
begin
mRowCount := 8000;
mColumnCount := 9000;
SetLength( mTable, mRowCount, mColumnCount );
end;

procedure WorkToDo;
var
vRowIndex1 : integer;
vRowIndex2 : integer;
vColumnIndex : integer;
vValue1 : integer;
vValue2 : integer;
begin
vRowIndex1 := 5;
vRowIndex2 := 8;
vValue1 := 5;
vValue2 := 10;
// calculations could be done in parallel on GPU.
for vColumnIndex := 0 to mColumnCount-1 do
begin
mTable[ vRowIndex1, vColumnIndex ] := (mTable[ vRowIndex1,
vColumnIndex ] * vValue1) - (mTable[ vRowIndex2, vColumnIndex ] * vValue2);
end;
end;

For cpu:
MMX/XMM/SIMD/SSE/SSE2 version could be made.

For gpu:
OpenGL or DirectX version could be made.

This is a contest between the CPU and GPU thus helping each other is
allowed.

My test system will be:

X2 3800+ and two GTX 7900 512 MB cards.

^^^ Code may be heavily optimized for this system or similiar ^^^.

Alternative test system could be:

Pentium III 450 mhz and FX5200 with 128 MB ram.

^^^ can be ignored.

Code can be in ASM, C/C++ or Delphi.

Bye,
Skybuck.


 
Reply With Quote
 
 
 
 
David T. Ashley
Guest
Posts: n/a
 
      01-12-2007
"Skybuck Flying" <(E-Mail Removed)> wrote in message
news:eo68bf$g13$(E-Mail Removed)1.ov.home.nl...
>
> // cpu/serial concept code is:
>
> var
> mTable : array of array of integer;
> mRowCount : integer;
> mColumnCount : integer;
>
> procedure AllocateTable;
> begin
> mRowCount := 8000;
> mColumnCount := 9000;
> SetLength( mTable, mRowCount, mColumnCount );
> end;
>
> procedure WorkToDo;
> var
> vRowIndex1 : integer;
> vRowIndex2 : integer;
> vColumnIndex : integer;
> vValue1 : integer;
> vValue2 : integer;
> begin
> vRowIndex1 := 5;
> vRowIndex2 := 8;
> vValue1 := 5;
> vValue2 := 10;
> // calculations could be done in parallel on GPU.
> for vColumnIndex := 0 to mColumnCount-1 do
> begin
> mTable[ vRowIndex1, vColumnIndex ] := (mTable[ vRowIndex1,
> vColumnIndex ] * vValue1) - (mTable[ vRowIndex2, vColumnIndex ] *
> vValue2);
> end;
> end;


#1)Thanks for posting Pascal (or something similar) to a C-language group.

#2)Are you Archimedes Plutonium?

------------------------------------------------------------
David T. Ashley ((E-Mail Removed))
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)


 
Reply With Quote
 
 
 
 
Evenbit
Guest
Posts: n/a
 
      01-12-2007

David T. Ashley wrote:
> "Skybuck Flying" <(E-Mail Removed)> wrote in message
>
> #1)Thanks for posting Pascal (or something similar) to a C-language group.
>
> #2)Are you Archimedes Plutonium?


Skybuck is a flying loony. See:

http://groups.google.com/group/alt.l...6e8caff4d1a9cb

http://groups.google.com/group/alt.l...d694f9f550dbdd

Don't give him any attention.

 
Reply With Quote
 
//\\\\o//\\\\annabee
Guest
Posts: n/a
 
      01-12-2007
På Fri, 12 Jan 2007 07:29:05 +0100, skrev Evenbit <(E-Mail Removed)>:

> Skybuck is a flying loony. See:
>
> http://groups.google.com/group/alt.l...6e8caff4d1a9cb
>
> http://groups.google.com/group/alt.l...d694f9f550dbdd
>
> Don't give him any attention.


Better SkyBuck then HLA. The guy is funny, dont be so hard on him.
What he is doing I belive is sarcasm. His whole name is just a taunt.
He is maybe overdoing it, but he is actually more entertaining then the
guys that does what he does, for real.

And "SkyBuck" is really a very funny name. Also sarcasm, I belive.

--
Funn 1–10 av omlag 89 700 000 som inneheldt "Disaster"

Funn 1–10 av omlag 2 470 000 000 som inneheldt M$. (0,12 sekund)
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      01-12-2007
[all crossposting removed]

David T. Ashley said:

> "Skybuck Flying" <(E-Mail Removed)> wrote in message
> news:eo68bf$g13$(E-Mail Removed)1.ov.home.nl...
>>

<Pascalesque junk>
>
> #1)Thanks for posting Pascal (or something similar) to a C-language group.
>
> #2)Are you Archimedes Plutonium?


Mr Flying has posted quite a few articles to comp.lang.c in the past - 263,
according to Google. It is not known whether any of them demonstrate C
knowledge, but this is generally considered unlikely.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
Evenbit
Guest
Posts: n/a
 
      01-12-2007

//\o//\annabee <Free wrote:
> > Don't give him any attention.

>
> Better SkyBuck then HLA. The guy is funny, dont be so hard on him.


Well, what I find funny is that after all these years of Randy
preaching to you RosAsmites about your sinful "copy-n-paste"
programming style, there comes a post in the HLA forum from a dude
asking how to locate and delete all the unused variables in his
mountain of "copy-n-paste" code. We promise to sand-paper the HLA
tatoo from his butt before we toss him in your camp for a proper
branding.

Nathan.

 
Reply With Quote
 
//\\\\o//\\\\annabee
Guest
Posts: n/a
 
      01-12-2007
P Fri, 12 Jan 2007 18:02:26 +0100, skrev Evenbit <(E-Mail Removed)>:

>
> //\o//\annabee <Free wrote:
>> > Don't give him any attention.

>>
>> Better SkyBuck then HLA. The guy is funny, dont be so hard on him.

>
> Well, what I find funny is that after all these years of Randy
> preaching to you RosAsmites about your sinful "copy-n-paste"
> programming style,


Randall Hyde is an idiot. And he is a weak idiot.
Even if I find it hard to think it could be worth the bodder to tell you
what this is all about, I try one more time in the rare hope it could be
understood.

Many times, the best way to reuse some code, is to call for it.
Put it under some routinelabel, and call it. But this is not allways true.
Sometimes, copying and pasting it, and rewrite in the new purpose, under a
new routine lable, makes for just a minute or two of programmer work.
While in that case, rewriting the ONE routine, to cover both cases, will
lead to a much more bloated routine, because now it has to take care of
two _similar_ but still _diffrent_ tasks. And this will be more work. This
will also make both the routine and the code that calls to it harder to
read, and it will also make BOTH the first and the second instance of the
routine call slower.

Second, doing theese things are RARE. _Very_ rare.

Third. Copying code that has errors makes for multiplications of this
error. This is the source of his claim. But copying good code makes for
two good code snipplets that runs faster, are more easy to read. And dont
forget, they _ARE_ diffrent.

Randall Hyde is a machine of generalizations, and also a machine at FUD
producing. He is a derranged idiot. And if you belive him over Betov, so
are you.

> there comes a post in the HLA forum from a dude
> asking how to locate and delete all the unused variables in his
> mountain of "copy-n-paste" code. We promise to sand-paper the HLA
> tatoo from his butt before we toss him in your camp for a proper
> branding.


I spent someday a few hours of removing all the dead code and variables
from my source. A one time small job, at the end of the developing cycle.
Everything is much easier in a monosource.


> Nathan.




--
alt,alng,asm <cr>
- Did you mean alt,lang,asm ?

Yes!!#"*#"*%"#"! google groups, you're a genious.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      01-12-2007
Don't let the real loonies distract you too much...

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      01-12-2007
"Richard Heathfield" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> [all crossposting removed]
>
> David T. Ashley said:
>
>> "Skybuck Flying" <(E-Mail Removed)> wrote in message
>> news:eo68bf$g13$(E-Mail Removed)1.ov.home.nl...
>>>

> <Pascalesque junk>
>>
>> #1)Thanks for posting Pascal (or something similar) to a C-language
>> group.


You're welcome.

Pascal and C are very similiar.

Let me know if you have any problems converting it to the C language.

>> #2)Are you Archimedes Plutonium?


?

I haven't seen any Pascal/Delphi GPGPU programming code yet.

Maybe you C experts know or can find me some nice C code which does actually
what I want.

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      01-12-2007

"Evenbit" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
>
> David T. Ashley wrote:
>> "Skybuck Flying" <(E-Mail Removed)> wrote in message
>>
>> #1)Thanks for posting Pascal (or something similar) to a C-language
>> group.


You're welcome.

Pascal and C are very similiar.

Let me know if you have any problems converting it to the C language.

>> #2)Are you Archimedes Plutonium?


?

I haven't seen any Pascal/Delphi GPGPU programming code yet.

Maybe you C experts know or can find me some nice C code which does actually
what I want.

Bye,
Skybuck.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GPU vs CPU Lawrence D'Oliveiro NZ Computing 14 12-08-2009 04:04 AM
Thermaltake W2 GPU waterblock Silverstrand Front Page News 0 08-12-2006 11:53 PM
Corsair Cool GPU and VGA Water Blocks @ ThinkComputers.org Silverstrand Front Page News 0 05-17-2006 12:30 PM
GPU fan + temp problem Mikester71 Computer Support 2 01-11-2006 07:10 AM
HEXUS.beans :: Next generation NVIDIA GPU details and 3DMarks Silverstrand Front Page News 0 01-10-2006 12:35 AM



Advertisments