Skip to content

Conversation

Tokazama
Copy link
Member

Fixing device following discussion in #120. Default is now CPUIndex and no default for StridedArray. Instead, array types that work with pointer and define strides should explicitly define this

ArrayInterface.device(::Type{T}) where {T<:NewType} = device(parent_type(T))

This should also makes it so GPUArrays won't need to define device for all the StridedArray types because the proper AbstractDevice will be pulled from the original parent type if strides are defined.

@chriselrod
Copy link
Collaborator

Once upon a time I thought that StrideArray's purpose was to say it supports BLAS, which requires both strided memory and pointer (or Base.unsafe_convert) to work.

@codecov
Copy link

codecov bot commented Feb 17, 2021

Codecov Report

Merging #123 (f7efa58) into master (f957da5) will decrease coverage by 0.11%.
The diff coverage is 76.92%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #123      +/-   ##
==========================================
- Coverage   82.82%   82.71%   -0.12%     
==========================================
  Files          10       10              
  Lines        1520     1527       +7     
==========================================
+ Hits         1259     1263       +4     
- Misses        261      264       +3     
Impacted Files Coverage Δ
src/ArrayInterface.jl 81.84% <76.92%> (-0.43%) ⬇️

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 f957da5...f7efa58. Read the comment docs.

@Tokazama
Copy link
Member Author

I'm still trying to figure out the ambiguity on nightly, but does this approach look correct?

@chriselrod
Copy link
Collaborator

chriselrod commented Feb 17, 2021

I'm still trying to figure out the ambiguity on nightly

JuliaLang/julia#39698

It's not an ambiguity error, but an error that happens while checking for ambiguities.

does this approach look correct?

Yes, looks good.

@chriselrod chriselrod merged commit bc560cf into master Feb 17, 2021
@Tokazama Tokazama deleted the device branch February 18, 2021 12:51
@chriselrod chriselrod mentioned this pull request Feb 23, 2021
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.

2 participants