Thread: Prime Number Generator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    Prime Number Generator

    OK, the contest is to generate 100 thousand unique Prime numbers from 2^32 to 2^64-1 in the shortest time possible. There are some limits of course.

    1. You cannot load any values from external files.
    2. Your entire program must be contained in a single cpp file of less than 64K named PrimeFunc.cpp with a function named PrimeFunc(__int64*) which will be called by the test program.
    3. You may use no more than 10 'seed' values none of which may be greater than 2^32-1
    4. All code must compile under visual studio 2008 express as a win32 console program. Default optimzation settings will be used.
    5. All results must be placed into the __int64* array supplied by the test program.
    6. You may not use any file or network access functions.
    7. You may use inline assembly, OpenMP, threads, even the GPU as long as you limit GPU code to HLSL.
    8. There can be no composite numbers returned
    9. You must return exactly 100 thousand primes, no more no less.
    10. Programs that crash are disqualified.
    11. Programs that take more than 5 minutes to complete are disqualified.
    12. Entries should be made public.
    13. This contest is open ended so further optimizations should be submitted as a new entry.
    14. (Optional)The solution should be general enough so that it could in theory be applied to build a comprehensive list of all primes.
    15. You may not include any header files other than <math.h>, some exceptions may be made to this ask first.

    The test system is a Pentium 4HT 3.2 GHz with 2GB of 800MHz dual channel memory. The GPU is an 8600 with 1GB of ram. A non-optimized test program was run and completed within the alloted time.
    Last edited by abachler; 11-26-2008 at 03:36 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. prime number program with function
    By mackieinva in forum C Programming
    Replies: 17
    Last Post: 09-20-2007, 08:36 AM
  3. Prime Number stops after 29, but why?
    By Daveo in forum C Programming
    Replies: 22
    Last Post: 09-17-2004, 10:55 AM
  4. Replies: 3
    Last Post: 01-14-2003, 10:34 PM
  5. Random number generator
    By Caze in forum C++ Programming
    Replies: 6
    Last Post: 12-03-2002, 08:10 AM