I have a question regarding passing a single value to a kernel.
For example, assume I pass in an array and I want to add a value to every single index in that array but that value varies for each array (but is the same across the array) and I want to pass it in as an argument.
I’m pretty sure I know how to do the passing portion and setting it up as an argument, but my main question is how do you allocate the value.
float tmp; cudaMallocHost(???, sizeof(float));
It is something like this but I’m not exactly sure. I’m assuming this is due to the fact that cudaMallocHost is looking for a void pointer. Therefore, if I want to pass a single value, should I just set it up as a pointer with the size of only 1 float?