@@ -180,26 +180,27 @@ void ReportInvalidKernelArgument(ur_kernel_handle_t Kernel, uint32_t ArgIndex,
180180 break ;
181181 case ValidateUSMResult::RELEASED_POINTER:
182182 getContext ()->logger .always (
183- " The {}th argument {} is a released USM pointer" , ArgIndex,
183+ " The {}th argument {} is a released USM pointer" , ArgIndex + 1 ,
184184 (void *)Addr);
185185 PrintAllocateInfo (Addr, AI.get ());
186186 break ;
187187 case ValidateUSMResult::BAD_CONTEXT:
188188 getContext ()->logger .always (
189- " The {}th argument {} is allocated in other context" , ArgIndex,
189+ " The {}th argument {} is allocated in other context" , ArgIndex + 1 ,
190190 (void *)Addr);
191191 PrintAllocateInfo (Addr, AI.get ());
192192 break ;
193193 case ValidateUSMResult::BAD_DEVICE:
194194 getContext ()->logger .always (
195- " The {}th argument {} is allocated in other device" , ArgIndex,
195+ " The {}th argument {} is allocated in other device" , ArgIndex + 1 ,
196196 (void *)Addr);
197197 PrintAllocateInfo (Addr, AI.get ());
198198 break ;
199199 case ValidateUSMResult::OUT_OF_BOUNDS:
200200 getContext ()->logger .always (
201201 " The {}th argument {} is located outside of its region [{}, {})" ,
202- ArgIndex, (void *)Addr, (void *)AI->UserBegin , (void *)AI->UserEnd );
202+ ArgIndex + 1 , (void *)Addr, (void *)AI->UserBegin ,
203+ (void *)AI->UserEnd );
203204 getContext ()->logger .always (" allocated here:" );
204205 AI->AllocStack .print ();
205206 break ;
0 commit comments