HPC Magazine mars 2013 - L'Atelier CUDA - Listing 1.

Cas classique d'allocation de mémoire globale.


# __device__ int globalArray [256];
void foo () {
  // ...
  int  * myDeviceMemory =  0 ;
  cudaError_t result = cudaMalloc (& myDeviceMemory ,  256  *  sizeof(int));
  // ...
}