Openmp

GPUs and Specialized Hardware Part 1: Architecture, Thrust, and OpenMP

The C++ Programmer’s Mindset by Sam Morley (ISBN 978-1-83588-842-1)

CPUs are general-purpose workhorses. Sometimes you need a different animal. Chapter 14 introduces GPUs and other accelerators. This first post covers the architecture basics and the “easy mode” paths: library abstractions and OpenMP offload. Part 2 gets into raw CUDA and SYCL.

Implementing K-Means Clustering in C++ for Hotspot Detection

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 11 Part 2 is where Morley ships the clustering code. Theory from Part 1 becomes KMeans, compute_score, best_kmeans_cluster, and compute_clusters. Tests catch real bugs, including a longitude flip at the north pole that only shows up on round-trip coordinate conversion.

K-Means Clustering Theory for Geographic C++ Data

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 11 is the computational core of the rubber duckies project. All those file readers were building toward one question: where on Earth are these sightings clustering? Morley implements k-means from scratch. Choosing k and embedding geographic data correctly are the hard parts, not the iteration loop itself.

Building a Command-Line Interface for the Duckies App

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 8 is where the rubber duckies project gets a real executable named duckies. Morley builds a minimal but extensible CLI around Boost program_options, spdlog, and OpenMP. Even if you are the only user, he argues, --help pays for itself the first time you forget what flags exist.

Understanding the Machine (Part 1): Processors, CPUID, and Memory

Book: The C++ Programmer’s Mindset
Author: Sam Morley
ISBN: 978-1-83588-842-1

Chapter 4 answers a question Chapter 3 raised: your algorithm might be correct on paper and still slow because the CPU spent half its time waiting on RAM. Morley gives a compressed tour of modern hardware so C++ programmers know what they are actually driving.