Coding Challenge 4!

The Partridge Family were neither partridges nor a family. Discuss.
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 27th, 2018, 4:37 pm

Depending on your CPU, it might be. My first results for non-sse and single thread was around 80-90 ms on my CPU.

My system:
AMD Ryzen 5 2400G ( Shit, why didn't I think of using C++AMP, would have creamed everyone )
DDR4 2133 ( OC'd to 2600 <- only because the 3200 XMP profile isn't stable )
250 GB Samsung 970 Evo M.2 SSD.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 27th, 2018, 4:39 pm

Hey Chili! Are you going to run this outside a virtual machine? I don't think C++AMP would do well with an emulated D3D driver lol.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 27th, 2018, 5:56 pm

Well, I was afraid of this, but C++AMP is out. It requires data to be at least sizeof int. I'd have to create a whole new vector of int, cast all the elements ( or unpack using _mm_unpack_epi16 ) then run the AMP code...I'll let ya know how it goes.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

thesmallcreeper
Posts: 14
Joined: September 24th, 2018, 1:20 pm

Re: Coding Challenge 4!

Post by thesmallcreeper » September 27th, 2018, 6:22 pm

Tested my code with 20+ small random generated tests, so I will assume my code is now robust :)
I would post the file's generator code but it implies a O(n) solution to the challenge ://

Also chili, based on your code which is the best option for your Haswell CPU? Using 4 or 8 threads? Have no experience with this shit :p. IIRC hyperthreading help a lot if your code has many "unpredictable" memory reads, however my code has almost no unpredictable memory reads, it reads from the memory in order. Please, show me one of your cards :p :)

AverageWhale
Posts: 57
Joined: August 13th, 2018, 2:33 pm

Re: Coding Challenge 4!

Post by AverageWhale » September 27th, 2018, 6:55 pm

albinopapa wrote:Depending on your CPU, it might be. My first results for non-sse and single thread was around 80-90 ms on my CPU.

My system:
AMD Ryzen 5 2400G ( Shit, why didn't I think of using C++AMP, would have creamed everyone )
DDR4 2133 ( OC'd to 2600 <- only because the 3200 XMP profile isn't stable )
250 GB Samsung 970 Evo M.2 SSD.
is it good? i have i5 4460 3.20GHZ

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 27th, 2018, 6:59 pm

You know, it sure would be nice if the CPU had some sort of built-in thread scheduler like the GPU does. Offload the burden form the main CPU workload and maybe context switching wouldn't be so expensive. I have no clue if that would even be possible though, or even as beneficial as I'm thinking. Hell, that could be what SMT/HyperThreading really is.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 27th, 2018, 7:11 pm

AverageWhale wrote:
albinopapa wrote:Depending on your CPU, it might be. My first results for non-sse and single thread was around 80-90 ms on my CPU.

My system:
AMD Ryzen 5 2400G ( Shit, why didn't I think of using C++AMP, would have creamed everyone )
DDR4 2133 ( OC'd to 2600 <- only because the 3200 XMP profile isn't stable )
250 GB Samsung 970 Evo M.2 SSD.
is it good? i have i5 4460 3.20GHZ
It seems to be about right from what I can tell. Accoriding to http://cpu.userbenchmark.com/Compare/In ... 0vsm433194 my chip is about 15% faster in single threaded apps, so if I get a score of 90ms, yours should be able to do it in 105ms. The other part of that would be RAM speed, I have my memory running at 2600, whereas the DDR3 memory that is probably in your system is either 1333 or 1600 ( just guessing here ). So my memory bandwidth would be quite a bit higher so furthering the distance between our scores.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

AverageWhale
Posts: 57
Joined: August 13th, 2018, 2:33 pm

Re: Coding Challenge 4!

Post by AverageWhale » September 27th, 2018, 7:35 pm

albinopapa wrote:
AverageWhale wrote:
albinopapa wrote:Depending on your CPU, it might be. My first results for non-sse and single thread was around 80-90 ms on my CPU.

My system:
AMD Ryzen 5 2400G ( Shit, why didn't I think of using C++AMP, would have creamed everyone )
DDR4 2133 ( OC'd to 2600 <- only because the 3200 XMP profile isn't stable )
250 GB Samsung 970 Evo M.2 SSD.
is it good? i have i5 4460 3.20GHZ
It seems to be about right from what I can tell. Accoriding to http://cpu.userbenchmark.com/Compare/In ... 0vsm433194 my chip is about 15% faster in single threaded apps, so if I get a score of 90ms, yours should be able to do it in 105ms. The other part of that would be RAM speed, I have my memory running at 2600, whereas the DDR3 memory that is probably in your system is either 1333 or 1600 ( just guessing here ). So my memory bandwidth would be quite a bit higher so furthering the distance between our scores.
yes. i dont remember my ram mhz but its not above 2000. it may affect the performance. is it good to use 2 rams with different mhzs? because i have like that :D

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Coding Challenge 4!

Post by albinopapa » September 28th, 2018, 4:48 am

Your computer will run at the lower of the two, so it "shouldn't" hurt things, the only plus is the extra memory.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Coding Challenge 4!

Post by chili » September 28th, 2018, 1:22 pm

Only stdlib + intrinsics. No AMP allowed D:<
Chili

Post Reply