diff --git a/NDTensors/Project.toml b/NDTensors/Project.toml index 5b31b000dd..ad82ee5355 100644 --- a/NDTensors/Project.toml +++ b/NDTensors/Project.toml @@ -1,7 +1,7 @@ name = "NDTensors" uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" authors = ["Matthew Fishman "] -version = "0.4.0" +version = "0.4.1" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" @@ -45,13 +45,13 @@ TBLIS = "48530278-0828-4a49-9772-0f3830dfa1e9" cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1" [extensions] -NDTensorsAMDGPUExt = ["AMDGPU", "GPUArraysCore"] -NDTensorsCUDAExt = ["CUDA", "GPUArraysCore"] +NDTensorsAMDGPUExt = ["AMDGPU", "GPUArraysCore", "TypeParameterAccessors"] +NDTensorsCUDAExt = ["CUDA", "GPUArraysCore", "TypeParameterAccessors"] NDTensorsGPUArraysCoreExt = "GPUArraysCore" NDTensorsHDF5Ext = "HDF5" NDTensorsJLArraysExt = ["GPUArraysCore", "JLArrays"] NDTensorsMappedArraysExt = ["MappedArrays"] -NDTensorsMetalExt = ["GPUArraysCore", "Metal"] +NDTensorsMetalExt = ["GPUArraysCore", "Metal", "TypeParameterAccessors"] NDTensorsOctavianExt = "Octavian" NDTensorsTBLISExt = "TBLIS" NDTensorscuTENSORExt = "cuTENSOR" @@ -90,7 +90,7 @@ StridedViews = "0.2.2, 0.3" TBLIS = "0.2" TimerOutputs = "0.5.5" TupleTools = "1.2.0" -TypeParameterAccessors = "0.2" +TypeParameterAccessors = "0.3" VectorInterface = "0.4.2, 0.5" cuTENSOR = "2" julia = "1.10" diff --git a/NDTensors/ext/NDTensorsAMDGPUExt/set_types.jl b/NDTensors/ext/NDTensorsAMDGPUExt/set_types.jl index 759b140926..b6ec21085c 100644 --- a/NDTensors/ext/NDTensorsAMDGPUExt/set_types.jl +++ b/NDTensors/ext/NDTensorsAMDGPUExt/set_types.jl @@ -1,11 +1,5 @@ -# TypeParameterAccessors definitions -using NDTensors.TypeParameterAccessors: - TypeParameterAccessors, Position, default_type_parameters +using AMDGPU: ROCArray using NDTensors.GPUArraysCoreExtensions: storagemode -using AMDGPU: AMDGPU, ROCArray - -function TypeParameterAccessors.default_type_parameters(::Type{<:ROCArray}) - return (default_type_parameters(AbstractArray)..., AMDGPU.Mem.HIPBuffer) -end +using TypeParameterAccessors: TypeParameterAccessors, Position TypeParameterAccessors.position(::Type{<:ROCArray}, ::typeof(storagemode)) = Position(3) diff --git a/NDTensors/ext/NDTensorsCUDAExt/set_types.jl b/NDTensors/ext/NDTensorsCUDAExt/set_types.jl index bab1149890..c9814666b5 100644 --- a/NDTensors/ext/NDTensorsCUDAExt/set_types.jl +++ b/NDTensors/ext/NDTensorsCUDAExt/set_types.jl @@ -1,13 +1,7 @@ -# TypeParameterAccessors definitions -using CUDA: CUDA, CuArray -using NDTensors.TypeParameterAccessors: - TypeParameterAccessors, Position, default_type_parameters +using CUDA: CuArray using NDTensors.GPUArraysCoreExtensions: storagemode +using TypeParameterAccessors: TypeParameterAccessors, Position function TypeParameterAccessors.position(::Type{<:CuArray}, ::typeof(storagemode)) return Position(3) end - -function TypeParameterAccessors.default_type_parameters(::Type{<:CuArray}) - return (default_type_parameters(AbstractArray)..., CUDA.Mem.DeviceBuffer) -end diff --git a/NDTensors/ext/NDTensorsMetalExt/set_types.jl b/NDTensors/ext/NDTensorsMetalExt/set_types.jl index 761fa089d4..a5a548603c 100644 --- a/NDTensors/ext/NDTensorsMetalExt/set_types.jl +++ b/NDTensors/ext/NDTensorsMetalExt/set_types.jl @@ -1,13 +1,7 @@ -using Metal: Metal, MtlArray -# `TypeParameterAccessors.jl` definitions. - -using NDTensors.TypeParameterAccessors: TypeParameterAccessors, Position +using Metal: MtlArray using NDTensors.GPUArraysCoreExtensions: storagemode +using TypeParameterAccessors: TypeParameterAccessors, Position function TypeParameterAccessors.position(::Type{<:MtlArray}, ::typeof(storagemode)) return Position(3) end - -function TypeParameterAccessors.default_type_parameters(::Type{<:MtlArray}) - return (Float32, 1, Metal.DefaultStorageMode) -end