Skip to content

Fix memory access errors in CPU build.#292

Merged
shakedregev merged 1 commit intodevelopfrom
slaven/vector_cpu_fix
May 30, 2025
Merged

Fix memory access errors in CPU build.#292
shakedregev merged 1 commit intodevelopfrom
slaven/vector_cpu_fix

Conversation

@pelesh
Copy link
Copy Markdown
Collaborator

@pelesh pelesh commented May 30, 2025

Description

Fixed following issues:

  • Vector destructor logic incorrect, tries to delete data that has not been allocated.
  • KLU test allocates and moves data to GPU without need to do so. Causes a segfault when Re::Solve is built without GPU support.

Closes #286

Proposed changes

  • Vector destructor deletes only if data exists (pointer is not null) and vector owns that data.
  • Remove commands moving data to GPU from KLU test.

Checklist

  • All tests pass. Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining
why you chose the solution you did and what alternatives you considered, etc.

@pelesh pelesh requested a review from shakedregev May 30, 2025 02:59
@pelesh pelesh self-assigned this May 30, 2025
@pelesh pelesh added bug Something isn't working testing labels May 30, 2025
@pelesh pelesh added this to the Release 0.99.2 milestone May 30, 2025
Copy link
Copy Markdown
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests and examples work. Merging

@shakedregev shakedregev merged commit a6318ab into develop May 30, 2025
4 checks passed
@shakedregev shakedregev deleted the slaven/vector_cpu_fix branch May 30, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: CPU-only build of GMRES solver tries to allocate on GPU

2 participants