oneapi-src / oneapi-src/unified-memory-framework

Split `UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY` into Distinct Error Codes

Open
#968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
98
Forks
48
Avg merge
3d 20h
Merged PRs (30d)
6

Description

Description:

Currently, the umf_result_t enumeration includes an error code UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY that is used in two distinct scenarios within the UMF library:

  1. When the UMF library fails to allocate host memory for its internal metadata structures.
  2. When a memory provider fails to allocate memory because it has exhausted its available memory resources.

Using the same error code for both situations can make it difficult for developers to accurately diagnose and handle errors, as the root causes might be different (especially for providers like: gpu, dax etc...).


Proposal:

Split UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY into two separate error codes:

  1. UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY: Retain this error code to exclusively represent failures in allocating host memory for UMF's internal metadata and operations.

  2. UMF_RESULT_ERROR_MEMORY_PROVIDER_OUT_OF_MEMORY: Introduce this new error code to indicate that a memory provider has run out of memory and cannot fulfill the allocation request.


Contributor guide

Open the contributing guide

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 with the umf_result_t enumeration and trace its uses in UMF's internal metadata allocation and memory-provider allocation paths. Identify every path currently returning UMF_RESULT_ERROR_OUT_OF_HOST_MEMORY, then verify that internal failures and provider exhaustion report distinct codes and that the public error behavior is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.