13.07.2015 Views

CUDA Libraries and MPI+OpenMP+CUDA - Prace Training Portal

CUDA Libraries and MPI+OpenMP+CUDA - Prace Training Portal

CUDA Libraries and MPI+OpenMP+CUDA - Prace Training Portal

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CUDA</strong> ADDUSDENS – Code Snippet (C)qecudaSafeCall( cudaMemcpy( ig1_D, ig1, sizeof( int ) * ngm,cudaMemcpyHostToDevice ) );...qecudaSafeCall( cudaMemcpy( eigts1_D, eigts1,sizeof( double ) * (((nr1*2 + 1)*nat)*2), cudaMemcpyHostToDevice ) );...qecudaSafeCall( cudaMemcpy( aux_D, aux,sizeof( double ) * (ngm*nspin_mag*2), cudaMemcpyHostToDevice ) );...dim3 threads2(1, __<strong>CUDA</strong>_TxB_ADDUSDENS_COMPUTE_AUX__);dim3 grid2( nspin_mag / 1 ? nspin_mag / 1 : 1,(ngm+__<strong>CUDA</strong>_TxB_ADDUSDENS_COMPUTE_AUX__-1)/__<strong>CUDA</strong>_TxB_ADDUSDENS_COMPUTE_AUX__?(ngm+__<strong>CUDA</strong>_TxB_ADDUSDENS_COMPUTE_AUX__-1)/__<strong>CUDA</strong>_TxB_ADDUSDENS_COMPUTE_AUX__:1);qecudaSafeCall( cudaFuncSetCacheConfig(kernel_compute_aux,cudaFuncCachePreferShared) );February 10, 2012 PRACE Winter School 201251

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!