mirror of
https://github.com/intel/llvm.git
synced 2026-01-17 14:48:27 +08:00
[Offload] Fix isValidBinary segfault on host platform
Summary: Need to verify this actually has a device. We really need to rework this to point to a real impolementation, or streamline it to handle this automatically.
This commit is contained in:
@@ -1004,8 +1004,9 @@ Error olCreateProgram_impl(ol_device_handle_t Device, const void *ProgData,
|
||||
Error olIsValidBinary_impl(ol_device_handle_t Device, const void *ProgData,
|
||||
size_t ProgDataSize, bool *IsValid) {
|
||||
StringRef Buffer(reinterpret_cast<const char *>(ProgData), ProgDataSize);
|
||||
*IsValid = Device->Device->Plugin.isDeviceCompatible(
|
||||
Device->Device->getDeviceId(), Buffer);
|
||||
*IsValid = Device->Device ? Device->Device->Plugin.isDeviceCompatible(
|
||||
Device->Device->getDeviceId(), Buffer)
|
||||
: false;
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user