Skip to content

Instantly share code, notes, and snippets.

View Mark1626's full-sized avatar
👁️
P-4503599627370517

Nimalan Mark1626

👁️
P-4503599627370517
View GitHub Profile
@Mark1626
Mark1626 / .casarc
Created April 12, 2024 12:56
Casacore ~/.casarc to find measures if it is in another location
measures.DE200.directory: ${CASACORE_SW_DIR}/data/ephemerides
measures.DE405.directory: ${CASACORE_SW_DIR}/data/ephemerides
measures.line.directory: ${CASACORE_SW_DIR}/data/ephemerides
measures.sources.directory: ${CASACORE_SW_DIR}/data/ephemerides
measures.comet.directory: ${CASACORE_SW_DIR}/data/ephemerides
measures.ierseop97.directory: ${CASACORE_SW_DIR}/data/geodetic
measures.ierspredict.directory: ${CASACORE_SW_DIR}/data/geodetic
measures.tai_utc.directory: ${CASACORE_SW_DIR}/data/geodetic
measures.igrf.directory: ${CASACORE_SW_DIR}/data/geodetic
measures.observatory.directory: ${CASACORE_SW_DIR}/data/geodetic
@Mark1626
Mark1626 / hls_acc.py
Created January 28, 2024 13:58
Litex Module for adding Vitis HLS generated IP into a Litex SoC
from migen import *
from litex.soc.integration.common import *
from litex.soc.integration.soc_core import *
from litex.soc.integration.builder import *
from litex.soc.integration.soc import *
from litex.soc.interconnect import axi
class HLSAccAXI(Module, AutoCSR):
@Mark1626
Mark1626 / Document.scala
Last active January 21, 2024 16:34
A Scala 3 port of the code of Document.scala from the Scala 2 stdlib
/*
Scala 3 port of Michel Schinz's Document.scala
A basic pretty-printing library, based on Lindig's strict version
of Wadler's adaptation of Hughes' pretty-printer.
https://github.com/scala/scala/blob/v2.11.8/src/library/scala/text/Document.scala
Remove the example and Main at the end if you want to use this in your code.
Example of usage with an AST can be run directly with
@Mark1626
Mark1626 / complex.fuse
Last active January 11, 2024 07:14
Complex numbers for Dahlia
record complex {
real: float;
imag: float
}
def complex_mul(a: complex, b: complex): complex = {
let cr: float = (a.real * b.real) - (a.imag * b.imag);
let ci: float = (a.real * b.imag) + (a.imag * b.real);
let c: complex = { real=cr; imag=ci };
return c;
@Mark1626
Mark1626 / test.ms
Created September 9, 2023 09:10
Groff test
.TL
groff
.AU
mark
.NH
Heading
.NH 2
def serialise_array(clf):
tree_ser = []
offsets = []
for estimator in clf.estimators_:
offsets.append(len(tree_ser))
tree = estimator.tree_
is_leaf = [1 if child_left == -1 else 0 for child_left in tree.children_left]
@Mark1626
Mark1626 / hilbert.cc
Last active April 1, 2023 11:41
Benchmark to see if Hilbert curve property of cache locality can improve performance in a 2D Median Filter.
/*
Author: Nimalan M @mark1626
Comment: Minor improvement using a Hilbert curve when using -O3 + march=native, machine used AMD Ryzen 5800X
Note: Parallelism for the Hilbert version has not been completed
Credits: Function to calculate next position in Hilbert curve from Hacker's Delight (Second Edition) by Henry S. Warren, Jr.
*/
#include <cstdio>
@Mark1626
Mark1626 / fits2bp.py
Created December 7, 2022 12:45
Convert Fits to BP
#!/usr/bin/env python
# coding: utf-8
from astropy.io import fits
import adios2
import numpy as np
import os
filename = 'casa.fits'
From d8a4c6e24df34012d67b8ced32c43d3ba966fe09 Mon Sep 17 00:00:00 2001
From: E4R <e4r@localhost.localdomain>
Date: Fri, 9 Dec 2022 12:45:44 +0530
Subject: [PATCH] Update-casatools-build-to-compile-with-march
---
.gitmodules | 3 ++-
casatools/ac/templates/setup.py.in | 13 ++++++++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
@Mark1626
Mark1626 / bench.sh
Last active November 18, 2022 11:23
Min Max with x86 SIMD Intrinsics
#!/usr/bin/env bash
set -e
set -x
declare -a SIZE=(1024 2048 4096 8192 16384 32768)
# declare -a SIZE=(1024 2048)
rm -f runs.txt