From f23d305836b92a92de6cbbcbf6a437c591699b07 Mon Sep 17 00:00:00 2001 From: Karl Pierce Date: Fri, 21 Jun 2024 23:07:20 +0200 Subject: [PATCH] Add registryt to `TypeParameterAcessors --- .../ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl | 2 +- NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl diff --git a/NDTensors/ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl b/NDTensors/ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl index 416a0d20e8..ad71cae66b 100644 --- a/NDTensors/ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl +++ b/NDTensors/ext/NDTEnsorsJLArraysExt/NDTensorsJLArraysExt.jl @@ -1,3 +1,3 @@ module NDTensorsJLArraysExt - +include("set_types.jl") end diff --git a/NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl b/NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl new file mode 100644 index 0000000000..c859d8acc3 --- /dev/null +++ b/NDTensors/ext/NDTEnsorsJLArraysExt/set_types.jl @@ -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)