@@ -126,15 +126,6 @@ int VISAKernelImpl::compileFastPath() {
126
126
m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_RetValSize))),
127
127
" vISA: input for function must have attributes ArgSize and RetValSize!" );
128
128
129
- if (getIsKernel () &&
130
- m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_NumGRF)) {
131
- if (!m_kernel->updateKernelFromNumGRFAttr ()) {
132
- m_builder->criticalMsgStream ()
133
- << " vISA: wrong value for .kernel_attr NumGRF" ;
134
- return VISA_FAILURE;
135
- }
136
- }
137
-
138
129
if (getIsKernel ()) {
139
130
status = calculateTotalInputSize ();
140
131
}
@@ -8423,16 +8414,23 @@ void VISAKernelImpl::setGenxDebugInfoBuffer(char *buffer, unsigned long size) {
8423
8414
8424
8415
/* *
8425
8416
* finalizeAttributes() sets attributes based on options, etc.
8426
- * This is a temporary solution to move some options to attributes.
8427
- * Once clients set attributes directily without using options, this
8428
- * function shall be removed.
8417
+ * Also, updates GRF configuration based on kernel attribute.
8418
+ * Returns true if no error is found, false otherwise.
8429
8419
*/
8430
- void VISAKernelImpl::finalizeAttributes () {
8420
+ bool VISAKernelImpl::finalizeAttributes () {
8431
8421
if (!m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_Target)) {
8432
8422
VISATarget target = m_options->getTarget ();
8433
8423
uint8_t val = (uint8_t )target;
8434
8424
AddKernelAttribute (" Target" , sizeof (val), &val);
8435
8425
}
8426
+ if (m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_NumGRF)) {
8427
+ if (!m_kernel->updateKernelFromNumGRFAttr ()) {
8428
+ m_builder->criticalMsgStream ()
8429
+ << " vISA: wrong value for .kernel_attr NumGRF" ;
8430
+ return false ;
8431
+ }
8432
+ }
8433
+ return true ;
8436
8434
}
8437
8435
8438
8436
VISA_LabelOpnd *
0 commit comments