Skip to content

Instantly share code, notes, and snippets.

View zoep's full-sized avatar
🐔
Hacking

Zoe Paraskevopoulou zoep

🐔
Hacking
View GitHub Profile
@zoep
zoep / gist:6167e14ed0ebe0887a03
Last active August 29, 2015 14:17
Program Fixpoint and simpl/unfold
Require Import Arith List ListSet Omega Program.
Definition fvar : Type := nat.
Definition bvar : Type := nat.
Inductive sort : Type :=
| N : sort
| ArrowS : sort -> sort -> sort.
Definition eq_sort_dec (s1 s2 : sort) : {s1 = s2} + {s1 <> s2}.
@zoep
zoep / lu_tiled_taskgrp_i.cpp
Created January 22, 2013 13:29
tiled version with task groups
/**** Tiled LU decomposition *****/
void lu(double **a, int range, int B)
{
int i,j,k;
double ** l_inv, ** u_inv;
tbb::task_group g,f;
for (k=0;k<range-1;k++) {
/****Compute LU decomposition on upper left tile*****/
@zoep
zoep / lu_tiled_taskgrp_j.cpp
Created January 22, 2013 13:25
tiled version with task groups
/**** Tiled LU decomposition *****/
void lu(double **a, int range, int B)
{
int i,j,k;
double ** l_inv, ** u_inv;
tbb::task_group g,f;
for (k=0;k<range-1;k++) {
@zoep
zoep / lu_tiled_par.cpp
Created January 22, 2013 13:18
lu_tiled version with nested parallel for
/**** Tiled LU decomposition *****/
void lu(double **a, int range, int B)
{
int k;
double ** l_inv, ** u_inv;
for (k=0;k<range-1;k++) {
/****Compute LU decomposition on upper left tile*****/
lu_kernel(a,k*B,k*B,B,B);
@zoep
zoep / run.sh
Created January 22, 2013 12:45
Runs sequential and parallel versions. Finds speedup
#!/bin/bash
function speedup() {
serial=$1
parallel=$2
echo "${parallel} ${serial}" | awk '{printf "%.6f\n", $2/$1}'
}
path=.
@zoep
zoep / lu_rec_grp_tasks.cpp
Last active December 11, 2015 11:28
Parallel version of lu_rec with task groups
/*parallhlopoihsh sthn lower solve*/
void lower_solve(double ** a, int x1, int y1, double ** l, int x2, int y2, int N)
{
int hn;
tbb::task_group g;
/* Check base case. */
if (N <= BLOCK) {