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

WIP: enhance parent_call #248

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

WIP: enhance parent_call #248

wants to merge 2 commits into from

Conversation

johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Jun 21, 2021

  • rename it to no_offset_view_apply as a part of the non-exported API.
  • allow multiple inputs

I find this pattern used very widely when dealing with CUDA.CuArray,

julia> A = OffsetArray(CUDA.rand(4, 4), -1, -1);

julia> B = OffsetArray(CUDA.rand(4, 4), -1, -1);

julia> A .- B
ERROR: Scalar indexing is disallowed.

julia> no_offset_view_apply(A, B) do x, y
    x .- y
end # 🎉 
4×4 OffsetArray(::CuArray{Float32, 2}, 0:3, 0:3) with eltype Float32 with indices 0:3×0:3:

A lot of seemingly ambiguous operations can be supported by this, e.g., #93, #137

@codecov
Copy link

codecov bot commented Jun 21, 2021

Codecov Report

Merging #248 (da91a54) into master (7a43b4c) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
+ Coverage   95.26%   95.34%   +0.08%     
==========================================
  Files           5        5              
  Lines         422      430       +8     
==========================================
+ Hits          402      410       +8     
  Misses         20       20              
Impacted Files Coverage Δ
src/OffsetArrays.jl 98.27% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a43b4c...da91a54. Read the comment docs.

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.

1 participant