@triton.jit
def _to_transposable_sparse_semi_structured_kernel(dense_ptr, sparse_ptr,
    mask_raw_ptr, mask_ptr, dense_row_stride, dense_col_stride,
    sparse_row_stride, sparse_col_stride, mask_raw_row_stride,
    mask_raw_col_stride, mask_row_stride, mask_col_stride, m, k, n, abs,
    BLOCK_SIZE: tl.constexpr):
    row_idx = tl.program_id(0) * 32 + (tl.arange(0, 128) // 16 * 4)[None, :
        ] + (tl.arange(0, 16) // 4)[:, None]
    col_idx = tl.program_id(1) * 64 + (tl.arange(0, 128) % 16 * 4)[None, :] + (
        tl.arange(0, 16) % 4)[:, None]
    dense = tl.load(dense_ptr + row_idx * dense_row_stride + col_idx *
        dense_col_stride)
    mask_raw = tl.load(mask_raw_ptr + tl.arange(0, 16)[None, :] *
        mask_raw_col_stride + tl.arange(0, BLOCK_SIZE)[:, None] *
        mask_raw_row_stride, mask=tl.arange(0, BLOCK_SIZE)[:, None] < n,
        other=0)
    sum = tl.dot(mask_raw, tl.abs(dense)) if abs else tl.dot(mask_raw, dense)
    sum = tl.where(tl.arange(0, BLOCK_SIZE)[:, None] < n, sum, -float('inf'))
    max = tl.argmax(sum, 0)
    mask_idx = max[None, :] * 16 + tl.arange(0, 16)[:, None]
    mask = tl.load(mask_raw_ptr + mask_idx).to(tl.int1)
    tl.store(sparse_ptr + row_idx * sparse_row_stride + col_idx *
        sparse_col_stride, dense, mask=mask)
    tl.store(mask_ptr + row_idx * mask_row_stride + col_idx *
        mask_col_stride, mask)
