Skip to content

Instantly share code, notes, and snippets.


Mark Harris harrism

View GitHub Profile
harrism /
Last active Aug 5, 2020
Useful C++ experiments: a place to stash little C++ experiment results

Useful C++ experiments

A place to stash experiments I do with godbolt / quickbench / etc.

Which is faster for small data, std::map or std::unordered map?

std::map seems faster below 128 items (when the map is int:int).

harrism /
Last active Dec 1, 2021
Using Thrust for the Taylor series approximation of 1 / (1-x). Demonstrates evaluating recurrences in parallel with a scan using Thrust running on CUDA.
#include <thrust/scan.h>
#include <thrust/device_vector.h>
#include <thrust/fill.h>
#include <vector>
#include <algorithm>
#include <cstdlib>
int main(int argc, char **argv)
using T = double;