Skip to content

Instantly share code, notes, and snippets.

View lancejpollard's full-sized avatar
😍
Lots of coding

Lance Pollard lancejpollard

😍
Lots of coding
View GitHub Profile

why doesn't radfft support AVX on PC?

So there's two separate issues here: using instructions added in AVX and using 256-bit wide vectors. The former turns out to be much easier than the latter for our use case.

Problem number 1 was that you positively need to put AVX code in a separate file with different compiler settings (/arch:AVX for VC++, -mavx for GCC/Clang) that make all SSE code emitted also use VEX encoding, and at the time radfft was written there was no way in CDep to set compiler flags for just one file, just for the overall build.

[There's the GCC "target" annotations on individual funcs, which in principle fix this, but I ran into nasty problems with this for several compiler versions, and VC++ has no equivalent, so we're not currently using that and just sticking with different compilation units.]

The other issue is to do with CPU power management.

@AndyShiue
AndyShiue / CuTT.md
Last active April 28, 2024 23:35
Cubical type theory for dummies

I think I’ve figured out most parts of the cubical type theory papers; I’m going to take a shot to explain it informally in the format of Q&As. I prefer using syntax or terminologies that fit better rather than the more standard ones.

Q: What is cubical type theory?

A: It’s a type theory giving homotopy type theory its computational meaning.

Q: What is homotopy type theory then?

A: It’s traditional type theory (which refers to Martin-Löf type theory in this Q&A) augmented with higher inductive types and the univalence axiom.

@felipecrv
felipecrv / btree.js
Created April 1, 2018 13:32
In-memory B+ Tree implemented in Javascript with Flow type annotations
/* @flow */
const KEY_KIND_STRING = 1;
const KEY_KIND_NUMBER = 2;
const KEY_KIND_BOOL = 3;
const KEY_KIND_RECORD = 4;
type KeyKind = 1 | 2 | 3 | 4;
class KeyValue<K, V> {
key: ?K;
@bodil
bodil / bool.rs
Last active February 28, 2021 03:50
Simple type level natural numbers in Rust
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct True;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct False;
pub trait Bool {
fn new() -> Self;
}
impl Bool for True {
@ppisarczyk
ppisarczyk / Programming_Languages_Extensions.json
Last active May 5, 2024 09:25 — forked from aymen-mouelhi/languages.json
Programming Languages and their File Extensions
[
{
"name":"ABAP",
"type":"programming",
"extensions":[
".abap"
]
},
{
"name":"AGS Script",
@lynn
lynn / lojban-thesaurus.md
Last active March 1, 2024 15:34
A semantically sorted list of Lojban root words

Lojban Thesaurus

Translated to Markdown from this ancient TeX file. I’m not sure who made the original.

Hover over a link to see the place structure. Click it to view gismu info on Wiktionary.

1 Structures

1.1 Set, group, mass

About this guide

This is a brief introduction to Lojban, a constructed human language. It has a very nice, fun, regular grammar that computers and humans alike can understand easily.

Basic grammar

All Lojban words are either particles (tiny words that help the grammar) or verbs (which tell us how nouns relate).

A Lojban sentence consists of a main verb with a bunch of nouns plugged into it.

A Lojban verb definition looks like this:

@foonathan
foonathan / borrow.cpp
Last active August 24, 2023 08:42
Quick'n'dirty implementation of Rust's borrow checker for a C++Now Lightning Talk - not supposed to be used
#include <iostream>
#include "borrow_checker.hpp"
int main()
{
auto i = 42;
// borrow `i` under name `ref`
borrow_var(ref, i)
{
"presets": [
{
"Name": "Major",
"Value": "1;3;5;6;8;10;12",
"Group": "Common"
},
{
"Name": "Minor",
"Value": "1;3;4;6;8;9;11",