Skip to content

Instantly share code, notes, and snippets.

@kieber-emmons
kieber-emmons / ParallelRadixSort.metal
Last active February 6, 2024 10:24
This gist is for an article I wrote on Medium (https://medium.com/p/4f4590cfd5d3).
//
// ParallelRadixSort.metal
//
// Created by Matthew Kieber-Emmons on 08/29/22.
// Copyright © 2022 Matthew Kieber-Emmons. All rights reserved.
// This work is for educational purposes only and cannot be used without consent.
//
#include <metal_stdlib>
using namespace metal;
@kieber-emmons
kieber-emmons / ParallelScan.metal
Last active September 16, 2022 01:42
This gist accompanies a Medium story I wrote about optimizing Parallel Prefix Sum in Metal and comparison to optimized CPU code on Apple M1 (https://kieber-emmons.medium.com/efficient-parallel-prefix-sum-in-metal-for-apple-m1-9e60b974d62).
//
// ParallelScan.metal
//
// Copyright © 2021 Matthew Kieber-Emmons. All rights reserved.
// For educational purposes only.
//
#include <metal_stdlib>
using namespace metal;
//
// ParallelReduce.metal
//
// Created by Matthew Kieber-Emmons on 03/11/2021.
// Copyright © 2021 Matthew Kieber-Emmons. All rights reserved.
// This work is for educational purposes only and cannot be used without consent.
//
#include <metal_stdlib>
using namespace metal;