[PYTHON][KERNEL] Better handling of case where cache directory already
exists
This commit is contained in:
committed by
Philippe Tillet
parent
5943baa53f
commit
94e8ee7f01
@@ -123,8 +123,10 @@ def _make_framework_op(arg_types):
|
||||
# path of .cpp and .so file
|
||||
home = os.path.expanduser('~')
|
||||
root = os.path.join(home, '.triton', 'torch', name)
|
||||
if not os.path.exists(root):
|
||||
try:
|
||||
os.makedirs(root)
|
||||
except FileExistsError:
|
||||
pass
|
||||
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
so = os.path.join(root, f'op{suffix}')
|
||||
cpp = os.path.join(root, f'op.cpp')
|
||||
|
Reference in New Issue
Block a user