[SYCL] Improve error message when no compatible device image is found#21749
[SYCL] Improve error message when no compatible device image is found#21749KornevNikita merged 1 commit intosyclfrom
Conversation
| std::string(KernelName) + | ||
| ". The program may not have been compiled for this device."); |
There was a problem hiding this comment.
| std::string(KernelName) + | |
| ". The program may not have been compiled for this device."); | |
| std::string(KernelName); |
Nitpick: I'd prefer to keep exception messages on the shorter side and have them be just a basic description of the problem. The last sentence here is likely to be accurate, but I don't think it provides much value, so I would drop it. Might be a matter of personal taste though.
There was a problem hiding this comment.
I think you may be right, it seems to be somewhat of a matter of personal taste, but actually I agree. As the old saying goes: "when a program has nothing surprising, interesting or useful to say, it should say nothing".
eaa5eb9 to
3019b95
Compare
Maetveis
left a comment
There was a problem hiding this comment.
LGTM, with a nit. Thank you!
3019b95 to
45e1f6a
Compare
|
@intel/llvm-gatekeepers please consider merging |
Maetveis
left a comment
There was a problem hiding this comment.
LGTM, few more nits, sorry :)
8f5ed8e to
fd8e6e4
Compare
ProgramManager::getDeviceImage previously threw the same "No kernel named X was found" error for two distinct situations: - the kernel name is genuinely unknown (not registered at all), and - the kernel is known but no binary image in the fat binary targets the device being used at runtime. The second case is typically caused by compiling for a different device architecture than the one executing the binary, which is a common user mistake. Conflating it with an unknown kernel name made the error misleading and hard to diagnose. Introduce a KernelFound flag to distinguish the two paths and emit a dedicated message for the no-compatible-image case.
|
@kswiecicki ready to merge |
|
@intel/llvm-gatekeepers please consider merging |
ProgramManager::getDeviceImage previously threw the same "No kernel named X was found" error for two distinct situations:
The second case is typically caused by compiling for a different device architecture than the one executing the binary, which is a common user mistake. Conflating it with an unknown kernel name made the error misleading and hard to diagnose.
Introduce a KernelFound flag to distinguish the two paths and emit a dedicated message for the no-compatible-image case.