setting constant memory

This is probably a bit of a long question, but it’s been a long day…
(edit - you can tell it’s been a long day when I refer to this as a long question. i was intending to say “dense question” lol)

I have some constant memory that I have declared with:

constant x y;

I set the value with:

cudaMemcpyToSymbol(“y”, &z, size, 0, cudaMemcpyHostToDevice);

And this is fine.

However, I’ve changed my code such that the value z that I wish to set now resides in device memory. Copying the data over to the host just so I can set it as constant memory seems a bit long winded, so is there an easier way to set my constant memory device -> device?

I haven’t tried it myself, but cudaMemcpyToSymbol should work in device to device mode. The 2.2 reference manual implies that it should work, because it says you may use cudaMemcpyHostToDevice or cudaMemcpyDeviceToDevice for the kind. You should be able to just use the device pointer to z. Does this not work?