|
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 |
|
| 5 | +"""Numba-dpex implementation for gaussian elimination.""" |
| 6 | + |
5 | 7 | import dpctl |
6 | 8 | import numba_dpex |
7 | 9 |
|
8 | 10 |
|
9 | 11 | @numba_dpex.kernel() |
10 | 12 | def gaussian_kernel_1(m, a, size, t): |
| 13 | + """Kernel to generate the multiplier.""" |
11 | 14 | if ( |
12 | 15 | numba_dpex.get_local_id(2) |
13 | 16 | + numba_dpex.get_group_id(2) * numba_dpex.get_local_size(2) |
@@ -41,6 +44,7 @@ def gaussian_kernel_1(m, a, size, t): |
41 | 44 |
|
42 | 45 | @numba_dpex.kernel() |
43 | 46 | def gaussian_kernel_2(m, a, b, size, t): |
| 47 | + """Kernel to do the gaussian elimination using gaussian matrix manipulation.""" |
44 | 48 | if ( |
45 | 49 | numba_dpex.get_local_id(2) |
46 | 50 | + numba_dpex.get_group_id(2) * numba_dpex.get_local_size(2) |
@@ -70,6 +74,17 @@ def gaussian_kernel_2(m, a, b, size, t): |
70 | 74 |
|
71 | 75 |
|
72 | 76 | def gaussian(a, b, m, size, block_sizeXY, result): |
| 77 | + """Perform the gaussian elimination on input matrix for numba_dpex. |
| 78 | +
|
| 79 | + Args: |
| 80 | + a: Actual matrix. |
| 81 | + b: Column matrix . |
| 82 | + m: multiplier matrix. |
| 83 | + size: size of the input matrices. |
| 84 | + block_sizeXY: block size of the 2d kernels. |
| 85 | + result: result after performing gaussian elimination. |
| 86 | +
|
| 87 | + """ |
73 | 88 | device = dpctl.SyclDevice() |
74 | 89 | block_size = device.max_work_group_size |
75 | 90 | grid_size = int((size / block_size) + 0 if not (size % block_size) else 1) |
|
0 commit comments