Skip to content

Commit 13beb83

Browse files
committed
Including pointcept as a submodule, refactor point transformer v3
Signed-off-by: Christopher Horvath <[email protected]>
1 parent dee1714 commit 13beb83

31 files changed

+1873
-234
lines changed

.clang-format

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
Language: Cpp
3+
Standard: c++20
4+
5+
# Indentation
6+
TabWidth: 4
7+
IndentWidth: 4
8+
UseTab: Never
9+
IndentPPDirectives: None
10+
IndentWrappedFunctionNames: false
11+
NamespaceIndentation: None
12+
13+
# Empty lines
14+
KeepEmptyLinesAtTheStartOfBlocks: false
15+
MaxEmptyLinesToKeep: 1
16+
17+
# Line length
18+
ColumnLimit: 100
19+
20+
# Line endings
21+
DeriveLineEnding: false
22+
LineEnding: LF
23+
24+
# Breaking and Penalties
25+
BreakBeforeBinaryOperators: None
26+
BreakBeforeBraces: Attach
27+
BreakBeforeTernaryOperators: true
28+
BreakConstructorInitializersBeforeComma: false
29+
BreakInheritanceList: BeforeColon
30+
BreakStringLiterals: false
31+
32+
PenaltyBreakAssignment: 2
33+
PenaltyBreakBeforeFirstCallParameter: 19
34+
PenaltyBreakComment: 300
35+
PenaltyBreakFirstLessLess: 120
36+
PenaltyBreakString: 1000
37+
PenaltyExcessCharacter: 1000000
38+
PenaltyReturnTypeOnItsOwnLine: 60
39+
40+
# Spacing and padding
41+
SpaceAfterCStyleCast: false
42+
SpaceAfterTemplateKeyword: true
43+
SpaceAfterLogicalNot: false
44+
SpaceAfterControlStatementKeyword: true
45+
SpaceBeforeAssignmentOperators: true
46+
SpaceBeforeParens: ControlStatements
47+
SpaceBeforeRangeBasedForLoopColon: false
48+
SpaceInEmptyParentheses: false
49+
SpacesInAngles: false
50+
SpacesInContainerLiterals: false
51+
SpacesInCStyleCastParentheses: false
52+
SpacesInParentheses: false
53+
SpacesBeforeTrailingComments: 1
54+
SpaceBeforeCpp11BracedList: false
55+
SpaceBeforeCtorInitializerColon: true
56+
SpaceBeforeInheritanceColon: true
57+
SpaceBeforeSquareBrackets: false
58+
SpacesInSquareBrackets: false
59+
SpaceBeforeCaseColon: false
60+
61+
# Brace placement
62+
BraceWrapping:
63+
AfterClass: false
64+
AfterControlStatement: false
65+
AfterEnum: false
66+
AfterFunction: false
67+
AfterNamespace: false
68+
AfterStruct: false
69+
AfterUnion: false
70+
BeforeCatch: false
71+
BeforeElse: false
72+
IndentBraces: false
73+
SplitEmptyFunction: false
74+
SplitEmptyRecord: false
75+
SplitEmptyNamespace: false
76+
Cpp11BracedListStyle: true
77+
78+
# Function definitions
79+
# BreakAfterReturnType: AllDefinitions
80+
AlwaysBreakAfterDefinitionReturnType: All
81+
82+
AttributeMacros:
83+
- __host__
84+
- __device__
85+
- __hostdev__
86+
- __global__
87+
- __forceinline__
88+
- __shared__
89+
- __launch_bounds__
90+
91+
# Alignment
92+
AlignConsecutiveAssignments: true
93+
AlignConsecutiveBitFields: true
94+
AlignConsecutiveDeclarations: false
95+
AlignConsecutiveMacros: true
96+
AlignEscapedNewlines: Left
97+
AlignOperands: true
98+
AlignTrailingComments:
99+
Kind: Always
100+
OverEmptyLines: 2
101+
102+
# Single line allowances
103+
BinPackParameters: false
104+
BinPackArguments: false
105+
AllowAllArgumentsOnNextLine: true
106+
AllowAllConstructorInitializersOnNextLine: true
107+
AllowAllParametersOfDeclarationOnNextLine: true
108+
AllowShortBlocksOnASingleLine: true
109+
AllowShortCaseLabelsOnASingleLine: true
110+
AllowShortEnumsOnASingleLine: true
111+
AllowShortFunctionsOnASingleLine: Inline
112+
AllowShortIfStatementsOnASingleLine: false
113+
AllowShortLambdasOnASingleLine: true
114+
AllowShortLoopsOnASingleLine: false
115+
116+
# Sorting
117+
IncludeBlocks: Regroup
118+
IncludeIsMainRegex: "$"
119+
IncludeCategories:
120+
- Regex: '^<pybind11/' # pybind11 includes
121+
Priority: 0
122+
- Regex: '^"' # quoted includes
123+
Priority: 1
124+
- Regex: '^<fvdb/' # fvdb includes
125+
Priority: 2
126+
- Regex: '^<nanovdb/' # nanovdb includes
127+
Priority: 3
128+
- Regex: '^<(torch|c10|THC|ATen)/' # torch includes
129+
Priority: 4
130+
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
131+
Priority: 5
132+
- Regex: '^<(cooperative_groups|cuco|cuda.h|cuda_|device_types|math_constants|nvtx3|cute)' # CUDA includes
133+
Priority: 6
134+
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
135+
Priority: 7
136+
- Regex: '^<[^.]+' # STL includes (no '.')
137+
Priority: 8
138+
IncludeIsMainSourceRegex: "$"
139+
SortIncludes: true
140+
SortUsingDeclarations: true
141+

.clang-format-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore all submodules in external directories
2+
**/external/**
3+

.clangd

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# https://clangd.llvm.org/config
2+
3+
# Apply a config conditionally to all C files
4+
If:
5+
PathMatch: .*\.(c|h)$
6+
7+
---
8+
9+
# Apply a config conditionally to all C++ files
10+
If:
11+
PathMatch: .*\.(c|h)pp
12+
13+
---
14+
15+
# Apply a config conditionally to all CUDA files
16+
If:
17+
PathMatch: .*\.cuh?
18+
CompileFlags:
19+
Add:
20+
- "-x"
21+
- "cuda"
22+
# No error on unknown CUDA versions
23+
- "-Wno-unknown-cuda-version"
24+
# Allow variadic CUDA functions
25+
- "-Xclang=-fcuda-allow-variadic-functions"
26+
Diagnostics:
27+
Suppress:
28+
- "variadic_device_fn"
29+
- "attributes_not_allowed"
30+
- "unknown_cuda_version"
31+
- "unknown_type_name"
32+
- "implicit_return_from_non_void_function"
33+
- "no_template_args_on_forwarding_function"
34+
35+
---
36+
37+
# Tweak the clangd parse settings for all files
38+
CompileFlags:
39+
Add:
40+
# report all errors
41+
- "-ferror-limit=0"
42+
- "-fmacro-backtrace-limit=0"
43+
- "-ftemplate-backtrace-limit=0"
44+
# Skip the CUDA version check
45+
- "--no-cuda-version-check"
46+
Remove:
47+
# remove gcc's -fcoroutines
48+
- -fcoroutines
49+
# remove nvc++ flags unknown to clang
50+
- "-gpu=*"
51+
- "-stdpar*"
52+
# remove nvcc flags unknown to clang
53+
- "-arch*"
54+
- "-gencode*"
55+
- "--generate-code*"
56+
- "-ccbin*"
57+
- "-t=*"
58+
- "--threads*"
59+
- "-Xptxas*"
60+
- "-Xcudafe*"
61+
- "-Xfatbin*"
62+
- "-Xcompiler*"
63+
- "--diag-suppress*"
64+
- "--diag_suppress*"
65+
- "--compiler-options*"
66+
- "--extended-lambda"
67+
- "--expt-extended-lambda"
68+
- "--expt-relaxed-constexpr"
69+
- "-forward-unknown-to-host-compiler"
70+
- "-Werror=cross-execution-space-call"
71+
- "-Werror=all-warnings"
72+
- "-G"

.github/workflows/codestyle.yml

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,46 @@ jobs:
2020
- uses: actions/checkout@v4
2121
- uses: psf/black@stable
2222
with:
23-
options: "--check --verbose --target-version=py311 --line-length=120"
24-
src: "./"
23+
options: "--check --verbose --target-version=py311 --line-length=120 --extend-exclude '.*/external/.*'"
24+
src: "point_transformer_v3"
2525
version: "~= 24.0"
2626

27-
# NOTE: Enable this when/if we have C++ code
28-
# test-cpp-clang-format-lint:
29-
# name: Check C++ code style with clang-format
30-
# runs-on: ubuntu-latest
31-
# steps:
32-
# - uses: actions/checkout@v4
33-
# - uses: DoozyX/[email protected]
34-
# with:
35-
# extensions: 'h,cpp,cc,cu,cuh'
36-
# clangFormatVersion: 18
37-
# style: file
27+
test-cpp-clang-format-lint:
28+
name: Check C++ code style with clang-format
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
# TODO: Re-enable when C++ files are present
33+
# - uses: DoozyX/[email protected]
34+
# with:
35+
# extensions: 'h,cpp,cc,cu,cuh'
36+
# clangFormatVersion: 18
37+
# style: file
38+
# exclude: '**/external/**'
39+
- name: Placeholder - always succeed
40+
run: echo "clang-format check placeholder - always succeeds"
3841

3942
include-guards:
4043
name: Check include guards
4144
runs-on: ubuntu-latest
4245
steps:
4346
- uses: actions/checkout@v4
44-
- uses: swahtz/include-guards-check-action@master
47+
# TODO: Re-enable when C++ header files are present
48+
# - uses: swahtz/include-guards-check-action@master
49+
# with:
50+
# exclude: '**/external/**'
51+
- name: Placeholder - always succeed
52+
run: echo "include-guards check placeholder - always succeeds"
4553

4654
check-spdx-identifiers:
4755
name: Check SPDX identifiers
4856
runs-on: ubuntu-latest
4957
steps:
5058
- name: checkout
5159
uses: actions/checkout@v4
52-
- uses: enarx/spdx@master
53-
with:
54-
licenses: |-
55-
Apache-2.0
56-
MIT
60+
- name: Check SPDX headers
61+
run: |
62+
python3 point_transformer_v3/scripts/check_spdx.py
5763
5864
# Search the git repository for any trailing spaces excluding auto-generated wlt files
5965
# NOTE: Migrated from openvdb whitespace.yml
@@ -64,7 +70,7 @@ jobs:
6470
- name: test
6571
run: |
6672
set +e
67-
git grep -n -I -E '^.+[ ]+$' -- ':!*.wlt'
73+
git grep -n -I -E '^.+[ ]+$' -- point_transformer_v3 ':!**/external/**' ':!*.wlt'
6874
test $? -eq 1
6975
7076
# Search for any tabs excluding meeting notes, image files and a few others
@@ -76,5 +82,5 @@ jobs:
7682
- name: test
7783
run: |
7884
set +e
79-
git grep -n " " -- ':!*/codestyle.yml' ':!*.svg' ':!*.cmd' ':!*.png' ':!*.wlt' ':!*.jpg' ':!*.gif' ':!*.mp4' ':!*.pt' ':!*.pth' ':!*.nvdb' ':!*.npz' ':!*.gitmodules'
85+
git grep -n -I " " -- point_transformer_v3 ':!**/external/**' ':!*/codestyle.yml' ':!*.svg' ':!*.cmd' ':!*.png' ':!*.wlt' ':!*.jpg' ':!*.gif' ':!*.mp4' ':!*.pt' ':!*.pth' ':!*.nvdb' ':!*.npz' ':!*.gitmodules'
8086
test $? -eq 1

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Generated version file
2+
fvdb/version.py
3+
4+
# Generated compile_commands.json symlink
5+
compile_commands.json
6+
7+
# Top-level build files
8+
/build/*
9+
10+
# Top-level directories
11+
dist
12+
.cache
13+
.idea
14+
.eggs
15+
cmake-build-debug
16+
external
17+
trash
18+
scratch
19+
_build
20+
releases/
21+
/data/
22+
/data/*
23+
lightning_logs
24+
logs
25+
26+
# Top-level config files
27+
.polyscope.ini
28+
imgui.ini
29+
.vscode/launch.json
30+
31+
# Python
32+
__pycache__/
33+
*.py[cod]
34+
*$py.class
35+
*.so
36+
.Python
37+
*.egg-info/
38+
*.egg
39+
.pytest_cache/
40+
.mypy_cache/
41+
.dmypy.json
42+
dmypy.json
43+
.coverage
44+
htmlcov/
45+
.tox/
46+
.venv/
47+
venv/
48+
env/
49+
ENV/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "point_transformer_v3/pointcept_minimal"]
2+
path = point_transformer_v3/external/pointcept
3+
url = https://github.com/Pointcept/Pointcept.git

.vscode/c_cpp_properties.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Linux",
5+
"includePath": [
6+
"${env:CONDA_PREFIX}/envs/fvdb/include",
7+
"${env:CONDA_PREFIX}/envs/fvdb/targets/x86_64-linux/include/",
8+
"${env:CONDA_PREFIX}/envs/fvdb/include/python3.11",
9+
"${env:CONDA_PREFIX}/envs/fvdb/lib/python3.11/site-packages/torch/include",
10+
"${env:CONDA_PREFIX}/envs/fvdb/lib/python3.11/site-packages/torch/include/torch/csrc/api/include",
11+
"${env:CONDA_PREFIX}/envs/fvdb/lib/python3.11/site-packages/torch/include/THC",
12+
"${env:CONDA_PREFIX}/envs/fvdb/lib/python3.11/site-packages/torch/include/c10",
13+
"${default}"
14+
],
15+
"macFrameworkPath": [
16+
"${default}"
17+
],
18+
"defines": [
19+
"${default}",
20+
"NDEVELOP_IDE_ONLY",
21+
"__CUDA_ARCH__=800"
22+
],
23+
"forcedInclude": [
24+
"${default}"
25+
],
26+
"compileCommands": "${default}",
27+
"browse": {
28+
"limitSymbolsToIncludedHeaders": true,
29+
"databaseFilename": "${default}",
30+
"path": [
31+
"${default}"
32+
]
33+
},
34+
"intelliSenseMode": "${default}",
35+
"cStandard": "${default}",
36+
"cppStandard": "c++20",
37+
"compilerPath": "${default}",
38+
"configurationProvider": "ms-vscode.cpptools"
39+
}
40+
],
41+
"version": 4
42+
}

0 commit comments

Comments
 (0)