Skip to content

Fix zeros_like/ones_like/empty_like for scalar and array_like inputs#505

Open
cycsmail wants to merge 1 commit into
inducer:mainfrom
cycsmail:zeros-like-scalar-389
Open

Fix zeros_like/ones_like/empty_like for scalar and array_like inputs#505
cycsmail wants to merge 1 commit into
inducer:mainfrom
cycsmail:zeros-like-scalar-389

Conversation

@cycsmail

Copy link
Copy Markdown

Currently the *_like helpers assume other_ary is a GPUArray and read .allocator/.flags off it, so passing a scalar or other array_like blows up. This mirrors numpy by running non-GPUArray inputs through np.asarray and falling back to the default drv.mem_alloc allocator; the GPUArray path is unchanged.

Added a small test for scalar / np.float32 inputs alongside the existing *_like checks.

Heads up: I don't have a CUDA box here, so I only exercised the _array_like_helper logic locally and couldn't run the GPU suite. Worth confirming on your GitLab CI.

Fixes #389.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPUArray.zeros_like | ones_like failing for scalar inputs

1 participant