Skip to content

Commit

Permalink
Add registryt to `TypeParameterAcessors
Browse files Browse the repository at this point in the history
  • Loading branch information
kmp5VT committed Jun 21, 2024
1 parent c4dad63 commit f23d305
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NDTensors/ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module NDTensorsJLArraysExt

include("set_types.jl")
end
10 changes: 10 additions & 0 deletions NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TypeParameterAccessors definitions
using NDTensors.TypeParameterAccessors: TypeParameterAccessors, Position
using NDTensors.GPUArraysCoreExtensions: storagemode
using JLArrays: JLArrays, JLArray

function TypeParameterAccessors.default_type_parameters(::Type{<:JLArray})
return (Float64, 1)
end
TypeParameterAccessors.position(::Type{<:JLArray}, ::typeof(eltype)) = Position(1)
TypeParameterAccessors.position(::Type{<:JLArray}, ::typeof(ndims)) = Position(2)

0 comments on commit f23d305

Please sign in to comment.