C# and cudaMemcpyToSymbol

Hello,

I’m trying to implement my own CUDA.NET implementation in order to simplify my work with C# and CUDA at all.
I therefore created my own memory class that manages allocating and disposing the memory via the garbage collector
and I don’t have to handle the data management anymore.

In my implementations I have a few problems using constants. I have an array at the host and want to copy the data from the
host array data to the device constant data. Since there is no constant keyword I have no “symbol”. Can you show me the interface
of how to implement the cudaMemcpyToSymbol and how to access the constant in a CUDA kernel then?

Thank you for your help
Martin

From the CUDA reference manual:

The version that takes the symbol must be compiled with nvcc. The version that takes the character string can be called from anywhere, I think. I haven’t actually tried it.

Hello MisterAnderson42,

thank you very much for your inspiration. You have brought me on the right track.

Thanks

Martin