Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy in constructor #669

Merged
merged 1 commit into from
Sep 5, 2024
Merged

copy in constructor #669

merged 1 commit into from
Sep 5, 2024

Conversation

jariji
Copy link
Contributor

@jariji jariji commented Sep 4, 2024

Currently the ROCArray constructor returns its argument unlike Array's constructor. This change uses copy instead.

julia> let x = rand(5)
           y = Array(x)
           z = Array(y)
           y === z
       end
false

julia> let x = rand(5)
           y = ROCArray(x)
           z = ROCArray(y)
           y === z
       end
true

@maleadt
Copy link
Member

maleadt commented Sep 4, 2024

If we want this, which I assume we do, it may be good to add this as a test to GPUArrays.jl.

@pxl-th pxl-th merged commit 7bec32c into JuliaGPU:master Sep 5, 2024
1 check passed
@jariji jariji deleted the copyconstructor branch September 5, 2024 17:50
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.

3 participants