Skip to content

Instantly share code, notes, and snippets.

View elinx's full-sized avatar
🤖

Elinx elinx

🤖
View GitHub Profile
@yui0
yui0 / dgemm_sse.c
Last active May 24, 2019 08:47
gemm
// clang -Ofast -o dgemm_sse dgemm_sse.c
// http://apfel.mathematik.uni-ulm.de/~lehn/sghpc/gemm/page02/index.html
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <x86intrin.h>
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 201102L
@chenshuo
chenshuo / waiter.h
Last active April 23, 2024 10:02
A handful of implementations of Waiter class for discussion.
#include <boost/noncopyable.hpp>
#include <pthread.h>
#include <stdlib.h>
// a superfluous check for pedantic people
inline void CHECK_SUCCESS(int ret)
{
if (ret != 0)
{
abort();
@evanslai
evanslai / list.h
Last active April 12, 2023 12:07
C: Linux kernel linked list, modified for userspace
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
#include <stdio.h>
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
/**
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
@jeetsukumaran
jeetsukumaran / custom_iterator.cpp
Created February 18, 2010 02:33
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>