Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

cuda constant memory initialisation

// Initialised as a global variable
__constant__ float constData[256];
...
float data[256];
// Pass data to constData (in the texture memory of the GPU)
cudaMemcpyToSymbol(constData, data, sizeof(data), 0, cudaMemcpyHostToDevice));
Source by docs.nvidia.com #
 
PREVIOUS NEXT
Tagged: #cuda #constant #memory #initialisation
ADD COMMENT
Topic
Name
8+1 =