Skip to content

Instantly share code, notes, and snippets.

@theidexisted
theidexisted / clang_windows_cross.cmake
Created June 5, 2020 03:55 — forked from HiImJulien/clang_windows_cross.cmake
Toolchain file to cross-compile from clang (WSL-Ubuntu) to Windows.
# Cross toolchain configuration for using clang-cl.
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 10.0)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER "/usr/bin/clang-cl-9")
set(CMAKE_CXX_COMPILER "/usr/bin/clang-cl-9")
set(CMAKE_LINKER "/usr/bin/lld-link-9")
#include <algorithm>
#include <cctype>
#include <fstream>
#include <iostream>
#include <iterator>
#include <set>
#include <string>
using namespace std;

Latency Comparison Numbers

Type time ms comment
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 300 ns 20x L2 cache, 200x L1 cache