Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Gad Abraham <gad.abraham@gm...>  20130117 05:06:49
Attachments:
Message as HTML

Hi, Is there a fast way to compute the Frobenius norm of a (dense) matrix? Also, is it possible to do logical operations such as finding all matrix elements greater than some scalar, e.g., X = Y > 1, where Y is a dense matrix and X would be a 0/1 indicator matrix. Couldn't find these in the documentation, but someone might have written some custom kernel for this... Thanks, Gad 
From: Karl Rupp <rupp@iu...>  20130123 19:59:36

Hi Gad, argl, sorry, I somehow thought I had replied to your message already... :( > Is there a fast way to compute the Frobenius norm of a (dense) matrix? Currently there is only a very indirect way of doing it: You can extract the memory handle from a matrix, feed it to the constructor of a vector, and then compute norm_2() on the vector. This might work with OpenCL only, though. Please let me know if you need a code example for that. Matrix norms are one of the few things which are missing to cover all the publicly documented features of Boost.uBLAS, so it's one of the next features we will add to ViennaCL. > Also, is it possible to do logical operations such as finding all matrix > elements greater than some scalar, e.g., X = Y > 1, where Y is a dense > matrix and X would be a 0/1 indicator matrix. It's not natively supported, no. However, the use of a custom kernel (OpenCL/CUDA/OpenMP) should be fairly simple. I can also assist you with that if you like. > Couldn't find these in the documentation, but someone might have written > some custom kernel for this... I'm not aware of anybody having a kernel ready  but users usually don't report their custom kernels ;) Best regards, Karli >  > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow  3,200 stepbystep video tutorials by Microsoft > MVPs and experts. ON SALE this month only  learn more at: > http://p.sf.net/sfu/learnmore_122712 > > > > _______________________________________________ > ViennaCLsupport mailing list > ViennaCLsupport@... > https://lists.sourceforge.net/lists/listinfo/viennaclsupport > 
From: Gad Abraham <gad.abraham@gm...>  20130129 22:56:53
Attachments:
Message as HTML

On 24 January 2013 06:59, Karl Rupp <rupp@...> wrote: > Hi Gad, > > argl, sorry, I somehow thought I had replied to your message already... :( > > > Is there a fast way to compute the Frobenius norm of a (dense) matrix? > > Currently there is only a very indirect way of doing it: You can extract > the memory handle from a matrix, feed it to the constructor of a vector, > and then compute norm_2() on the vector. This might work with OpenCL > only, though. Please let me know if you need a code example for that. > a quick example would be great! > > Matrix norms are one of the few things which are missing to cover all > the publicly documented features of Boost.uBLAS, so it's one of the next > features we will add to ViennaCL. > > > > Also, is it possible to do logical operations such as finding all matrix > > elements greater than some scalar, e.g., X = Y > 1, where Y is a dense > > matrix and X would be a 0/1 indicator matrix. > > It's not natively supported, no. However, the use of a custom kernel > (OpenCL/CUDA/OpenMP) should be fairly simple. I can also assist you with > that if you like. > Some hints or code examples would be great! 
From: Karl Rupp <rupp@iu...>  20130131 21:56:15
Attachments:
customkernelsfrobenius.cpp

Hi, > > Is there a fast way to compute the Frobenius norm of a (dense) > matrix? > > Currently there is only a very indirect way of doing it: You can extract > the memory handle from a matrix, feed it to the constructor of a vector, > and then compute norm_2() on the vector. This might work with OpenCL > only, though. Please let me know if you need a code example for that. > > > a quick example would be great! See the example attached. Currently this works with OpenCL only. For CUDA or standard hostbased execution you need to run overwrite the entries of a previously created vector using essentially the same approach is outlined for the Frobenius norm below. > > Also, is it possible to do logical operations such as finding all > matrix > > elements greater than some scalar, e.g., X = Y > 1, where Y is a > dense > > matrix and X would be a 0/1 indicator matrix. > > It's not natively supported, no. However, the use of a custom kernel > (OpenCL/CUDA/OpenMP) should be fairly simple. I can also assist you with > that if you like. > > > Some hints or code examples would be great! The attached example shows how to do this with OpenCL. The key is to extract the lowlevel buffer handle: Using OpenCL: Y.handle().opencl_handle().get() Using CUDA: Y.handle().cuda_handle().get() Otherwise: Y.handle().ram_handle().get() With CUDA you pass the handle directly to your CUDA kernels, and in standard hostbased execution you just pass the pointer to the data to an ordinary function. Best regards, Karli 
From: Gad Abraham <gad.abraham@gm...>  20130205 05:25:19
Attachments:
Message as HTML

On 1 February 2013 08:56, Karl Rupp <rupp@...> wrote: > Hi, > > > > > Is there a fast way to compute the Frobenius norm of a (dense) > >> matrix? >> >> Currently there is only a very indirect way of doing it: You can >> extract >> the memory handle from a matrix, feed it to the constructor of a >> vector, >> and then compute norm_2() on the vector. This might work with OpenCL >> only, though. Please let me know if you need a code example for that. >> >> >> a quick example would be great! >> > > See the example attached. Currently this works with OpenCL only. For CUDA > or standard hostbased execution you need to run overwrite the entries of a > previously created vector using essentially the same approach is outlined > for the Frobenius norm below. > > > > > Also, is it possible to do logical operations such as finding all >> matrix >> > elements greater than some scalar, e.g., X = Y > 1, where Y is a >> dense >> > matrix and X would be a 0/1 indicator matrix. >> >> It's not natively supported, no. However, the use of a custom kernel >> (OpenCL/CUDA/OpenMP) should be fairly simple. I can also assist you >> with >> that if you like. >> >> >> Some hints or code examples would be great! >> > > The attached example shows how to do this with OpenCL. The key is to > extract the lowlevel buffer handle: > Using OpenCL: Y.handle().opencl_handle().**get() > Using CUDA: Y.handle().cuda_handle().get() > Otherwise: Y.handle().ram_handle().get() > > With CUDA you pass the handle directly to your CUDA kernels, and in > standard hostbased execution you just pass the pointer to the data to an > ordinary function. > > Best regards, > Karli > Much appreciated, Karli! Thanks, Gad 
Sign up for the SourceForge newsletter:
No, thanks