From b8c369d9c89b02d6517f6026c49d3063453fe999 Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:02:44 -0700 Subject: [PATCH] expose number of components --- onnxruntime/core/providers/webgpu/shader_variable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onnxruntime/core/providers/webgpu/shader_variable.h b/onnxruntime/core/providers/webgpu/shader_variable.h index d4281dd31d65c..71822a61f7a77 100644 --- a/onnxruntime/core/providers/webgpu/shader_variable.h +++ b/onnxruntime/core/providers/webgpu/shader_variable.h @@ -63,6 +63,9 @@ class ShaderVariable { // get the name of the variable. inline std::string_view Name() const { return name_; } + // get the number of components of the variable. + inline int NumComponents() const { return num_components_; } + // create a WGSL expression ({varname}_indices_t) for getting indices from offset. // \param offset: a WGSL expression (u32) representing the offset. inline std::string OffsetToIndices(std::string_view offset_expr) const;