Skip to content

Commit 0e6d387

Browse files
authored
Check if ocloc in PATH before using it (#3212)
Part of #3177. When running with pip dependencies, `ocloc` may not be present in `PATH`. Signed-off-by: Anatoly Myachev <[email protected]>
1 parent fa341e9 commit 0e6d387

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third_party/intel/backend/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def parse_target(self, tgt_prop) -> dict:
156156
dev_prop['has_bfloat16_conversions'] = tgt_prop.get('has_bfloat16_conversions', True)
157157

158158
device_arch = self.parse_device_arch(tgt_prop.get('architecture', 0))
159-
if device_arch:
159+
if device_arch and shutil.which('ocloc'):
160160
if device_arch in self.device_props:
161161
dev_prop.update(self.device_props[device_arch])
162162
return dev_prop

0 commit comments

Comments
 (0)