oneapi-src / oneapi-src/unified-runtime

Implement a common setErrorMessage helper for urAdapterGetLastError

Open
#2,386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

common
Dominant language
C++
Stars
57
Forks
120
Avg merge
1d 14h
Merged PRs (30d)
1

Description

To implement urAdapterGetLastError every adapter currently has almost exactly this code, with setErrorMessage and associated global variables in its respective common.cpp/common.hpp. Since these implementations are all so similar we should implement some kind of common helper to eliminate the repetition. Doing this cleanly is made complicated by the need for adapter-local global variables to store the error message and code in, as well as level zero's version of setErrorMessage being slightly different (it has an extra parameter and an extra global).

I started working on a change here to replace the helper function + globals with a helper class. At time of writing I haven't yet decided the cleanest way to support the extra stuff level zero needs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the repeated urAdapterGetLastError and setErrorMessage implementations in each adapter's common.cpp/common.hpp, using the linked CUDA example as a reference. Review the proposed helper-class change and the Level Zero variant's extra parameter and global. Done means the adapters share one helper while preserving their local error state and Level Zero behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
infrastructure
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.