Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ ${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
${layout_declare_ubo(B, "BufferMetadata", "outp")}
${layout_declare_ubo(B, "BufferMetadata", "inp")}

${layout_declare_ubo(B, "float", "scalar_value")}
layout(push_constant) uniform restrict Block {
float scalar_value;
};

layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ ${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
${layout_declare_ubo(B, "TextureMetadata", "outp")}
${layout_declare_ubo(B, "TextureMetadata", "inp")}

${layout_declare_ubo(B, "float", "scalar_value")}
layout(push_constant) uniform restrict Block {
float scalar_value;
};

layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;

Expand Down
5 changes: 4 additions & 1 deletion backends/vulkan/runtime/graph/ops/glsl/clone.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ layout(std430) buffer;

${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)}
${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
${layout_declare_ubo(B, "ivec3", "out_limits")}

layout(push_constant) uniform restrict Block {
ivec3 out_limits;
};

layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;

Expand Down
6 changes: 4 additions & 2 deletions backends/vulkan/runtime/graph/ops/glsl/softmax.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ layout(std430) buffer;
${layout_declare_tensor(B, "w", "tout", DTYPE, STORAGE)}
${layout_declare_tensor(B, "r", "tin", DTYPE, STORAGE)}

${layout_declare_ubo(B, "ivec3", "tout_limits")}
${layout_declare_ubo(B, "ivec4", "tin_sizes")}
layout(push_constant) uniform restrict Block {
ivec4 tin_sizes;
ivec3 tout_limits;
};

layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;

Expand Down
5 changes: 2 additions & 3 deletions backends/vulkan/runtime/graph/ops/impl/BinaryScalarOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void add_binary_scalar_op_node(

vkapi::ParamsBindList param_ubos = {
graph.meta_ubo(out),
graph.meta_ubo(in),
graph.create_params_buffer(scalar_val)};
graph.meta_ubo(in)};

graph.execute_nodes().emplace_back(new DynamicDispatchNode(
graph,
Expand All @@ -63,7 +62,7 @@ void add_binary_scalar_op_node(
// Shader params buffers
param_ubos,
// Push Constants
{},
{PushConstantDataInfo(&scalar_val, sizeof(scalar_val))},
// Specialization Constants
{},
// Resize Args
Expand Down
4 changes: 2 additions & 2 deletions backends/vulkan/runtime/graph/ops/impl/Clone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ void add_clone_node(
// Inputs and Outputs
{{out, vkapi::kWrite}, {in, vkapi::kRead}},
// Parameter Buffers
{graph.logical_limits_ubo(out)},
// Push Constants
{},
// Push Constants
{graph.logical_limits_pc_of(out)},
// Specialization Constants
{},
// Resize Args
Expand Down
4 changes: 2 additions & 2 deletions backends/vulkan/runtime/graph/ops/impl/Softmax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void add_softmax_node(
// Inputs and Outputs
{{out, vkapi::kWrite}, {in, vkapi::kRead}},
// Shader params buffers
{graph.logical_limits_ubo(out), graph.sizes_ubo(in)},
// Push Constants
{},
// Push Constants
{graph.sizes_pc_of(in), graph.logical_limits_pc_of(out)},
// Specialization Constants
{graph.packed_dim_of(out), reduce_dim_xyz, group_dim},
// Resize Args
Expand Down
Loading