Skip to content

Commit 4efeff4

Browse files
committed
Update
1 parent 2f7487e commit 4efeff4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

onnxruntime/core/providers/webgpu/nn/im2col_matmul.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ namespace webgpu {
1212

1313
namespace {
1414

15+
// TODO: move to common header.
1516
template <typename T>
1617
inline T ceil_div(T numerator, T denominator) {
1718
return (numerator + denominator - 1) / denominator;
1819
}
1920

21+
// Chooses the optimal tile size (M, N) for the im2col operation.
22+
// This tile size is performance-tuned and varies depending on the target device.
2023
std::pair<uint32_t, uint32_t> ChooseTileSize(uint32_t im2col_m, uint32_t im2col_n) {
2124
// Define a list of preferred (tile_m, tile_n) pairs in descending order of preference.
2225
const std::vector<std::pair<uint32_t, uint32_t>> kTileSizes = {
@@ -41,7 +44,7 @@ std::pair<uint32_t, uint32_t> ChooseTileSize(uint32_t im2col_m, uint32_t im2col_
4144
return kTileSizes.back();
4245
}
4346

44-
// Add support for more devices and tile size configurations.
47+
// Add support for more devices.
4548
bool IsDeviceSupported(ComputeContext& context) {
4649
const wgpu::AdapterInfo& adapter_info = context.AdapterInfo();
4750

0 commit comments

Comments
 (0)