@@ -126,15 +126,6 @@ int VISAKernelImpl::compileFastPath() {
126126 m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_RetValSize))),
127127 " vISA: input for function must have attributes ArgSize and RetValSize!" );
128128
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-
138129 if (getIsKernel ()) {
139130 status = calculateTotalInputSize ();
140131 }
@@ -8423,16 +8414,23 @@ void VISAKernelImpl::setGenxDebugInfoBuffer(char *buffer, unsigned long size) {
84238414
84248415/* *
84258416 * 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.
84298419 */
8430- void VISAKernelImpl::finalizeAttributes () {
8420+ bool VISAKernelImpl::finalizeAttributes () {
84318421 if (!m_kernelAttrs->isKernelAttrSet (Attributes::ATTR_Target)) {
84328422 VISATarget target = m_options->getTarget ();
84338423 uint8_t val = (uint8_t )target;
84348424 AddKernelAttribute (" Target" , sizeof (val), &val);
84358425 }
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 ;
84368434}
84378435
84388436VISA_LabelOpnd *
0 commit comments