Skip to content

Commit e63acc4

Browse files
authored
Merge pull request #1 from JetBrains-Research/master
Pulling changes from the main repository
2 parents 6791bac + 00524f0 commit e63acc4

31 files changed

+1258
-232
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33

44
# Build files
55
/cmake-build-debug
6-
/build
6+
/build
7+
8+
# Python cache
9+
/python/pycubool/__pycache__/

CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ set_target_properties(cubool PROPERTIES CUDA_STANDARD 14)
9292
set_target_properties(cubool PROPERTIES CUDA_STANDARD_REQUIRED ON)
9393
set_target_properties(cubool PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
9494

95+
96+
set(CUBOOL_DUMMY_SOURCES
97+
include/cubool/cubool.h
98+
src/cubool-dummy/cubool.cpp
99+
src/cubool-dummy/version.hpp
100+
src/cubool-dummy/instance.hpp
101+
src/cubool-dummy/matrix.hpp
102+
)
103+
104+
# Create dummy library instance for testing purposes
105+
add_library(cubool_dummy SHARED ${CUBOOL_DUMMY_SOURCES})
106+
107+
target_include_directories(cubool_dummy PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
108+
target_include_directories(cubool_dummy PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)
109+
target_include_directories(cubool_dummy PRIVATE ${CMAKE_BINARY_DIR}/src)
110+
111+
target_compile_features(cubool_dummy PUBLIC cxx_std_11)
112+
113+
set_target_properties(cubool_dummy PROPERTIES CXX_STANDARD 11)
114+
set_target_properties(cubool_dummy PROPERTIES CXX_STANDARD_REQUIRED ON)
115+
95116
# If tests enabled, add tests sources to the build
96117
if (CUBOOL_BUILD_TESTS)
97118
add_subdirectory(tests)

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ the programming language *COBOL*.
2929
- [ ] Block CSR multiplication
3030
- [ ] Block CSR kronecker
3131
- [ ] Sparse matrix wrapper ?
32-
- [ ] Wrapper for Python API
32+
- [X] Wrapper for Python API
33+
- [ ] Wrapper test in Python
3334
- [ ] User guide
3435
- [ ] Unit Tests collection
36+
- [X] Dummy library implementation for testing
3537
- [ ] Publish built artifacts and shared lib
3638

3739
## Requirements
@@ -126,6 +128,9 @@ cuBool
126128
├── docs - documents, text files and various helpful stuff
127129
├── tests - gtest-based unit-tests collection
128130
├── scripts - short utility programs
131+
├── python - project python sources
132+
│ ├── pycubool - cubool library wrapper for python (similar to pygraphblas)
133+
│ └── tests - tests for python wrapper
129134
├── thirdparty - project dependencies
130135
│ ├── cub - cuda utility, required for nsparse
131136
│ ├── gtest - google test framework for unit testing
@@ -143,4 +148,4 @@ This project is licensed under MIT License. License text can be found in the
143148
## Contributors
144149

145150
- Semyon Grigorev (Github: [gsvgit](https://github.com/gsvgit))
146-
- Egor Orachyov (Github: [EgorOrachyov](https://github.com/EgorOrachyov))
151+
- Egor Orachyov (Github: [EgorOrachyov](https://github.com/EgorOrachyov))

include/cubool/cubool.h

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ CUBOOL_EXPERIMENTAL CUBOOL_API CuBoolStatus CuBool_MatrixDense_Build(
293293
*
294294
* @return Error code on this operation
295295
*/
296-
CUBOOL_EXPERIMENTAL CUBOOL_API CuBoolStatus CuBool_MatrixDense_ExtractPairs(
296+
CUBOOL_EXPERIMENTAL CUBOOL_API CuBoolStatus CuBool_MatrixDense_ExtractPairsExt(
297297
CuBoolInstance instance,
298298
CuBoolMatrixDense matrix,
299299
CuBoolIndex_t** rows,
@@ -403,6 +403,27 @@ CUBOOL_API CuBoolStatus CuBool_Matrix_Build(
403403
CuBoolSize_t nvals
404404
);
405405

406+
/**
407+
* Reads matrix data to the host visible CPU buffer as an array of values pair.
408+
* The arrays must be provided by the user and the size of this arrays must
409+
* be greater or equal the values count of the matrix.
410+
*
411+
* @param instance An instance object reference to perform this operation
412+
* @param matrix Matrix handle to perform operation on
413+
* @param[in,out] rows Allocated buffer with row indices
414+
* @param[in,out] cols Allocated buffer with column indices
415+
* @param[in,out] nvals Total number of the pairs
416+
*
417+
* @return Error code on this operation
418+
*/
419+
CUBOOL_API CuBoolStatus CuBool_Matrix_ExtractPairs(
420+
CuBoolInstance instance,
421+
CuBoolMatrix matrix,
422+
CuBoolIndex_t* rows,
423+
CuBoolIndex_t* cols,
424+
CuBoolSize_t* nvals
425+
);
426+
406427
/**
407428
* Reads matrix data to the host visible CPU buffer as an array of values pair.
408429
* The indices of the i-th pair can be evaluated as (r=rows[i],c=cols[i]).
@@ -418,7 +439,7 @@ CUBOOL_API CuBoolStatus CuBool_Matrix_Build(
418439
*
419440
* @return Error code on this operation
420441
*/
421-
CUBOOL_API CuBoolStatus CuBool_Matrix_ExtractPairs(
442+
CUBOOL_API CuBoolStatus CuBool_Matrix_ExtractPairsExt(
422443
CuBoolInstance instance,
423444
CuBoolMatrix matrix,
424445
CuBoolIndex_t** rows,

python/pycubool/CuBoolWrapper/__init__.py

Lines changed: 0 additions & 88 deletions
This file was deleted.

python/pycubool/CuBoolWrapper/add.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

python/pycubool/CuBoolWrapper/codes.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

python/pycubool/CuBoolWrapper/ctypesWrapper.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

python/pycubool/CuBoolWrapper/matrix.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

python/pycubool/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from .wrapper import *
2+
3+
from .matrix import *
4+
from .add import *
5+
6+
# Setup global module state
7+
init_wrapper()

0 commit comments

Comments
 (0)