Skip to content

Instantly share code, notes, and snippets.

@idatsy
idatsy / comptime.c
Created October 16, 2024 06:37
C compile time function dispatch based on available SIMD instruction set
#include <immintrin.h>
// Scalar (default) implementation
__attribute__((target("default")))
void matmul_default(Arr* c, Arr* a, Arr* b) {
int P = a->shape[0];
int Q = a->shape[1];
int R = b->shape[1];
for (int i = 0; i < P; i++) {
for (int j = 0; j < R; j++) {
{
"version": "0.1.0",
"name": "pump",
"instructions": [
{
"name": "initialize",
"docs": [
"Creates the global state."
],
"accounts": [
@idatsy
idatsy / audio_silences.py
Created February 10, 2024 14:15
Download youtube audio and remove silences
import logging
import multiprocessing
import re
from pathlib import Path
from typing import Any
from pydub import silence, AudioSegment
from pydub.utils import make_chunks
from pytube import YouTube
from tqdm import tqdm