Skip to content

Instantly share code, notes, and snippets.

View melonedo's full-sized avatar

melonedo

View GitHub Profile
@melonedo
melonedo / api.py
Created August 9, 2026 04:34
nvImageCodec wrapper
"""Decode JPEG data directly into CUDA tensors with nvImageCodec.
The decoder enables fancy chroma upsampling and asks nvImageCodec to produce the
requested color order and layout directly. Compressed JPEG data remains on the
host, while decoded pixels are allocated in GPU memory and exposed to PyTorch
without copying through DLPack/CUDA array interoperability.
```
import cv2
import numpy as np
@melonedo
melonedo / generic-intra-warp-shuffle-generator.py
Created August 9, 2025 17:04
Generate generic intra warp shuffle for use with CUDA
# The algorithm proposed by https://github.com/triton-lang/triton/pull/7558
from dataclasses import dataclass
from enum import Enum
def inverse_permutation(P):
"""
Given a permutation P, return its inverse permutation.
"""
@melonedo
melonedo / plot-issue.jl
Created January 3, 2022 16:53
Plotly with LaTeXStrings is not displayed
### A Pluto.jl notebook ###
# v0.17.4
using Markdown
using InteractiveUtils
# ╔═╡ 72851118-6cb1-11ec-3338-8d9690c97989
begin
using Plots,LaTeXStrings
import PlotlyJS