Skip to content

Instantly share code, notes, and snippets.

View scivision's full-sized avatar
💭
I will be slow to respond.

scivision

💭
I will be slow to respond.
View GitHub Profile
@scivision
scivision / Readme.md
Last active December 2, 2026 15:03
CPU arch detection from Python (Linux, macOS, Windows)

Print CPU Information

Python script to print CPU information. CMake doesn't currently have access to detailed CPU information like family ID, model ID, and vendor string.

python3 cpu_info.py

ARM on Windows or Linux:

@scivision
scivision / Readme.md
Last active November 30, 2026 21:49
NVHPC nvfortran compiler optimization audit script

Use Python asyncio to run compiler tests concurrently

Significant speedup in compiler tests can occur with concurrent execution enabled by Python asyncio.TaskGroup.

Written to support nvfortran bug finding.

@scivision
scivision / .gitignore
Last active December 4, 2026 21:22
Roblox activity log
config.json
*.db
@scivision
scivision / Readme.md
Last active October 8, 2026 19:05
Our optical flow repositories

Optical flow repositories I've collected

I've collected a few optical flow repositories that interested us due to their use in papers relevant to our field. There are many, many more algorithms that are likely of greater merit-here's just a few I've looked at over time.

  • Black Robust Optical Flow uses C code from 1996 originally. I created Python and Matlab interfaces to this. I added CMake and updated the C code to work on modern compilers. There is newer code from Black circa 2010 that is said to be easier to use and more effective.
  • PyOptFlow I implemented Python and Matlab code for Horn Schunck optical flow
  • Python Lucas Kanade I improved Python code for Lucas Kanade optical flow
  • Phantom generator I wrote a Python phantom generator that makes morphing / moving shapes that are roughly like
@scivision
scivision / .gitignore
Last active October 6, 2026 22:31
Use "gh" to check a list of Actions for major updates
*.json
__pycache__/
@scivision
scivision / Readme.md
Last active September 28, 2026 20:20
Minimal CMake install script using older CMake

Minimal CMake install using older CMake

We often find such a platform-independent script handy for CI or for helping end users get a new-enough CMake. It can also be used to install older specific CMake versions for CI testing of minimum CMake versions.

We have a more elaborate and general script that handles older CMake versions at cmakeutils under scripts/install_cmake.cmake. This script here is intentionally very minimal and does little error checking.

@scivision
scivision / readme.md
Last active September 25, 2026 18:08
CMake version in repository by Linux distribution
@scivision
scivision / Readme.md
Last active September 22, 2026 21:52
Heterogeneous CPU counts in Python

Heterogeneous CPU core count

This Python script uses only built-in stdlib functions and attempts to detect the CPU count of each type of CPU core. Many CPUs have only one core type, while others (especially for laptops) may have 2 or more CPU core types, sometimes called "big-little" or "super-performance-efficiency".

Usage

python cpu_hetero.py
cmake_minimum_required(VERSION 3.19)
project(mod_files LANGUAGES Fortran)
enable_testing()
include(CheckCompilerFlag)
set(tgt dummy)
set(submod define_pi)
@scivision
scivision / aocc.sh
Last active November 4, 2026 22:49
AOCC AMD compiler source script
# Activate AOCC compilers by
# source aocc.sh
version=6.0.0
root=/opt/AMD/aocc-compiler-${version}
[[ ! -d ${root} ]] && echo "ERROR: ${root} not found" && exit 1
source ${root}/setenv_AOCC.sh