Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from benchmarks.bench_ising import IsingModel, setup | |
import time | |
if __name__ == '__main__': | |
t = time.time() | |
setup() | |
im = IsingModel() | |
print('compile', time.time()-t) | |
t = time.time() | |
im.time_ising() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License: | |
# I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
# | |
# Otherwise, since initially posted on Stackoverflow, use as: | |
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
# http://stackoverflow.com/a/31047259/2719194 | |
# http://stackoverflow.com/a/4858123/2719194 | |
import types | |
import inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Download `aocl-linux-gcc-2.2.0_1_amd64.deb` into the same directory as this config file. | |
# 2. Build the container with `sudo singularity build numpy-aocl.img numpy-aocl.conf`. | |
# 3. Run ipython with `OMP_NUM_THREADS=64 singularity exec numpy-aocl.img ipython`. | |
Bootstrap: docker | |
From: continuumio/anaconda3 | |
%files | |
aocl-linux-gcc-2.2.0_1_amd64.deb /tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
def make_psd_matrix(M, T): | |
tmp = np.random.randn(T, M, M) + 1j * np.random.randn(T, M, M) | |
return np.einsum("tmn,tno->tmo", tmp, tmp.conj()) |