Skip to content

Instantly share code, notes, and snippets.

@prehensilecode
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prehensilecode/2885a260a42ed1205579 to your computer and use it in GitHub Desktop.
Save prehensilecode/2885a260a42ed1205579 to your computer and use it in GitHub Desktop.
Trivial MPI-CUDA hybrid
#include <stdio.h>
#include <cuda.h>
#include <cuda_runtime.h>
int main (int argc, char *argv[])
{
void *a_d;
MPI_Init (&argc, &argv);
cudaSetDevice(0);
printf("hello\n");
cudaError_t ierr = cudaMalloc( (void **) &a_d, 1000);
if (ierr = cudaSuccess) cudaFree(a_d);
MPI_Finalize();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment