Skip to content

Commit 02d63b1

Browse files
add more code
1 parent 45351cb commit 02d63b1

File tree

10 files changed

+151
-3
lines changed

10 files changed

+151
-3
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
.venv/
2-
.vscode/
3-
CMakeLists.txt
42
build/
53
bin/
64
temp/

.vscode/c_cpp_properties.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${workspaceFolder}/**",
7+
"${workspaceFolder}/.venv/lib/python3.10/site-packages/pybind11/include/**",
8+
"/usr/include/python3.10/**",
9+
"${workspaceFolder}/tensor-array-repo/Tensor-Array/src/**"
10+
],
11+
"defines": [],
12+
"compilerPath": "/usr/bin/g++"
13+
}
14+
],
15+
"version": 4
16+
}

.vscode/settings.json

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"files.associations": {
3+
"initializer_list": "cpp",
4+
"array": "cpp",
5+
"atomic": "cpp",
6+
"bit": "cpp",
7+
"*.tcc": "cpp",
8+
"cctype": "cpp",
9+
"chrono": "cpp",
10+
"clocale": "cpp",
11+
"cmath": "cpp",
12+
"compare": "cpp",
13+
"complex": "cpp",
14+
"concepts": "cpp",
15+
"condition_variable": "cpp",
16+
"cstdarg": "cpp",
17+
"cstddef": "cpp",
18+
"cstdint": "cpp",
19+
"cstdio": "cpp",
20+
"cstdlib": "cpp",
21+
"cstring": "cpp",
22+
"ctime": "cpp",
23+
"cwchar": "cpp",
24+
"cwctype": "cpp",
25+
"deque": "cpp",
26+
"forward_list": "cpp",
27+
"string": "cpp",
28+
"unordered_map": "cpp",
29+
"unordered_set": "cpp",
30+
"vector": "cpp",
31+
"exception": "cpp",
32+
"algorithm": "cpp",
33+
"functional": "cpp",
34+
"iterator": "cpp",
35+
"memory": "cpp",
36+
"memory_resource": "cpp",
37+
"numeric": "cpp",
38+
"optional": "cpp",
39+
"random": "cpp",
40+
"ratio": "cpp",
41+
"string_view": "cpp",
42+
"system_error": "cpp",
43+
"tuple": "cpp",
44+
"type_traits": "cpp",
45+
"utility": "cpp",
46+
"iosfwd": "cpp",
47+
"istream": "cpp",
48+
"limits": "cpp",
49+
"mutex": "cpp",
50+
"new": "cpp",
51+
"numbers": "cpp",
52+
"ostream": "cpp",
53+
"semaphore": "cpp",
54+
"sstream": "cpp",
55+
"stdexcept": "cpp",
56+
"stop_token": "cpp",
57+
"streambuf": "cpp",
58+
"thread": "cpp",
59+
"cinttypes": "cpp",
60+
"typeindex": "cpp",
61+
"typeinfo": "cpp",
62+
"codecvt": "cpp",
63+
"iomanip": "cpp",
64+
"iostream": "cpp",
65+
"list": "cpp",
66+
"map": "cpp",
67+
"set": "cpp",
68+
"valarray": "cpp",
69+
"variant": "cpp"
70+
},
71+
"python.REPL.enableREPLSmartSend": false
72+
}

.vscode/tasks.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"version": "2.0.0",
3+
"options": {
4+
"cwd": "${workspaceFolder}/build"
5+
},
6+
"tasks": [
7+
{
8+
"label": "cmake",
9+
"command": "cmake",
10+
"args": [
11+
".."
12+
]
13+
},
14+
{
15+
"label": "make",
16+
"command": "make"
17+
},
18+
{
19+
"label": "cmake build",
20+
"dependsOn": [
21+
"cmake",
22+
"make"
23+
],
24+
"problemMatcher": [
25+
"$nvcc"
26+
]
27+
}
28+
]
29+
}

CMakeLists.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cmake_minimum_required(VERSION 3.18.0)
2+
find_package(Python COMPONENTS Interpreter Development)
3+
if (${Python_FOUND})
4+
5+
project(TensorArray_Python VERSION 0.1.0 LANGUAGES C CXX)
6+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/lib)
7+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/src/tensor_array/core)
8+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/bin)
9+
10+
include(CTest)
11+
enable_testing()
12+
13+
add_subdirectory("tensor-array-repo/Tensor-Array" EXCLUDE_FROM_ALL)
14+
add_library(tensor2 SHARED scripts/cpp/tensor_bind.cc)
15+
16+
target_include_directories(
17+
tensor2
18+
PRIVATE "${CMAKE_CURRENT_LIST_DIR}/.venv/lib/python3.10/site-packages/pybind11/include"
19+
PRIVATE "${CMAKE_CURRENT_LIST_DIR}/tensor-array-repo/Tensor-Array/src"
20+
PRIVATE ${Python_INCLUDE_DIRS}
21+
)
22+
23+
SET_TARGET_PROPERTIES(tensor2 PROPERTIES PREFIX "")
24+
25+
target_link_libraries(tensor2 PUBLIC TensorArray::Core)
26+
27+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
28+
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
29+
include(CPack)
30+
31+
install(TARGETS tensor2 LIBRARY DESTINATION /src/tensor_array/core ARCHIVE DESTINATION lib)
32+
endif()
33+
-13.5 MB
Binary file not shown.

src/tensor_array/core/tensor2.so

0 Bytes
Binary file not shown.

tests/__init__.py

Whitespace-only changes.
File renamed without changes.

0 commit comments

Comments
 (0)