File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,8 @@ namespace IGC
113
113
// true means we separate pvtmem and spillfill. pvtmem could go into stateless.
114
114
// false means all of them are together
115
115
bool m_separatePvtSpill = false ;
116
-
116
+ bool m_roundPower2KBytes = false ;
117
+
117
118
void Destroy ()
118
119
{
119
120
if (m_programBin)
@@ -129,15 +130,21 @@ namespace IGC
129
130
IGC::aligned_free (m_debugDataGenISA);
130
131
}
131
132
}
132
-
133
- void setSeparatePvtSpill (bool setSeparatePvtSpillT)
133
+
134
+ void setSeparatePvtSpill (bool setSeparatePvtSpillT, bool roundPower2KBytes )
134
135
{
135
136
m_separatePvtSpill = setSeparatePvtSpillT;
137
+ m_roundPower2KBytes = roundPower2KBytes;
136
138
}
137
139
138
140
unsigned int getScratchSpaceUsage () const
139
141
{
140
- return m_scratchSpaceUsedBySpills + m_scratchSpaceUsedByGtpin + (m_separatePvtSpill ? 0 : m_scratchSpaceUsedByShader);
142
+ unsigned int size = m_scratchSpaceUsedBySpills + m_scratchSpaceUsedByGtpin + (m_separatePvtSpill ? 0 : m_scratchSpaceUsedByShader);
143
+ if (m_roundPower2KBytes)
144
+ {
145
+ size = roundPower2KBbyte (size);
146
+ }
147
+ return size;
141
148
}
142
149
143
150
unsigned int getScratchPrivateUsage () const
@@ -161,6 +168,12 @@ namespace IGC
161
168
{
162
169
return (m_separatePvtSpill ? m_scratchSpaceUsedByStateless : 0 );
163
170
}
171
+ private:
172
+ unsigned int roundPower2KBbyte (unsigned int size) const
173
+ {
174
+ return (size ? iSTD::RoundPower2 (iSTD::Max (int_cast<DWORD>(size), static_cast <DWORD>(sizeof (KILOBYTE)))) : 0 );
175
+ }
176
+
164
177
};
165
178
166
179
enum InstrStatTypes
You can’t perform that action at this time.
0 commit comments