Skip to content

Commit

Permalink
Compute gridSize properly instead of hard-coding.
Browse files Browse the repository at this point in the history
  • Loading branch information
whchung committed Sep 24, 2020
1 parent 0bb3f1b commit a81d05c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mlir/lib/Dialect/MIOpen/Transforms/AffixTuningParameters.cpp
Expand Up @@ -164,9 +164,11 @@ void AffixTuningParameters::affixTuningParametersImpl(T &op) {
validParams.gemmNPerThread = 64;
validParams.blockSize = 256;

// XXX. fix gridSize.
// need to use (M/MPerBlock)*(N/NPerBlock).
gridSize = 784;
int64_t M = op.filter().getType().template dyn_cast<MemRefType>().getShape()[1];
int64_t N = op.input().getType().template dyn_cast<MemRefType>().getShape()[1];

// Compute gridSize.
gridSize = (M / validParams.gemmMPerBlock) * (N / validParams.gemmNPerBlock);
}

if (launchDimCallback) {
Expand Down

0 comments on commit a81d05c

Please sign in to comment.