bobobobo
bobobobo

Reputation: 67234

Should I use C++ AMP if I'm already manually threading my application?

I'm not sure what C++ AMP is good for. If I've already multithreaded my application (in this case, a ray tracer) to use all n cores on a system, should I use C++ AMP, or will this actually create more bottle necks? (when it tries to multithread, all CPU cores are already 100% utilized,)

Upvotes: 1

Views: 418

Answers (2)

DaiTran
DaiTran

Reputation: 11

AMP is good when you want to calculate a huge array of data where each element or thread is independent to each other. For example, if you want to calculate the position of a particle in an array of 100M particles, it will take hours on the CPUs. However, on the GPU, each particle can be one thread, and a GPU can execute thousand of threads at a time. Compared to 8 cores CPU, you can only execute 8 threads at a time.

Upvotes: 1

Szymon Wybranski
Szymon Wybranski

Reputation: 646

C++ AMP allows you to execute your code on the GPUs. Whether or not you would get performance depends on how well your computation would take advantage of the hardware. You would have much more cores on your disposal, but you need to transfer your data over PCIe, so your computation needs to be substantial to pay off the initial cost of data movement. Data parallel problems such as ray tracers are good match.

Check out introductory post on C++ AMP to learn more: http://blogs.msdn.com/b/nativeconcurrency/archive/2012/08/30/learn-c-amp.aspx

or watch introductory presentation on C++ AMP: http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-802T

Upvotes: 6

Related Questions