Quantcast
Channel: Parallel Computing in C++ and Native Code forum
Viewing all articles
Browse latest Browse all 856

C++ AMP - Pass by const value

$
0
0

Recently I've looked at some open source OpenCL and CUDA renderer implementations; I often see most functions (in some cases all of the functions) use pass by const value.

I suppose at least in C++ it is not going to make any differences (Herb Sutter in Exceptional C++, pg.177 says, "const pass-by-value is unuseful and misleading at best.")

So, I was wondering if there is any performance gains in C++ AMP from passing by const value? Does it help the compiler to better optimize the code or it's just bad practice?


Thanks.


Viewing all articles
Browse latest Browse all 856


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>