Skip to content

Instantly share code, notes, and snippets.

@mcarilli
mcarilli / nsight.sh
Last active April 25, 2026 01:15
Favorite nsight systems profiling commands for Pytorch scripts
# This isn't supposed to run as a bash script, i named it with ".sh" for syntax highlighting.
# https://developer.nvidia.com/nsight-systems
# https://docs.nvidia.com/nsight-systems/profiling/index.html
# My preferred nsys (command line executable used to create profiles) commands
#
# In your script, write
# torch.cuda.nvtx.range_push("region name")
# ...
@MattPD
MattPD / analysis.draft.md
Last active June 15, 2026 07:26
Program Analysis Resources (WIP draft)

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@aprell
aprell / newproject.sh
Created October 12, 2012 09:57
Project templates
#!/bin/bash
usage="Usage: $(basename "$0") <name>"
if [ $# -ne 1 ]; then
echo $usage
exit 0
fi
proj=$1
@aprell
aprell / Makefile
Created November 20, 2011 17:54
Simple unit testing for C
CC = gcc
CPPFLAGS += -D_GNU_SOURCE
CFLAGS += -O0 -g -Wall -Wextra
SRCS = driver.c module.c
OBJS = $(SRCS:.c=.o)
all: utest
utest: $(OBJS)
@vidarh
vidarh / closures-basic.c
Created December 18, 2009 12:10
A number of ways to implement closures in C, in preparation of an upcoming blog post
#include <stdio.h>
#include <stdlib.h>
struct closure {
void (* call)(struct closure *);
int x;
};