From 0fa0584fd347a76119dca42170a362b3ac721817 Mon Sep 17 00:00:00 2001 From: Dun Liang Date: Fri, 1 Oct 2021 19:41:04 +0800 Subject: [PATCH] polish files and add cuda arch hint --- python/jittor/__init__.py | 2 +- python/jittor/compiler.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/jittor/__init__.py b/python/jittor/__init__.py index 48b65be4..0fbbe3b2 100644 --- a/python/jittor/__init__.py +++ b/python/jittor/__init__.py @@ -9,7 +9,7 @@ # file 'LICENSE.txt', which is part of this source code package. # *************************************************************** -__version__ = '1.3.0.1' +__version__ = '1.3.0.2' from jittor_utils import lock with lock.lock_scope(): ori_int = int diff --git a/python/jittor/compiler.py b/python/jittor/compiler.py index ba229216..34e6b3fb 100644 --- a/python/jittor/compiler.py +++ b/python/jittor/compiler.py @@ -1259,7 +1259,7 @@ if use_data_gz: .replace("-shared", "") vdp = os.path.join(jittor_path, "src", "utils", "vdp") run_cmd(fix_cl_flags(f"{cc_path} {dflags} -include {vdp} {data_s_path} -c -o {data_o_path}")) - # os.remove(data_s_path) + os.remove(data_s_path) with open(data_gz_md5_path, 'w') as f: f.write(md5) files.append(data_o_path) @@ -1280,6 +1280,12 @@ flags = core.flags() if has_cuda: nvcc_flags = convert_nvcc_flags(cc_flags) if len(flags.cuda_archs): + archs = [] + for arch in flags.cuda_archs: + if arch<50: + LOG.w(f"CUDA arch({arch})<50 is not supported") + continue + archs.append(arch) nvcc_flags += f" -arch=compute_{min(flags.cuda_archs)} " nvcc_flags += ''.join(map(lambda x:f' -code=sm_{x} ', flags.cuda_archs))