How to execute several backslash operations in parallel on GPU?

2 visualizaciones (últimos 30 días)
Minseong Kim
Minseong Kim el 1 de Nov. de 2020
Comentada: Walter Roberson el 2 de Nov. de 2020
Is is possible several backslash operations in parallel on GPU?
I converted the MATLAB code to CUDA code.
I expected the three backslash operations would be executed in parallel, but It seemed that the code was executed in serial.
function [z]=backslash(A, a, B, b, C, c)
%#codegen
coder.gpu.kernelfun();
z = [A\a;B\b;C\c]
end
I generated a mex file with codegen command.
cfg=coder.gpuConfig('mex')
codegen -config cfg -args {A, b, B, b, C, c} backslash

Respuestas (2)

Walter Roberson
Walter Roberson el 1 de Nov. de 2020
blkdiag(A, B, C) \ [a; b; c]

Joss Knight
Joss Knight el 2 de Nov. de 2020
Try using gpuArray/pagefun before you resort to code generation.
  1 comentario
Walter Roberson
Walter Roberson el 2 de Nov. de 2020
pagefun will, though, require that all the systems are the same size.
The solution I posted requires that all of the right hand sides have the same number of columns, but does not require that the systems be the same size. I figured that requiring them to have the same number of columns was reasonable considering that if it were not the case then the user's function would have failed in the vertcat stage.

Iniciar sesión para comentar.

Categorías

Más información sobre Kernel Creation from MATLAB Code en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by