Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow expression of scalar tensor buffers, non string values in variants #4292

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions backends/vulkan/runtime/gen_vulkan_spv.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def layout_declare_tensor(
var_name: str,
dtype: str,
storage_type: str,
is_scalar_array: bool = False,
precision: str = "PRECISION",
) -> str:
assert storage_type.lower() in ["buffer", "texture3d", "texture2d"]
Expand All @@ -242,7 +243,12 @@ def layout_declare_tensor(
# Create buffer binding
if storage_type.lower() == "buffer":
return layout_declare_buffer(
slot, access_type, var_name, dtype, precision, is_scalar_array=False
slot,
access_type,
var_name,
dtype,
precision,
is_scalar_array=is_scalar_array,
)

# Create image/sampler binding
Expand Down Expand Up @@ -533,7 +539,7 @@ def generateVariantCombinations(
curr_suffix = (
suffix + "_" + str(i) if suffix else str(i)
)
param_values.append((param_name, curr_suffix, str(i)))
param_values.append((param_name, curr_suffix, i))
else:
raise ValueError(
f"{value['RANGE']} is not a valid range. Must be in format [start, end] (inclusive)."
Expand Down Expand Up @@ -595,7 +601,7 @@ def parseTemplateYaml(self, yaml_file: str) -> None:
variant_name = variant["NAME"]
for param_value in combination:
default_params_copy[param_value[0]] = param_value[2]
if len(param_value[1]) > 0:
if len(str(param_value[1])) > 0:
variant_name = f"{variant_name}_{param_value[1]}"

default_params_copy["NAME"] = variant_name
Expand Down
Loading