oneapi-src / oneapi-src/unified-runtime
Implement a common setErrorMessage helper for urAdapterGetLastError
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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