The CPU vs the GPU contest.

Discussion in 'C Programming' started by Skybuck Flying, Jan 11, 2007.

  1. 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.
     
    Skybuck Flying, Jan 11, 2007
    #1
    1. Advertising

  2. "Skybuck Flying" <> wrote in message
    news:eo68bf$g13$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 ()
    http://www.e3ft.com (Consulting Home Page)
    http://www.dtashley.com (Personal Home Page)
    http://gpl.e3ft.com (GPL Publications and Projects)
     
    David T. Ashley, Jan 12, 2007
    #2
    1. Advertising

  3. Skybuck Flying

    Evenbit Guest

    Evenbit, Jan 12, 2007
    #3
  4. PÃ¥ Fri, 12 Jan 2007 07:29:05 +0100, skrev Evenbit <>:

    > Skybuck is a flying loony. See:
    >
    > http://groups.google.com/group/alt....0f0056acbbc/586e8caff4d1a9cb#586e8caff4d1a9cb
    >
    > http://groups.google.com/group/alt....4a3f6c3dc0d/5ad694f9f550dbdd#5ad694f9f550dbdd
    >
    > 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)
     
    //\\\\o//\\\\annabee, Jan 12, 2007
    #4
  5. [all crossposting removed]

    David T. Ashley said:

    > "Skybuck Flying" <> wrote in message
    > news:eo68bf$g13$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.
     
    Richard Heathfield, Jan 12, 2007
    #5
  6. Skybuck Flying

    Evenbit Guest

    //\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.
     
    Evenbit, Jan 12, 2007
    #6
  7. På Fri, 12 Jan 2007 18:02:26 +0100, skrev Evenbit <>:

    >
    > //\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.
     
    //\\\\o//\\\\annabee, Jan 12, 2007
    #7
  8. Don't let the real loonies distract you too much...

    Bye,
    Skybuck.
     
    Skybuck Flying, Jan 12, 2007
    #8
  9. "Richard Heathfield" <> wrote in message
    news:...
    > [all crossposting removed]
    >
    > David T. Ashley said:
    >
    >> "Skybuck Flying" <> wrote in message
    >> news:eo68bf$g13$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.
     
    Skybuck Flying, Jan 12, 2007
    #9
  10. "Evenbit" <> wrote in message
    news:...
    >
    > David T. Ashley wrote:
    >> "Skybuck Flying" <> 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.
     
    Skybuck Flying, Jan 12, 2007
    #10
  11. Skybuck Flying

    Richard Bos Guest

    "//\\\\o//\\\\annabee <Free\" " <> wrote:

    > PÃ¥ Fri, 12 Jan 2007 07:29:05 +0100, skrev Evenbit <>:
    >
    > > Skybuck is a flying loony. See:


    > Better SkyBuck then HLA.


    Can we please ignore _all_ trolls? Especially crossposting ones? Thank
    you.

    Richard
     
    Richard Bos, Jan 15, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohamed Salem

    IEDCS'04 Design Contest

    Mohamed Salem, Aug 12, 2004, in forum: VHDL
    Replies:
    0
    Views:
    379
    Mohamed Salem
    Aug 12, 2004
  2. Mohamed Salem

    IEDCS'04 Design Contest

    Mohamed Salem, Aug 12, 2004, in forum: VHDL
    Replies:
    0
    Views:
    427
    Mohamed Salem
    Aug 12, 2004
  3. Replies:
    0
    Views:
    696
  4. pavunkumar

    How , system cpu and user cpu times calculates

    pavunkumar, Feb 27, 2009, in forum: C Programming
    Replies:
    1
    Views:
    377
  5. Replies:
    2
    Views:
    127
Loading...

Share This Page