libraries-openly-fused/fusedkernellibrary/fkl-data-structures
Claude Code and agent skill by libraries-openly-fused/fusedkernellibrary
- community
Checking that the SKILL.md file is still in the repository.
FKL data structures — Ptr2D, Tensor, TensorT, RawPtr, PtrDims, MemType, constructors and memory layouts (packed, planar CHW, transposed T3D). Use when allocating or wrapping GPU memory for FKL pipelines, when interfacing external pointers (torch/cupy buffers), or when a Tensor/TensorT constructor or pitch issue appears.
Install
npx vskill@latest install libraries-openly-fused/fusedkernellibrary/fkl-data-structuresSKILL.md
FKL data structures
The hierarchy
RawPtr<ND, T>— POD: data pointer +PtrDims<ND>. What kernels see.Ptr<ND, T>— ref-counted owner/wrapper around a RawPtr.- Convenience classes:
Ptr1D,Ptr2D,Ptr3D,Tensor,TensorT. .ptr()returns the RawPtr;Op::build(container)extracts what it needs. Copies of Ptr objects are SHALLOW (shared refcount).
Dimensionalities (ND)
| ND | layout | use | |
|---|---|---|---|
_1D | w | flat arrays | |
_2D | w x h (pitched) | images | |
_3D | w x h x planes x color_planes | batched images / planar CHW | |
T3D | transposed: color_planes outermost | NCHW-like DNN ingest |
Constructors that matter (and their traps)
TRAPS (verified the hard way):
Tensorhas NO PtrDims-taking constructor — pass the dimension list.Tensor's semantics for batch+channels:planes= batch (thread.z),color_planes= channels.TensorSplitwrites channel c of plane z at offsetz * plane_pitch * color_planes + c * plane_pitch.TensorT(data, ...)and the 4-argPtrDims<T3D>constructor leave pitches at ZERO (they are filled on allocation). When wrapping an external pointer for T3D, build the PtrDims and set pitch, plane_pitch, color_planes_pitch manually, then construct theRawPtr<T3D>and pass it toTensorTSplit<T>::build(rawPtr).- Pitch is in BYTES. For tightly-packed external buffers, pitch = width * sizeof(T).
MemType
Device, Host, HostPinned, DeviceAndPinned (mirrored pair with .upload(stream) / .download(stream)). GPU pipelines require Device or DeviceAndPinned memory — CircularTensor enforces this at runtime.
Layout cheat-sheet for DNN interop
| want | use | output shape | |
|---|---|---|---|
| packed HWC batch | TensorWrite<T> | (batch, H, W, C-packed-in-T) | |
| planar CHW per image | TensorSplit<T> | (batch, C, H, W) | |
| planar, C outermost | TensorTSplit<T> into TensorT | (C, batch, H, W) | |
| read planar back as packed | TensorPack<T> / TensorTPack<T> | — |
Vector pixel types
Channels are encoded in the TYPE: uchar3, float4, etc.
VBase<T>= scalar base,cn<T>= channels,VectorType_t<base, n>.- Per-channel arithmetic operators are predefined (vector_utils.h).
- 16-bit types (
ushort3,short2) work like the 8/32-bit ones.
External-framework interop (what bindings do)
A torch/cupy CUDA tensor is wrapped without copying:
Contiguity is the caller's responsibility (require C-contiguous or read strides into the pitch argument).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/fkl-data-structures/SKILL.md
Popularity
- Repository stars
- 58
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/libraries-openly-fused/fusedkernellibrary/fkl-data-structures)