This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* File: vec_add.cu | |
* Purpose: Implement vector addition on a gpu using cuda | |
* | |
* Compile: nvcc [-g] [-G] -o vec_add vec_add.cu | |
* Run: ./vec_add | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the REAL "hello world" for CUDA! | |
// It takes the string "Hello ", prints it, then passes it to CUDA with an array | |
// of offsets. Then the offsets are added in parallel to produce the string "World!" | |
// By Ingemar Ragnemalm 2010 | |
#include <stdio.h> | |
const int N = 7; | |
const int blocksize = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mpi.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main (int argc, char **argv) { | |
int rank, size, partner; | |
int namelen; | |
char name[MPI_MAX_PROCESSOR_NAME]; |