![]() |
| | #16 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| If you have need of a specific header file state what you need, don't ask me to open it up for no reason. The only exception that comes to mind are the headers for OpenMP or for DirectX(HLSL). I see no reason that any other headers shodul be needed, but liek I said, if you need a specific header file, ask first.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet Last edited by abachler; 11-27-2008 at 07:41 AM. |
| abachler is offline | |
| | #17 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| Why you would use HLSL for this is beyond me.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #18 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| gpgpu.org thats why.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
| | #19 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| That will only work on DX10+ or possibly even DX11 when compute shaders are introduced. As of right now there would not be a way to transfer the 100 thousand prime numbers back to the software. That would require a ton of floating point textures and a ton of surface locks to read the values. NVidia Cuda is only available in 9+ series cards and is going to be used with their acquired PhysX chips on the video card.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #20 |
| Internet Superhero Join Date: Sep 2006 Location: Denmark
Posts: 449
| Wrong, all 8XXX Geforce cards support both PhysX and CUDA, including Abachlers 8600GT. PhysX requires 256MB of dedicated VRAM though so integrated cards won't do PhysX, only CUDA...
__________________ How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics. |
| Neo1 is offline | |
| | #21 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| There is also RapidMind, which I also have installed along with CUDA.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
| | #22 |
| Super Moderator Join Date: Aug 2001
Posts: 7,472
| I'd be interested to see how you are going to get 100 thousand primes off of the video card and back into software. Shaders are not meant to communicate back down to the software level - at least not until DX11 and even then I'm a bit fuzzy on the compute shaders functionality. You could render the primes to a floating point texture but that would be completely inefficient. In the current architecture this does not sound like a good idea. I'm not saying it's not possible but it goes against the design of the shader paradigm...for now. I would think using SSE2/3/4? would be a better choice than HLSL.
__________________ If you aim at everything you will hit something but you won't know what it is. |
| Bubba is offline | |
| | #23 | |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
| Quote:
abachler, are you running a 32 or 64 bit OS ? Some Pentium 4 support the x86-64 ISA, some don't. Oh and I tought CUDA wasn't supported by Visual Studio 2008 express edition. Well. Oh, and what are we winning ?
__________________ I hate real numbers. | |
| foxman is offline | |
| | #24 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| Its a matter of the number of shaders available, operating in parallel, which amortize the innefficiency of the actual operation to produce superior absolute throughput. SSE3 is available, but VS2008 only supports SSE2. Well, CUDA is installed, but it is limited to the low level API, I havent fulyl explored what those limits are, so I will have to get back to you on that. I believe the full API requires 2005 or 2003, neither of which I have. The versions I run are 4.0 for 80 bit long double access, 6.0 , and 2008 because its free. I have CUDA 2.0 Final installed, and RapidMind 3.1 ( ineed to check for a new versin fo that).
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet Last edited by abachler; 11-28-2008 at 10:10 PM. |
| abachler is offline | |
| | #25 |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
| Here's my entry. It follows the contest rules. I'm targeting the best user-time possible. Oh man, what a waste of time.
__________________ I hate real numbers. |
| foxman is offline | |
| | #26 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| Violates rules 1 and 6 (no external files, no file access functions). It also takes longer than the original code it was based on. Probably due to setting up the file mapping.
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet |
| abachler is offline | |
| | #27 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 10,365
| Ah well, I decided to give it a try with an obvious brute force implementation. Note that as this is in C++, I have included <cmath> instead of <math.h>. Interestingly, switching from std::sqrt() to the method that abachler advocated in this Prime numbers thread made no difference (it was only very marginally worse, and that could have just been due to timing inaccuracy). Therefore, it would have been better (according to my timings) to just not include any headers at all and use that method, but I decided to go with my original method anyway. EDIT: hmm... I think that 3 is not actually a seed value in my case since I am testing it for primality, hence I am uploading a modified version that has just one seed value, namely, 2.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way Last edited by laserlight; 11-29-2008 at 03:57 PM. |
| laserlight is online now | |
| | #28 |
| Rampaging 35 Stone Welsh Join Date: Apr 2007
Posts: 2,927
| well, the actual contest is to generate primes greater than 2^32. I changed one line of your code (the typedef) so it woudl compile. Other than failign the magnitude test it looks like it woudl work. Code: // typedef unsigned __int64 PrimeType; #define PrimeType unsigned __int64
__________________ He is free, you say. Ah! That is his misfortune… These men… [have] the most terrible, the most imperious of masters, that is, need. … They must therefore find someone to hire them, or die of hunger. Is that to be free? - Simon Linguet Last edited by abachler; 11-29-2008 at 04:35 PM. |
| abachler is offline | |
| | #29 | |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 10,365
| Quote:
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way | |
| laserlight is online now | |
| | #30 |
| Chinese pâté Join Date: Jul 2007 Location: Canada
Posts: 406
|
__________________ I hate real numbers. |
| foxman is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| xor linked list | adramalech | C Programming | 23 | 10-14-2008 10:13 AM |
| prime number program with function | mackieinva | C Programming | 17 | 09-20-2007 08:36 AM |
| Prime Number stops after 29, but why? | Daveo | C Programming | 22 | 09-17-2004 10:55 AM |
| Somewhat new to c++, adding Prime number and Sqrt featre to program... | thynksheraze | C++ Programming | 3 | 01-14-2003 10:34 PM |
| Random number generator | Caze | C++ Programming | 6 | 12-03-2002 08:10 AM |