Rank: 739 based on 150 downloads (last 30 days) and 4 files submitted
photo

Haim Avron

E-mail
Company/University
Tel Aviv University

Personal Profile:

Professional Interests:

 

Watch this Author's files

 

Files Posted by Haim View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Sep 2009 Solve quadratically constrained overdetermined l1 minimization. Solve min ||K * x - f||_1 s.t. ||y - x||_2 <= \epsilon where K has more rows than columns. Author: Haim Avron log barrier method, sparsity, optimization, l1 minimization, interior point method 37 0
16 Sep 2009 Blendenpik A fast solver of dense rectangular dense linear equations . (least squares or underdetermined). Author: Haim Avron leastsquares equation..., numerical linear alge..., underdetermined equat..., mathematics 13 4
  • 5.0
5.0 | 1 rating
15 Sep 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron cuda, programming, mex 79 11
  • 5.0
5.0 | 1 rating
08 Sep 2009 SpTriSolve Sparse triangular solve Author: Haim Avron linear system solve, numerical linear alge..., sparse matrix 21 0
Comments and Ratings by Haim View all
Updated File Comments Rating
29 Sep 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron

Hi Mklcst,

Do you have permissions to write to MATLAB's directories?

26 Sep 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron

To do the same on a Linux the one running the script should have root privileges. I currently do not have MATLAB on a Linux for which I have root privileges...

15 Sep 2009 Blendenpik A fast solver of dense rectangular dense linear equations . (least squares or underdetermined). Author: Haim Avron

For benchmarking results take a look at:
http://www.cs.tau.ac.il/~haima/blendenpik-v0.pdf
This paper has extensive benchmarking vs. LAPACK (which MATLAB uses). For some quick figures, on a random 20000x1000 matrix MATLAB's \ takes 27 sec, calling LAPACK directly (in compiled function lapack_solve_ls) takes 12.2, and blendenpik takes 7.8 secs. For some matrices blendenpik is 4 times faster than LAPACK.

As for the use of FFTW: Blendenpik uses DHT and DCT, not FFT. FFTW supports DHT and DCT but MATLAB's implementation of DCT doesn't use FFTW.

Comments and Ratings on Haim's Files View all
Updated File Comment by Comments Rating
23 Oct 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron Sara

Ok, hopefully I'm not overstaying my welcome on this forum, but I've found out more answers to my cutCreateTimer issue and I wanted to put them out there incase someone else falls into this issue.
It appears that somehow the cuda_mex compilation couldn't find my cutil libraries. This is not necessarily it's fault, I don't know much about make files, linking, etc. so it's fairly probable that I screwed something up somewhere. There is likely a short, easy, and correct way to fix this, but since I don't know it, here's my work around. If you find your way into the CUDA SDK folder you will find a Visual Studio solution for compiling everything cutil. If you change the output of these libraries to the cuda standard library ( likely something along the lines of CUDA/bin) and then rebuild the solution the cutil32 libraries will then be found by the compiler/linker. Will keep posting if I find out a more elegant solution.

22 Oct 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron Anthony

What would need to be done to port this code to a 64-bit platform?

22 Oct 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron Sara

Still having trouble with the cutCreateTimer. Here is an example. I have modified the example.cu that comes with this package to create this timer. In addition, the cutil32.lib and cutil32D.lib are linked in the setup_cuda_mex.m file. If anyone has a solution, I would be very excited to hear it.

#include <stdio.h>
#include <cuda.h>
#include <cutil.h>

#include "mex.h"

__global__ void square_array(float *a, int N)
{
  int idx = blockIdx.x * blockDim.x + threadIdx.x;
  if (idx<N) a[idx] = a[idx] * a[idx];
}

void mexFunction(int nargout, mxArray *argout[], int nargin, const mxArray *argin[])
{
  float *input, *cuda_mem;
  int N;
  size_t size;
unsigned int hTimer;

cutCreateTimer(&hTimer);

  argout[0] = mxDuplicateArray(argin[0]);
  input = (float *)mxGetPr(argout[0]);
  N = mxGetN(argout[0]) * mxGetM(argout[0]);
  size = N * sizeof(float);
  cudaMalloc((void **) &cuda_mem, size);
  cudaMemcpy(cuda_mem, input, size, cudaMemcpyHostToDevice);
  int block_size = 4;
  int n_blocks = N/block_size + (N%block_size == 0 ? 0:1);
  square_array <<< n_blocks, block_size >>> (cuda_mem, N);
  cudaMemcpy(input, cuda_mem, size, cudaMemcpyDeviceToHost);
  cudaFree(cuda_mem);
}

22 Oct 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron Sara

I'm working on Windows XP...has anyone had problems with cutCreateTimer not working? When it is called by either the CUT_SAFE_CALL or directly it crashes the program.

20 Oct 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron Sara

If you add cutil32.lib to

        if (strcmp(name, 'LINKFLAGS'))
            value = [value ' cudart.lib cutil32.lib'];
        end

in setup_cuda_mex.m, the linker will properly access cutil based functions. I spent a lot of time trying to figure out why I would get errors in the linking involving various cuda based functions even though the compiler knew the address to the header files...

Top Tags Applied by Haim
numerical linear algebra, cuda, interior point method, l1 minimization, leastsquares equations
Files Tagged by Haim View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Sep 2009 Solve quadratically constrained overdetermined l1 minimization. Solve min ||K * x - f||_1 s.t. ||y - x||_2 <= \epsilon where K has more rows than columns. Author: Haim Avron log barrier method, sparsity, optimization, l1 minimization, interior point method 37 0
16 Sep 2009 Blendenpik A fast solver of dense rectangular dense linear equations . (least squares or underdetermined). Author: Haim Avron leastsquares equation..., numerical linear alge..., underdetermined equat..., mathematics 13 4
  • 5.0
5.0 | 1 rating
15 Sep 2009 CUDA MEX Compile CUDA from within MATLAB! Just write cuda_mex filename.cu and it is ready. Author: Haim Avron cuda, programming, mex 79 11
  • 5.0
5.0 | 1 rating
08 Sep 2009 SpTriSolve Sparse triangular solve Author: Haim Avron linear system solve, numerical linear alge..., sparse matrix 21 0
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com