Skip to content

Instantly share code, notes, and snippets.

View allanmac's full-sized avatar

Allan MacKinnon allanmac

  • Dispatch3 Inc.
  • South Florida, USA
  • 15:16 (UTC -04:00)
  • X @pixelio
View GitHub Profile
@timdecode
timdecode / simd_partition.metal
Created June 23, 2023 18:11
Metal implementation of subgroupPartitionNV
// Created by Timothy Davison on 2023-06-21.
//
// This is a Metal implementation of subgroupPartitionNV. You use it to find a mask of
// the other threads in a simd-group with the same value (a partition of the simd-group about
// a set of values).
//
// Feel free to use this in your code. Please share any fixes or ideas to make it faster.
//
// Khronos docs on subgroup partitioning:
// - https://github.com/KhronosGroup/GLSL/blob/master/extensions/nv/GL_NV_shader_subgroup_partitioned.txt
@Reedbeta
Reedbeta / interesting-libs.txt
Last active July 4, 2023 02:38
Interesting libraries I might like to use in a project
Interesting libraries I might like to use in a project...
Asset loading:
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h
flatbuffers - data serialization, zero-copy deserialization, extensible schemas https://github.com/google/flatbuffers
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h
tinyexr - https://github.com/syoyo/tinyexr
tinygltf - https://github.com/syoyo/tinygltf
tinyobjloader - https://github.com/syoyo/tinyobjloader
@jdryg
jdryg / cullrects_benchmark.cpp
Created April 20, 2018 16:55
cullRects SIMD benchmark
#define TEST_SIMD 3
struct Rect
{
float minx, miny;
float maxx, maxy;
};
struct RectSoA
{
@jfischer
jfischer / export_github_issues.py
Last active March 2, 2016 18:21 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
#!/usr/bin/env python
"""
Exports Issues from a specified repository to a CSV and/or JSON file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. If a public repository,
no user/password needs to be provided. Supports Github API v3.
Orginally based on a script by Brian Luft at https://gist.github.com/unbracketed/3380407
This requires installing the 'requests' package (https://pypi.python.org/pypi/requests/).
@paniq
paniq / minmaxabssign.txt
Last active June 1, 2024 14:59
useful min/max/abs/sign identities
max(-x,-y) = -min(x,y)
min(-x,-y) = -max(x,y)
abs(x) = abs(-x)
abs(x) = max(x,-x) = -min(x,-x)
abs(x*a) = if (a >= 0) abs(x)*a
(a < 0) -abs(x)*a
// basically any commutative operation
min(x,y) + max(x,y) = x + y
@Spaxe
Spaxe / pixelio.py
Created April 7, 2011 15:45
Pixel.io's crytarithm brute force solution
# WWW * GPU = PIXEL I/O
# X = 6
# O != 1
from itertools import permutations
for digits in permutations(d for d in range(10) if d != 6):
W, G, P, U, I, E, L, O = digits[:8]
if (O != 1 and O * (W*100+W*10+W) * (G*100+P*10+U) == (P*100000+I*10000+6000+E*100+L*10+I)):
print ("{}{}{} * {}{}{} = {}{}6{}{} {}/{}".format(W, W, W, G, P, U, P, I, E, L, I, O))