@@ -29,7 +29,9 @@ struct LogSoftmaxParams {
2929 uint32_t inner;
3030 uint32_t pad_;
3131};
32- static_assert (sizeof (LogSoftmaxParams) == 16 , " LogSoftmaxParams must be 16 bytes" );
32+ static_assert (
33+ sizeof (LogSoftmaxParams) == 16 ,
34+ " LogSoftmaxParams must be 16 bytes" );
3335
3436// Decompose dims into [outer, R, inner] for a reduction along `dim`.
3537void decompose (
@@ -85,7 +87,8 @@ void log_softmax_impl(WebGPUGraph& graph, const std::vector<int>& args) {
8587 for (int64_t d : in.dims ) {
8688 numel *= static_cast <uint64_t >(d);
8789 }
88- if (in.nbytes != numel * sizeof (float ) || out.nbytes != numel * sizeof (float )) {
90+ if (in.nbytes != numel * sizeof (float ) ||
91+ out.nbytes != numel * sizeof (float )) {
8992 throw std::runtime_error (
9093 " WebGPU log_softmax: fp32-only (byte-size mismatch)" );
9194 }
@@ -205,7 +208,9 @@ void log_softmax_impl(WebGPUGraph& graph, const std::vector<int>& args) {
205208 wgpuQueueWriteBuffer (g.queue (), params_buf, 0 , &p, sizeof (p));
206209 g.dispatch_at (dispatch_idx).workgroup_count_x =
207210 utils::compute_1d_workgroup_count (
208- g.device (), static_cast <uint32_t >(live_lines), wg_size,
211+ g.device (),
212+ static_cast <uint32_t >(live_lines),
213+ wg_size,
209214 " log_softmax(resize)" );
210215 g.set_cur_dims (out_id, std::vector<int64_t >(d.begin (), d.end ()));
211216 });
0 commit comments