Skip to content

Instantly share code, notes, and snippets.

View thiagokokada's full-sized avatar

Thiago Kenji Okada thiagokokada

View GitHub Profile
@thiagokokada
thiagokokada / Makefile
Created June 26, 2015 16:15
Matrix Multiplication using (Open)MPI
CC = mpicc
CFLAGS = -std=gnu99 -O3 -Wall
# OMPI_MPICC = clang
all: matrix_mul
matrix_mul: matrix_mul.c matrix_mul.h
ifdef OMPI_MPICC
env OMPI_MPICC=$(OMPI_MPICC) $(CC) $(CFLAGS) -o matrix_mul matrix_mul.c
else
@thiagokokada
thiagokokada / example_intro.cu
Created May 5, 2015 02:03
Matrix sum in CUDA
#include <assert.h>
#include <cuda.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
/* Example from "Introduction to CUDA C" from NVIDIA website:
https://developer.nvidia.com/cuda-education
Compile with:
@thiagokokada
thiagokokada / Makefile
Created May 1, 2015 01:30
Matrix multiplication in (Open)MPI
CC = mpicc
CFLAGS = -std=gnu99 -O3 -Wall
# OMPI_MPICC = clang
all: matrix_mul
matrix_mul: matrix_mul.c matrix_mul.h
ifdef OMPI_MPICC
env OMPI_MPICC=$(OMPI_MPICC) $(CC) $(CFLAGS) -o matrix_mul matrix_mul.c
else
@thiagokokada
thiagokokada / Makefile
Last active August 29, 2015 14:20
Testing 2D matrix serialization in C using tpl
CC = clang
CFLAGS = -std=gnu99 -O3 -Wall
all: matrix_gen
matrix_gen: matrix_gen.o tpl.o
$(CC) $(CFLAGS) matrix_gen.o tpl.o -o matrix_gen
matrix_gen.o: matrix_gen.c
$(CC) $(CFLAGS) -c matrix_gen.c
@thiagokokada
thiagokokada / .gitignore
Last active August 29, 2015 14:19
Testing if-guards in OpenMP
max_vector
max_vector.c