From e0da800a000d9030ca1f0c95075aa9b4d61bd5f0 Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Tue, 22 Aug 2023 22:10:27 -0700 Subject: [PATCH 1/3] use join --- shark/iree_utils/vulkan_target_env_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shark/iree_utils/vulkan_target_env_utils.py b/shark/iree_utils/vulkan_target_env_utils.py index 36cc7b397d..6b5e8ced16 100644 --- a/shark/iree_utils/vulkan_target_env_utils.py +++ b/shark/iree_utils/vulkan_target_env_utils.py @@ -57,9 +57,7 @@ def get_version(triple): @functools.cache def get_extensions(triple): def make_ext_list(ext_list): - res = "" - for e in ext_list: - res += e + ", " + res = ", ".join(ext_list) res = f"[{res[:-2]}]" return res From 52773bb39d547143c65055a04c44bac54a90ebae Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Wed, 6 Sep 2023 22:17:24 -0700 Subject: [PATCH 2/3] fix bug --- shark/iree_utils/vulkan_target_env_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shark/iree_utils/vulkan_target_env_utils.py b/shark/iree_utils/vulkan_target_env_utils.py index 6b5e8ced16..3664a1fe1c 100644 --- a/shark/iree_utils/vulkan_target_env_utils.py +++ b/shark/iree_utils/vulkan_target_env_utils.py @@ -57,7 +57,7 @@ def get_version(triple): @functools.cache def get_extensions(triple): def make_ext_list(ext_list): - res = ", ".join(ext_list) + res = ", ".join(ext_list) + ", " res = f"[{res[:-2]}]" return res From e637e8769edce19f4eafa9ca900136830a930d96 Mon Sep 17 00:00:00 2001 From: Dom <97384583+tosemml@users.noreply.github.com> Date: Thu, 7 Sep 2023 11:25:09 -0700 Subject: [PATCH 3/3] further code optimizations --- shark/iree_utils/vulkan_target_env_utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shark/iree_utils/vulkan_target_env_utils.py b/shark/iree_utils/vulkan_target_env_utils.py index 3664a1fe1c..d92dd6d9f2 100644 --- a/shark/iree_utils/vulkan_target_env_utils.py +++ b/shark/iree_utils/vulkan_target_env_utils.py @@ -57,9 +57,7 @@ def get_version(triple): @functools.cache def get_extensions(triple): def make_ext_list(ext_list): - res = ", ".join(ext_list) + ", " - res = f"[{res[:-2]}]" - return res + return ", ".join(ext_list) arch, product, os = triple if arch == "m1":