directly copy device memory to the constant memory how to directly copy

Hi All, I’d like to utilize the constant memory, however I wonder if there is method to copy the GPU device memory to the constant memory directly? I only found the function cudaMemcpyToSymbol, which copy the host memory to constant memory, not from GPU memory to constant memory.

Thanks!

Thanks for the nice Suggestion, it is what i need!

After looking into the Cuda_Ref_Man i found out following :

cudaMemcpyFromSymbol - copies data from GPU to host memory

SYNOPSIS

template < class T >

cudaError_t cudaMemcpyFromSymbol( void *dst, const T& symbol, size_t count, size_t offset,

enum cudaMemcpyKind kind)

DESCRIPTION

Copies count bytes from the memory area pointed to by offset bytes from the start of symbol symbol

to the memory area pointed to by dst. The memory areas may not overlap. symbol can either be a

variable that resides in global or constant memory space, or it can be a character string, naming a vari-

[b]able that resides in global or constant memory space. kind can be either cudaMemcpyDeviceToHost or

cudaMemcpyDeviceToDevice.[/b]

Interestingly, it allows to copy from device to device , although it is said that it only copies from device to host

Hi, I have tried that function, I used cudeMemcpyDeviceToDevice to copy from device memory to the constant memory, however, it doesn’t work, the application told me invalid device pointer. I am really wondering, why I don’t find direct copy method between the device memory and constant memory