[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
|
# path of .cpp and .so file
|
||||||
home = os.path.expanduser('~')
|
home = os.path.expanduser('~')
|
||||||
root = os.path.join(home, '.triton', 'torch', name)
|
root = os.path.join(home, '.triton', 'torch', name)
|
||||||
if not os.path.exists(root):
|
try:
|
||||||
os.makedirs(root)
|
os.makedirs(root)
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||||
so = os.path.join(root, f'op{suffix}')
|
so = os.path.join(root, f'op{suffix}')
|
||||||
cpp = os.path.join(root, f'op.cpp')
|
cpp = os.path.join(root, f'op.cpp')
|
||||||
|
Reference in New Issue
Block a user