CUDA的决定因素计算 [英] Determinant calculation with CUDA

查看:185
本文介绍了CUDA的决定因素计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有任何库或自由可用的代码,它将计算 6x6 )的双精度矩阵的行列式?

Is there any library or freely available code which will calculate the determinant of a small (6x6), double precision matrix entirely on a GPU?

推荐答案

这里是计划,你需要缓冲100个这些小矩阵,并启动内核一次计算行列式

Here is the plan, you will need to buffer 100s of these tiny matrices and launch the kernel once to compute the determinant for all of them at once.

我不会写实际的代码,但这应该是有帮助的。

I am not going to write actual code, but this should be helpful.

1)Launch#blocks =#matrices。每个块计算每个矩阵的行列式。

1) Launch # blocks = # matrices. Each block calculates determinant of each matrix.

2)det(A)= det(A11 * A22-A21 * A12);其中A是6x6,A11,A12,A21,A22是A的3×3子矩阵。

2) det(A) = det(A11 * A22 - A21 * A12); where A is 6x6, A11, A12, A21, A22 are 3x3 sub matrices of A.

3)写一个设备乘以3x3矩阵

3) Write a device function that does matrix multiply for 3x3 matrices

4)3x3矩阵的det很容易计算:使用此处的公式

4) det of a 3x3 matrix is simple to calculate: use the formula from here.

EDIT :显然如果A21 * A12 == A12 * A21

EDIT: Apparently (2) only works if A21 * A12 == A12 * A21

另一种选择是下列

1) LU针对每个6x6矩阵通过高斯消元分解

2)乘以U的对角线元素得到行列式。

2) Multiply the diagonal elements of U to get determinant.

这篇关于CUDA的决定因素计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆