intel / intel/llvm

Fix error handling in `device_impl::getCurrentDeviceTime()`

Open
#18,863 3 comments 0 reactions 1 assignee Claimed by @againull View on GitHub
bug confirmed unified-runtime
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

### Describe the bug

Currently there is some workaround:
```
auto Result =
getAdapter()->call_nocheck(
Device, DeviceTime, HostTime);
if (Result == UR_RESULT_ERROR_INVALID_OPERATION) {
// NOTE(UR port): Removed the call to GetLastError because we shouldn't
// be calling it after ERROR_INVALID_OPERATION: there is no
// adapter-specific error.
throw detail::set_ur_error(
sycl::exception(
make_error_code(errc::feature_not_supported),
"Device and/or backend does not support querying timestamp."),
UR_RESULT_ERROR_INVALID_OPERATION);
} else {
getAdapter()->checkUrResult(Result);
}
};
```
Backend which doesn't support the API is supposed to return UR_RESULT_ERROR_UNSUPPORTED_FEATURE, see https://github.com/intel/llvm/pull/18735#discussion_r2135212515

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.