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 <mkl_blas.h> | |
#include <mkl_lapack.h> | |
/** | |
* Build like | |
* | |
* gcc myblas.c -o myblas.so -shared -fPIC -m64 -I${MKLROOT}/include -shared -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl | |
*/ | |
void my_dgemm(char* transa, char* transb, int* m, int* n, int* k, double* alpha, |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <algorithm> | |
#include <cassert> | |
#include "mpi.h" | |
/** | |
* Compile with something like |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <mpi.h> | |
int main(int argc, char* argv[]) | |
{ | |
MPI_Init(&argc, &argv); | |
int size; | |
MPI_Comm_size(MPI_COMM_WORLD, &size); |
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<tuple> | |
#include<iostream> | |
#include<string> | |
// Returns the Tin of the first element | |
template<typename... Trs> | |
struct Tin_list | |
{ | |
using type = typename std::tuple_element<0, std::tuple<Trs...>>::type::Tin_type; | |
}; |
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<tuple> | |
#include<iostream> | |
#include<string> | |
template<typename Tin, typename Tout> | |
struct transformer { | |
Tout transform(Tin tin) { | |
std::cout << "Hi!\n"; | |
return tin + 1; | |
} |
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 <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/time.h> | |
#include <algorithm> | |
#include <cassert> | |
#include "mpi.h" | |
/** | |
* Compile with something like |