mianlu
September 26, 2008, 1:47pm
1
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!
sleon
October 2, 2008, 9:22am
2
Thanks for the nice Suggestion, it is what i need!
sleon
October 2, 2008, 9:46am
3
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!
[snapback]444521[/snapback]
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
mianlu
October 30, 2008, 6:45am
4
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
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