This file contains hidden or 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
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
os.environ["PATH"] += os.pathsep + '/usr/local/cuda-12.2/bin' | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' #supposed to suppress messages, but doesn't work | |
#import os | |
# use xla-lite (doesn't work for centroid for now) | |
#os.environ['TF_XLA_FLAGS']='--tf_xla_auto_jit=fusible' |
This file contains hidden or 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
alias width = 960 | |
alias height = 960 | |
alias MAX_ITERS = 200 | |
alias min_x = -2.0 | |
alias max_x = 0.6 | |
alias min_y = -1.5 | |
alias max_y = 1.5 | |
# Compute the number of steps to escape. |
This file contains hidden or 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
#ifndef Complex_H | |
#define Complex_H | |
#include <complex> | |
typedef std::complex<double> Complex; | |
typedef std::complex<double> complex_t; | |
typedef std::complex<float> complex64_t; | |
typedef std::complex<long double> complex256_t; | |
// decomplexify --------------------------------------------------------------- |
This file contains hidden or 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 numpy as np | |
#pythran export getArrayFactor (complex[:], float[:], float[:], float[:,:], float[:,:], float) | |
#pythran export getArrayFactor (complex[:], float[:], float[:], float, float, float) | |
def getArrayFactor(W, px, py, theta, phi, L): | |
theta = np.array (theta) | |
phi = np.array (phi) | |
N = px.shape[0] | |
AF = np.zeros(theta.shape, dtype=complex) | |
kx = np.sin(theta) * np.cos(phi) * 2.0 * np.pi / L |
This file contains hidden or 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 numpy as np | |
#pythran export getArrayFactor (complex[:], float[:], float[:], float[:,:], float[:,:], float) | |
def getArrayFactor(W, px, py, theta, phi, L): | |
N = px.shape[0] | |
AF = np.zeros(theta.shape, dtype=complex) | |
kx = np.sin(theta) * np.cos(phi) * 2.0 * np.pi / L | |
ky = np.sin(theta) * np.sin(phi) * 2.0 * np.pi / L | |
for n in range(N): | |
AF += W[n] * np.exp(-1j * (kx * px[n] + ky * py[n])) |
This file contains hidden or 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
#!/usr/bin/env python | |
# coding: utf-8 | |
import numpy as np | |
from sionna.utils import QAMSource | |
from sionna.signal import Upsampling, Downsampling, RootRaisedCosineFilter, empirical_psd, empirical_aclr | |
beta = 0.1 | |
span_in_symbols = 32 | |
samples_per_symbol = 2 | |
rrcf = RootRaisedCosineFilter(span_in_symbols, samples_per_symbol, beta, normalize=False) | |
mf = RootRaisedCosineFilter(span_in_symbols, samples_per_symbol, beta, normalize=False) |
This file contains hidden or 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 transonic import boost | |
import numpy as np | |
@boost | |
class crl: | |
k: float | |
aT: float | |
sum1: float | |
sum2: float | |
This file contains hidden or 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 numpy as np | |
from transonic import boost | |
A = "complex[:]" | |
S = "int[:]" | |
@boost(boundscheck=True) | |
def call1 (map: A, s: int): | |
return map[s] |
This file contains hidden or 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 numpy as np | |
#pythran export orthogonal_mod (int[:], int) | |
#pythran export orthogonal_mod (int32[:], int) | |
def orthogonal_mod (x, nbits): | |
out = np.zeros ((len(x), 1<<nbits), dtype=complex) | |
for e in range (len (x)): | |
out[e,x[e]] = 1 | |
return out |
This file contains hidden or 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 histogram2d_c.cc:6: | |
/home/nbecker/.local/include/xtensor/xtensor_config.hpp:87:43: error: 'XSIMD_DEFAULT_ALIGNMENT' was not declared in this scope; did you mean 'XTENSOR_DEFAULT_ALIGNMENT'? | |
87 | #define XTENSOR_DEFAULT_ALIGNMENT XSIMD_DEFAULT_ALIGNMENT | |
| ^~~~~~~~~~~~~~~~~~~~~~~ | |
/home/nbecker/.local/include/xtensor/xtensor_config.hpp:87:43: note: in definition of macro 'XTENSOR_DEFAULT_ALIGNMENT' | |
87 | #define XTENSOR_DEFAULT_ALIGNMENT XSIMD_DEFAULT_ALIGNMENT | |
| ^~~~~~~~~~~~~~~~~~~~~~~ | |
/home/nbecker/.local/include/xtensor/xstorage.hpp:1389:59: note: in expansion of macro 'XTENSOR_SELECT_ALIGN' | |
1389 | template <class T, std::size_t N, std::size_t Align = XTENSOR_SELECT_ALIGN(T)> | |
| ^~~~~~~~~~~~~~~~~~~~ |
NewerOlder