py-torch: set INTEL_MKL_DIR (#29613)

Add the INTEL_MKL_DIR variable so py-torch can find mkl if provided by
intel-oneapi-mkl.
This commit is contained in:
Glenn Johnson 2022-03-20 10:35:18 -05:00 committed by GitHub
parent d349677dcb
commit c6b69a8244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -360,6 +360,11 @@ def enable_or_disable(variant, keyword='USE', var=None, newer=False):
'intel-mkl', 'intel-parallel-studio', 'intel-oneapi-mkl']:
env.set('BLAS', 'MKL')
env.set('WITH_BLAS', 'mkl')
# help find MKL
if self.spec['mkl'].name == 'intel-oneapi-mkl':
env.set('INTEL_MKL_DIR', self.spec['mkl'].prefix.mkl.latest)
else:
env.set('INTEL_MKL_DIR', self.spec['mkl'].prefix.mkl)
elif self.spec['blas'].name == 'openblas':
env.set('BLAS', 'OpenBLAS')
env.set('WITH_BLAS', 'open')