Skip to content

Commit

Permalink
Merge pull request #181 from jrbyrnes/NewAMDLLVMENv
Browse files Browse the repository at this point in the history
Support using a custom value for occupancy limit across all kernels
  • Loading branch information
jrbyrnes authored Jul 8, 2022
2 parents 7c6ce6b + 0a8086e commit 0fdcefd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/optsched-cfg/sched.ini
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ SHOULD_LIMIT_OCCUPANCY YES

# What should we use to limit the occupancy?
# HEURISTIC: AMD's memory boundedness heuristic
# VALUE: Uses the value provided by OCCUPANCY_LIMIT for all kernels
# FILE: occupancy_limits.ini file
# NONE: do not use limits -- defaults to unlimited
OCCUPANCY_LIMIT_SOURCE FILE
Expand Down
2 changes: 2 additions & 0 deletions include/opt-sched/Scheduler/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ enum FUNC_RESULT {
enum OCC_LIMIT_TYPE {
// NONE
OLT_NONE,
// Value provided by sched.ini
OLT_VALUE,
// AMD's Heuristic
OLT_HEUR,
// Hardcoded File
Expand Down
2 changes: 2 additions & 0 deletions lib/Wrapper/AMDGPU/OptSchedGCNTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ int OptSchedGCNTarget::getOccupancyLimit(Config &OccFile) const {
switch (LimitType) {
case OLT_NONE:
return OCCUnlimited;
case OLT_VALUE:
return OccupancyLimit;
case OLT_HEUR:
return MFI->isMemoryBound() || MFI->needsWaveLimiter() ? 4 : OCCUnlimited;
case OLT_FILE:
Expand Down
2 changes: 2 additions & 0 deletions lib/Wrapper/OptimizingScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ ScheduleDAGOptSched::parseOccLimit(const std::string Str) {

if (Str == "NONE") {
return OCC_LIMIT_TYPE::OLT_NONE;
} else if (Str = "VALUE") {
return OCC_LIMIT_TYPE::OLT_VALUE;
} else if (Str == "HEURISTIC") {
return OCC_LIMIT_TYPE::OLT_HEUR;
} else if (Str == "FILE") {
Expand Down

0 comments on commit 0fdcefd

Please sign in to comment.