   Directcompute, simple beginer question
  Hi.I'm curious about directcompute. I know it's a shaderprogram made just for optimized number crunching.If I for example make a mathlibrary that's intended to be used with DirectX, can I use directcompute for the regular math operations. Like if I have 2000 3D vectors that I want to add together, will I gain performance if I do the calculations with a shader rather than doing it in a C++ loop?When I google direct compute all I get is articles that tells me how awsome it is when it's used in advanced physic simulations and next generation stuff. But there are no descriptions about when or how it should be used, atleast not for beginners.   
  It depends on how much data you have to crunch, how expensive it is to crunch, and how parallel you can make the crunching.2000 vectors may preform better on the CPU using SSE since there is a cost involved with transferring data to the GPU and then retrieving the result.  Plus there is the cost of writing the code necessary to do this calculation on the GPU vs doing it on the CPU.  You're GPU will certainly be capable of chewing threw 2000 vector instructions at a lightning pace so you'll just have to test it out or decide if it's worth it.Use direct compute if you're math library is going to be used for large data sets doing lots of calculations.  That's why they often call out physics syms, graphics, and other math intensive applications.  If a lot of the data can remain on the GPU then you'll get even better results.   ;  I wrote a few posts about basic compute shader setup and operation a few months ago in my journal.  If you are interested, browse back through the past couple of pages and you'll find them floating about as Direct3D 11 programming tips.  I also have a basic compute shader sample in my open source project, which you can also check out from my signature below.If you have any questions once you get into the code, feel free to post again.   