File tree 2 files changed +3
-8
lines changed
2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 9
9
raise FileNotFoundError ('LLVM not found, you can install it with `winget install LLVM.LLVM` or point at a custom dll with LLVM_PATH' )
10
10
elif OSX :
11
11
# Will raise FileNotFoundError if brew is not installed
12
- brew_prefix = subprocess .check_output (['brew' , '--prefix' , 'llvm' ]).decode ().strip ()
13
12
# `brew --prefix` will return even if formula is not installed
14
- if not os .path .exists (brew_prefix ):
13
+ if not os .path .exists (brew_prefix := subprocess . check_output ([ 'brew' , '--prefix' , 'llvm' ]). decode (). strip () ):
15
14
raise FileNotFoundError ('LLVM not found, you can install it with `brew install llvm`' )
16
15
LLVM_PATH : str | None = os .path .join (brew_prefix , 'lib' , 'libLLVM.dylib' )
17
16
else :
Original file line number Diff line number Diff line change 2
2
from tinygrad .helpers import OSX
3
3
4
4
if OSX :
5
- brew_prefix = subprocess .check_output (['brew' , '--prefix' , 'dawn' ]).decode ().strip ()
6
-
7
- if not os .path .exists (brew_prefix ):
5
+ if not os .path .exists (brew_prefix := subprocess .check_output (['brew' , '--prefix' , 'dawn' ]).decode ().strip ()):
8
6
raise FileNotFoundError ('dawn library not found. Install it with `brew tap wpmed92/dawn && brew install dawn`' )
9
7
WEBGPU_PATH : str | None = os .path .join (brew_prefix , 'lib' , 'libwebgpu_dawn.dylib' )
10
8
else :
11
- WEBGPU_PATH = ctypes .util .find_library ('webgpu_dawn' )
12
-
13
- if WEBGPU_PATH is None :
9
+ if (WEBGPU_PATH := ctypes .util .find_library ('webgpu_dawn' )) is None :
14
10
raise FileNotFoundError ("dawn library not found. " +
15
11
"Install it with `sudo curl -L https://github.com/wpmed92/pydawn/releases/download/v0.1.6/libwebgpu_dawn.so -o /usr/lib/libwebgpu_dawn.so`" )
You can’t perform that action at this time.
0 commit comments