Commit 124063e4 authored by rusty1s's avatar rusty1s
Browse files

clean up

parent 103ef0f2
......@@ -4,6 +4,5 @@ build/
dist/
.cache/
.eggs/
.coverage
*.egg-info/
*.so
.coverage
Copyright (c) 2018 Matthias Fey <matthias.fey@tu-dortmund.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
include LICENSE
include build.py
include build.sh
recursive-include torch_spline_conv/src *
recursive-include torch_spline_conv/kernel *
recursive-exclude torch_spline_conv/_ext *
# PyTorch Spline Convolution
# PyTorch Spline-Based Convolution Operator of SplineCNN
import subprocess
import torch
from torch.utils.ffi import create_extension
headers = ['torch_spline_conv/src/cpu.h']
......@@ -7,6 +10,16 @@ define_macros = []
extra_objects = []
with_cuda = False
if torch.cuda.is_available():
subprocess.call('./build.sh')
headers += ['torch_spline_conv/src/cuda.h']
sources += ['torch_spline_conv/src/cuda.c']
include_dirs += ['torch_spline_conv/kernel']
define_macros += [('WITH_CUDA', None)]
extra_objects += ['torch_spline_conv/build/kernel.so']
with_cuda = True
ffi = create_extension(
name='torch_spline_conv._ext.ffi',
package=True,
......
#!/bin/sh
echo "Compiling kernel..."
TORCH=$(python -c "import os; import torch; print(os.path.dirname(torch.__file__))")
SRC_DIR=torch_spline_conv/kernel
BUILD_DIR=torch_spline_conv/build
mkdir -p $BUILD_DIR
$(which nvcc) -c -o $BUILD_DIR/kernel.so $SRC_DIR/kernel.cu -arch=sm_35 -Xcompiler -fPIC -shared -I$TORCH/lib/include/TH -I$TORCH/lib/include/THC -I$SRC_DIR
[metadata]
description-file = README.md
[aliases]
test=pytest
......
from os import path as osp
from setuptools import setup, find_packages
import build # noqa
__version__ = '0.1.0'
url = 'https://github.com/rusty1s/pytorch_spline_conv'
install_requires = ['cffi']
install_requires = ['cffi', 'torch-unique']
setup_requires = ['pytest-runner', 'cffi']
tests_require = ['pytest', 'pytest-cov']
setup(
name='torch_spline_conv',
version='0.1.0',
description='PyTorch extension for spline-based convolutions',
url='https://github.com/rusty1s/pytorch_spline_conv',
version=__version__,
description='PyTorch Implementation of the Spline-Based Convolution'
'Operator of SplineCNN',
author='Matthias Fey',
author_email='matthias.fey@tu-dortmund.de',
url=url,
download_url='{}/archive/{}.tar.gz'.format(url, __version__),
keywords=[
'pytorch', 'cnn', 'spline_cnn', 'geometric-deep-learning', 'graph',
'mesh'
],
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
......
__version__ = '0.1.0'
__all__ = ['__version__']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment