Skip to content

Fix error handling in device_impl::getCurrentDeviceTime() #18863

Open
@againull

Description

@againull
Contributor

Describe the bug

Currently there is some workaround:

    auto Result =
        getAdapter()->call_nocheck<UrApiKind::urDeviceGetGlobalTimestamps>(
            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<errc::feature_not_supported>(Result);
    }
  };

Backend which doesn't support the API is supposed to return UR_RESULT_ERROR_UNSUPPORTED_FEATURE, see #18735 (comment)

Activity

self-assigned this
on Jun 9, 2025
aelovikov-intel

aelovikov-intel commented on Jun 10, 2025

@aelovikov-intel
Contributor

Is this a UR bug or SYCL RT bug? The way I read it seems that UR adapters should be returning something different, but I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @againull@aelovikov-intel

      Issue actions

        Fix error handling in `device_impl::getCurrentDeviceTime()` · Issue #18863 · intel/llvm