How can I write the memory pointer in CUDA [duplicate]
问题 This question already has an answer here : Summing the rows of a matrix (stored in either row-major or column-major order) in CUDA (1 answer) Closed 2 years ago . I declared two GPU memory pointers, and allocated the GPU memory, transfer data and launch the kernel in the main: // declare GPU memory pointers char * gpuIn; char * gpuOut; // allocate GPU memory cudaMalloc(&gpuIn, ARRAY_BYTES); cudaMalloc(&gpuOut, ARRAY_BYTES); // transfer the array to the GPU cudaMemcpy(gpuIn, currIn, ARRAY