Commit ed877c2
authored
[SYCL][CUDA] Improve error message for exceeding CUDA grid limits (#4563)
Improves the error message when the user specifies a number of work groups in certain dimension, which exceeds CUDA's max grid dimension limits.
Before this PR the error message is not very informative:
```
PI CUDA ERROR:
Value: 1
Name: CUDA_ERROR_INVALID_VALUE
Description: invalid argument
Function: cuda_piEnqueueKernelLaunch
Source Location: /home/tadej/llvm/sycl/plugins/cuda/pi_cuda.cpp:2662
terminate called after throwing an instance of 'cl::sycl::runtime_error'
what(): Native API failed. Native API returns: -30 (CL_INVALID_VALUE) -30 (CL_INVALID_VALUE)
This is especially confusing when porting code from CUDA, due to the fact that dimensions in SYCL are flipped compared to CUDA and CUDA has different limits for different dimensions.
```
Tested by: intel/llvm-test-suite#9521 parent 9284fc0 commit ed877c2
1 file changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
271 | 296 | | |
272 | 297 | | |
273 | 298 | | |
| |||
315 | 340 | | |
316 | 341 | | |
317 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
318 | 346 | | |
319 | 347 | | |
320 | 348 | | |
| |||
0 commit comments