MAINT: Add a debug variant to PyTorch (#30267)
* MAINT: Add a debug flag * MAINT: Apply suggestions from code review Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
parent
b41de6d86b
commit
3ade5516a2
@ -49,6 +49,7 @@ class PyTorch(PythonPackage, CudaPackage):
|
|||||||
|
|
||||||
# All options are defined in CMakeLists.txt.
|
# All options are defined in CMakeLists.txt.
|
||||||
# Some are listed in setup.py, but not all.
|
# Some are listed in setup.py, but not all.
|
||||||
|
variant('debug', default=False, description="Build with debugging support")
|
||||||
variant('caffe2', default=True, description='Build Caffe2', when='@1.7:')
|
variant('caffe2', default=True, description='Build Caffe2', when='@1.7:')
|
||||||
variant('test', default=False, description='Build C++ test binaries')
|
variant('test', default=False, description='Build C++ test binaries')
|
||||||
variant('cuda', default=not is_darwin, description='Use CUDA')
|
variant('cuda', default=not is_darwin, description='Use CUDA')
|
||||||
@ -343,6 +344,11 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False):
|
|||||||
enable_or_disable('gloo', newer=True)
|
enable_or_disable('gloo', newer=True)
|
||||||
enable_or_disable('tensorpipe')
|
enable_or_disable('tensorpipe')
|
||||||
|
|
||||||
|
if '+debug' in self.spec:
|
||||||
|
env.set('DEBUG', 'ON')
|
||||||
|
else:
|
||||||
|
env.set('DEBUG', 'OFF')
|
||||||
|
|
||||||
if '+onnx_ml' in self.spec:
|
if '+onnx_ml' in self.spec:
|
||||||
env.set('ONNX_ML', 'ON')
|
env.set('ONNX_ML', 'ON')
|
||||||
elif '~onnx_ml' in self.spec:
|
elif '~onnx_ml' in self.spec:
|
||||||
|
Loading…
Reference in New Issue
Block a user