Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
151 views

Can I multiply the real parts of two complex matrices using dgemm?

I have two complex matrices A and B, with matching shapes. Is there a way to cleverly setup the dgemm arguments so as to get the result of the matrix multiplications of the real parts of these ...
G. Fougeron's user avatar
0 votes
1 answer
54 views

BLAS dnrm2 on Scipy returns wrong value. Possible wrong flattening

I am trying to use Scipy's BLAS functions from Cython and i want to call the dnrm2 for the l2 norm on a 2D typed memoryview. From the BLAS documentation, the dnrm2 returns the Euclidian norm of a ...
Mephistopheles Faust's user avatar
2 votes
1 answer
469 views

Maximizing the speed of Cython array operations when using typed memory views and BLAS

I'm trying to maximize the speed of my Cython 3.0 code that involves updating an array with a loop of several array operations (including matrix-vector multiplication, vector-vector addition, and ...
Eric's user avatar
  • 35
0 votes
0 answers
311 views

Scipy Blas/Lapack: Force use of AVX instruction set

I've written a simple cython program using scipy.linalg.cython_blas. When profiling the code, I see that the blas routines such as dgemv and dgemm are using the SSE instruction set. Given that my ...
Harsh Kumar's user avatar
2 votes
1 answer
213 views

Solve PSD linear system

I am trying to compute with BLAS/LAPACK the matrix $A - A B^{-1} A$ where A is symmetric and B is PSD. What would be the smartest way to do this? I was thinking to compute a Cholesky decomposition $B =...
Sap's user avatar
  • 23
0 votes
0 answers
132 views

OpenMP implementation slowed down by Lapack's DSYSV

I have written an algorithm in Cython that frequently executes Lapack and Blas routines. As the individual calls to these routines are independent of each other, I attempted to speed things up by ...
Michael Rapp's user avatar
4 votes
3 answers
936 views

Link Cython-wrapped C functions against BLAS from NumPy

I want to use inside a Cython extension some C functions defined in .c files that uses BLAS subroutines, e.g. cfile.c double ddot(int *N, double *DX, int *INCX, double *DY, int *INCY); double ...
anymous.asker's user avatar
3 votes
1 answer
1k views

How to make cython function accept float or double array input?

Suppose I have the following (MCVE...) cython function cimport cython from scipy.linalg.cython_blas cimport dnrm2 cpdef double func(int n, double[:] x): cdef int inc = 1 return dnrm2(&n, &...
P. Camilleri's user avatar
  • 13.2k
3 votes
2 answers
625 views

wrapping the ScaLAPACK functions in cython

I used lapack and blas library to implement matrix-inversion and multiply matrices in cython. Here is my code: import numpy as np cimport numpy as np cimport cython import ctypes cdef extern ...
Dalek's user avatar
  • 4,328
4 votes
2 answers
333 views

scipy BLAS routine does not overwrite input despite using overwrite_a=True

I am used to using BLAS routines in cython (from scipy.linalg.cython_blas), where the input is very often modified in place (for example, in the dger routine). I'm trying to do the same with scipy....
P. Camilleri's user avatar
  • 13.2k
2 votes
0 answers
106 views

cython_blas level 1 routine orders of magnitude faster than Cython for loop

I've come across a performance difference between a call to cblas (namely daxpy: perform y += alpha * x where y and x are vectors of the same length, and alpha is a scalar) and the same operation ...
P. Camilleri's user avatar
  • 13.2k
2 votes
1 answer
2k views

Using the Scipy cython_blas interface from Cython not working on vectors Mx1 1xN

This has to deal with a similar problem here: Calling BLAS / LAPACK directly using the SciPy interface and Cython but is different because I'm using the actual code in the SciPy example here ...
Matt's user avatar
  • 2,842
4 votes
1 answer
2k views

Calling BLAS / LAPACK directly using the SciPy interface and Cython

There was a post on this here: https://gist.github.com/JonathanRaiman/f2ce5331750da7b2d4e9 which shows a great speed improvement by just calling the Fortran libraries (BLAS / LAPACK / Intel MKL / ...
Matt's user avatar
  • 2,842
2 votes
1 answer
385 views

Using Fortran NumPy operations in Cython with NOGIL, what's the Fortran library equivalent to NumPy multiply?

So I'm trying to help another SO user, and in the process I can't create a Cython program to do something simple outside of NumPy which forces me to use the GIL. So that makes using OpenMP (multicore) ...
Matt's user avatar
  • 2,842
2 votes
1 answer
933 views

Calling blas ddot from Cython

I'm trying to use the dot product from BLAS library using Cython, but when the compiled module is called appears the following traceback "undefined symbol: cblas_ddot". Executing the np.config.show() ...
Nayher Andres Clavijo Vallejo's user avatar

15 30 50 per page