summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJen Herting <jen@herting.cc>2020-08-31 11:10:21 -0400
committerGitHub <noreply@github.com>2020-08-31 10:10:21 -0500
commit47ef8d9deb53b841b80c60378d0d1c9fd958bb61 (patch)
tree2ed0dedfc86839fd404152fdfd3dc08ce986d6a4 /var
parentf4a37b2dc2d89d1da0b62c23466775d9d089a5bb (diff)
downloadspack-47ef8d9deb53b841b80c60378d0d1c9fd958bb61.tar.gz
spack-47ef8d9deb53b841b80c60378d0d1c9fd958bb61.tar.bz2
spack-47ef8d9deb53b841b80c60378d0d1c9fd958bb61.tar.xz
spack-47ef8d9deb53b841b80c60378d0d1c9fd958bb61.zip
New package: py-torch-spline-conv (#18273)
* [py-torch-spline-conv] created template * [py-torch-spline-conv] specified version of python * [py-torch-spline-conv] extends py-torch-cluster * [py-torch-spline-conv] setting TORCH_CUDA_ARCH_LIST * [py-torch-spline-conv] limiting extension to py-torch * [py-torch-spline-conv] added cuda variant and setting env vars * [py-torch-spline-conv] added homepage and description. removed fixmes * [py-torch-spline-conv] added variant cuda * [py-torch-spline-conv] flake8 * [py-torch-spline-conv] added variant description * [py-torch-spline-conv] extends -> depends_on * [py-torch-spline-conv] added dependencies py-setuptools and py-pytorch-runner
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/py-torch-spline-conv/package.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py
new file mode 100644
index 0000000000..5806f3e958
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-torch-spline-conv/package.py
@@ -0,0 +1,37 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class PyTorchSplineConv(PythonPackage):
+ """This is a PyTorch implementation of the spline-based
+ convolution operator of SplineCNN."""
+
+ homepage = "https://github.com/rusty1s/pytorch_spline_conv"
+ url = "https://github.com/rusty1s/pytorch_spline_conv/archive/1.2.0.tar.gz"
+
+ version('1.2.0', sha256='ab8da41357c8a4785662366655bb6dc5e84fd0e938008194955409aefe535009')
+
+ variant('cuda', default=False, description="Enable CUDA support")
+
+ depends_on('python@3.6:', type=('build', 'run'))
+ depends_on('py-setuptools', type='build')
+ depends_on('py-pytest-runner', type='build')
+ depends_on('py-torch+cuda', when='+cuda')
+ depends_on('py-torch~cuda', when='~cuda')
+
+ def setup_build_environment(self, env):
+ if '+cuda' in self.spec:
+ cuda_arches = list(
+ self.spec['py-torch'].variants['cuda_arch'].value)
+ for i, x in enumerate(cuda_arches):
+ cuda_arches[i] = '{0}.{1}'.format(x[0:-1], x[-1])
+ env.set('TORCH_CUDA_ARCH_LIST', str.join(' ', cuda_arches))
+
+ env.set('FORCE_CUDA', '1')
+ env.set('CUDA_HOME', self.spec['cuda'].prefix)
+ else:
+ env.set('FORCE_CUDA', '0')