Skip to content

Instantly share code, notes, and snippets.

View sandervalcke's full-sized avatar

Sander Valcke sandervalcke

View GitHub Profile
@nadavrot
nadavrot / Matrix.md
Last active June 21, 2024 02:33
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

anonymous
anonymous / gist:a67ba4695c223a905ff108ed8b9a342f
Created July 8, 2017 10:22
Abusing co_await for optionals in C++
// Changed awaiter to not leak memory on suspension thanks to /u/Enemii.
#include <experimental/coroutine>
#include <iostream>
#include <memory>
#include <optional>
#include <utility>
template<typename T>
class shared_optional {