Skip to content

Instantly share code, notes, and snippets.

@telegraphic
telegraphic / dp4a_cross_correlator.py
Last active November 10, 2021 20:31
Use of CUDA DP4A instruction using PyCUDA
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
import numpy as np
def compute_xcorr_cpu(d):
dc = d.astype('float32').view('complex64')
dc = dc.transpose((0,2,3,1)).copy()
xcorr_cpu = np.einsum('...i,...j', dc, np.conj(dc)).view('float32').astype('int32').sum(axis=-4)
return xcorr_cpu
@telegraphic
telegraphic / pygedm-dask-example.ipynb
Created July 8, 2020 05:49
Parallel computation of DM model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@telegraphic
telegraphic / board_managers.py
Created June 21, 2022 05:02
Gist for controlling multiple snap boards through `casperfpga` and multiprocessing
from utmost2d_snap import UtmostSnap
from rpi_bf_control import RpiBeamformerController
import time
from multiprocessing import JoinableQueue
from threading import Thread
class BoardManager(object):
""" Base class for multithreaded control of multiple boards