@@ -4043,6 +4043,65 @@ namespace IGC
4043
4043
}
4044
4044
}
4045
4045
4046
+ unsigned int CEncoder::GetSpillThreshold (SIMDMode simdmode)
4047
+ {
4048
+ CodeGenContext* context = m_program->GetContext ();
4049
+ ShaderType shaderType = context->type ;
4050
+ unsigned int value = 0 ;
4051
+
4052
+ if (shaderType == ShaderType::COMPUTE_SHADER)
4053
+ {
4054
+ switch (simdmode)
4055
+ {
4056
+ case SIMDMode::SIMD16:
4057
+ value = context->m_DriverInfo .getCSSIMD16_SpillThreshold ();
4058
+ break ;
4059
+ case SIMDMode::SIMD32:
4060
+ value = context->m_DriverInfo .getCSSIMD32_SpillThreshold ();
4061
+ break ;
4062
+ default :
4063
+ break ;
4064
+ }
4065
+ return value;
4066
+ }
4067
+
4068
+ // Below is for non-CS
4069
+ switch (simdmode)
4070
+ {
4071
+ case SIMDMode::SIMD8:
4072
+ value = context->m_DriverInfo .getSIMD8_SpillThreshold ();
4073
+ break ;
4074
+ case SIMDMode::SIMD16:
4075
+ value = context->m_DriverInfo .getSIMD16_SpillThreshold ();
4076
+ break ;
4077
+ case SIMDMode::SIMD32:
4078
+ value = context->m_DriverInfo .getSIMD32_SpillThreshold ();
4079
+ break ;
4080
+ default :
4081
+ break ;
4082
+ }
4083
+
4084
+ unsigned int AILvalue = 0 ;
4085
+ switch (simdmode)
4086
+ {
4087
+ case SIMDMode::SIMD8:
4088
+ // no AIL support
4089
+ break ;
4090
+ case SIMDMode::SIMD16:
4091
+ AILvalue = context->getModuleMetaData ()->SIMD16_SpillThreshold ;
4092
+ break ;
4093
+ case SIMDMode::SIMD32:
4094
+ AILvalue = context->getModuleMetaData ()->SIMD32_SpillThreshold ;
4095
+ break ;
4096
+ default :
4097
+ break ;
4098
+ }
4099
+
4100
+ if (AILvalue)
4101
+ value = AILvalue;
4102
+ return value;
4103
+ }
4104
+
4046
4105
void CEncoder::SetAbortOnSpillThreshold (bool canAbortOnSpill, bool AllowSpill)
4047
4106
{
4048
4107
CodeGenContext* context = m_program->GetContext ();
@@ -4057,18 +4116,18 @@ namespace IGC
4057
4116
if (m_program->m_Platform ->getGRFSize () >= 64 )
4058
4117
{
4059
4118
if (m_program->m_dispatchSize == SIMDMode::SIMD16)
4060
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD16_SpillThreshold ( ) * 4 );
4119
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4061
4120
else if (m_program->m_dispatchSize == SIMDMode::SIMD32)
4062
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD32_SpillThreshold ( ) * 4 );
4121
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4063
4122
}
4064
4123
else
4065
4124
{
4066
4125
if (m_program->m_dispatchSize == SIMDMode::SIMD8)
4067
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD8_SpillThreshold ( ) * 2 );
4126
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4068
4127
else if (m_program->m_dispatchSize == SIMDMode::SIMD16)
4069
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD16_SpillThreshold ( ) * 2 );
4128
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4070
4129
else
4071
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD32_SpillThreshold ( ) * 2 );
4130
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4072
4131
}
4073
4132
}
4074
4133
break ;
@@ -4079,16 +4138,16 @@ namespace IGC
4079
4138
if (m_program->m_Platform ->getGRFSize () >= 64 )
4080
4139
{
4081
4140
if (m_program->m_dispatchSize == SIMDMode::SIMD16)
4082
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getCSSIMD16_SpillThreshold ( ) * 4 );
4141
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4083
4142
else if (m_program->m_dispatchSize == SIMDMode::SIMD32)
4084
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getCSSIMD32_SpillThreshold ( ) * 4 );
4143
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4085
4144
}
4086
4145
else
4087
4146
{
4088
4147
if (m_program->m_dispatchSize == SIMDMode::SIMD16)
4089
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getCSSIMD16_SpillThreshold ( ) * 2 );
4148
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4090
4149
else if (m_program->m_dispatchSize == SIMDMode::SIMD32)
4091
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getCSSIMD32_SpillThreshold ( ) * 2 );
4150
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4092
4151
}
4093
4152
}
4094
4153
break ;
@@ -4101,16 +4160,16 @@ namespace IGC
4101
4160
if (m_program->m_Platform ->getGRFSize () >= 64 )
4102
4161
{
4103
4162
if (m_program->m_dispatchSize == SIMDMode::SIMD8)
4104
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD8_SpillThreshold ( ) * 2 );
4163
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4105
4164
else if (m_program->m_dispatchSize == SIMDMode::SIMD16)
4106
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD16_SpillThreshold ( ) * 4 );
4165
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4107
4166
else if (m_program->m_dispatchSize == SIMDMode::SIMD32)
4108
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD32_SpillThreshold ( ) * 4 );
4167
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 4 );
4109
4168
}
4110
4169
else
4111
4170
{
4112
4171
if (m_program->m_dispatchSize == SIMDMode::SIMD8)
4113
- SaveOption (vISA_AbortOnSpillThreshold, context-> m_DriverInfo . getSIMD8_SpillThreshold ( ) * 2 );
4172
+ SaveOption (vISA_AbortOnSpillThreshold, GetSpillThreshold (m_program-> m_dispatchSize ) * 2 );
4114
4173
}
4115
4174
}
4116
4175
break ;
0 commit comments