Skip to content

Commit 34892a3

Browse files
committed
[Code] Cuda reduce result matrix fixes
1 parent 9f0a145 commit 34892a3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ prototyping algorithms on a local computer for later running on a powerful serve
3030

3131
**PyPI package web page** is following [link](https://pypi.org/project/pycubool/).
3232

33-
### Features Summary
33+
### Features summary
3434

3535
- Matrix creation (empty, from data, with random data)
3636
- Matrix-matrix operations (multiplication, element-wise addition, kronecker product)
@@ -83,7 +83,7 @@ If all requirements are satisfied, run the following command to install PyPI pac
8383
$ python3 -m pip install pycubool
8484
```
8585

86-
## Getting Started
86+
## Getting started
8787

8888
This section gives instructions to build the library from sources.
8989
These steps are required if you want to build library for your specific platform with custom build settings.
@@ -98,7 +98,7 @@ These steps are required if you want to build library for your specific platform
9898
- Python 3 (for `pycubool` library)
9999
- Git (to get source code)
100100

101-
### Cuda & Compiler Setup
101+
### Cuda & compiler setup
102102

103103
> Skip this section if you want to build library with only sequential backend
104104
> without cuda backend support.
@@ -192,7 +192,7 @@ By default, the following cmake options will be automatically enabled:
192192
> $ export CUDAHOSTCXX=/usr/bin/g++-8
193193
> ```
194194
195-
### Python Wrapper
195+
### Python wrapper
196196
197197
**Export** env variable `PYTHONPATH="/build_dir_path/python/:$PYTHONPATH"` if
198198
you want to use `pycubool` without installation into default python packages dir.

cubool/sources/cuda/kernels/spreduce.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ namespace cubool {
4949
*/
5050
MatrixType operator()(const MatrixType& a) {
5151
auto nrows = a.m_rows;
52-
auto ncols = a.m_cols;
5352

5453
ContainerType<IndexType> rowIndex(nrows + 1);
5554
ContainerType<IndexType> tmpRowIndex(nrows + 1);
@@ -77,7 +76,8 @@ namespace cubool {
7776
assert(rowIndex.size() == nrows + 1);
7877
assert(rowIndex.back() == resultNvals);
7978

80-
return MatrixType(std::move(colIndex), std::move(rowIndex), nrows, ncols, resultNvals);
79+
// Returned matrix has M x 1 dim (so ncols always 1)
80+
return MatrixType(std::move(colIndex), std::move(rowIndex), nrows, 1, resultNvals);
8181
}
8282
};
8383

0 commit comments

Comments
 (0)