GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — api: let host() copy sparse arrays as dense by melonakos · Pull Request #3723 · arrayfire/arrayfire

Conversation

@melonakos

@melonakos melonakos commented Sep 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Calling host() on a sparse array threw:

Invalid argument at index 0
Expected: info->isSparse() == false

host() sizes its buffer from elements(), which already reports the dense shape for a sparse array, so af_get_data_ptr now converts CSR and COO arrays to dense and copies that. CSC to dense is not implemented anywhere, so a CSC array fails with AF_ERR_NOT_SUPPORTED and a message saying to convert to CSR or COO first; the C++ and C docs say the same. Callers who relied on the old error to detect sparse arrays now get data instead, which is worth a line in the release notes. Tests cover the reported case and compare host() against the dense source for CSR and COO; the sparse suite passes on the CPU backend (88 tests). Fixes #3703.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
melonakos added 2 commits September 10, 2026 16:34
@melonakos
api: let host() and af_get_data_ptr copy sparse arrays as dense
1e6150f
host() sizes its buffer from elements(), which reports the dense shape for a sparse array, but af_get_data_ptr then rejected the array with "Expected: info->isSparse() == false". Convert to dense first and copy that, and say so in the docs. Fixes #3703.
@melonakos
api: reject CSC in host() clearly and cover every storage in the test
1f7efa9
CSC to dense is not implemented, so host() on a CSC array now fails with AF_ERR_NOT_SUPPORTED and a message instead of an argument error from deep inside the conversion. The docs say CSR and COO. The test gains an fp64 guard and a case that compares host() against the dense source for CSR and COO and expects the CSC rejection.

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] Sparse host call throws

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@melonakos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.