-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move default_typeparameters to AbstractArray
- Loading branch information
Showing
5 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# TypeParameterAccessors definitions | ||
using NDTensors.TypeParameterAccessors: TypeParameterAccessors, Position | ||
using NDTensors.TypeParameterAccessors: | ||
TypeParameterAccessors, Position, default_type_parameters | ||
using NDTensors.GPUArraysCoreExtensions: storagemode | ||
using AMDGPU: AMDGPU, ROCArray | ||
using GPUArraysCore: AbstractGPUArray | ||
|
||
function TypeParameterAccessors.default_type_parameters(::Type{<:ROCArray}) | ||
return (Float64, 1, AMDGPU.Mem.HIPBuffer) | ||
return (default_type_parameters(AbstractGPUArray)..., AMDGPU.Mem.HIPBuffer) | ||
end | ||
|
||
TypeParameterAccessors.position(::Type{<:ROCArray}, ::typeof(storagemode)) = Position(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
# TypeParameterAccessors definitions | ||
using CUDA: CUDA, CuArray | ||
using NDTensors.TypeParameterAccessors: TypeParameterAccessors, Position | ||
using NDTensors.TypeParameterAccessors: | ||
TypeParameterAccessors, Position, default_type_parameters | ||
using NDTensors.GPUArraysCoreExtensions: storagemode | ||
using GPUArraysCore: AbstractGPUArray | ||
|
||
function TypeParameterAccessors.position(::Type{<:CuArray}, ::typeof(storagemode)) | ||
return Position(3) | ||
end | ||
|
||
function TypeParameterAccessors.default_type_parameters(::Type{<:CuArray}) | ||
return (Float64, 1, CUDA.Mem.DeviceBuffer) | ||
return (default_type_parameters(AbstractGPUArray)..., CUDA.Mem.DeviceBuffer) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
position(::Type{<:Array}, ::typeof(eltype)) = Position(1) | ||
position(::Type{<:Array}, ::typeof(ndims)) = Position(2) | ||
|
||
default_type_parameters(::Type{<:Array}) = (Float64, 1) |