Skip to content

Instantly share code, notes, and snippets.

View maxlevesque's full-sized avatar

Maximilien Levesque maxlevesque

View GitHub Profile
/* 2D */
KOKKOS_INLINE_FUNCTION
void index2coord(int index, int &i, int &j, int Nx, int Ny)
{
UNUSED(Nx);
UNUSED(Ny);
#ifdef KOKKOS_ENABLE_CUDA
j = index / Nx;
@nadavrot
nadavrot / Matrix.md
Last active November 19, 2024 09:12
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

@mlund
mlund / agr2pdf.sh
Created January 12, 2013 09:53
Simplistic shell script to convert xmgrace (.agr files) figures to PDF. White borders will be removed in the conversion process using `pdfcrop`
#!/bin/bash
tmpfile=".tmp.pdf"
if [ $# -ge 1 ]; then
if [ $1 != "-h" ]; then
outfile=`dirname $1`/`basename "$1" \.agr`.pdf
LANG=en xmgrace -hardcopy -hdevice PDF $1 -printfile $tmpfile
pdfcrop $tmpfile $outfile
rm -f $tmpfile
exit
fi