1- const ROCTensorMap{T,S,N₁,N₂} = TensorMap{T,S,N₁,N₂, ROCVector{T,AMDGPU. DeviceMemory }}
1+ const ROCTensorMap{T,S,N₁,N₂} = TensorMap{T,S,N₁,N₂, ROCVector{T,AMDGPU. Mem . HIPBuffer }}
22const ROCTensor{T, S, N} = ROCTensorMap{T, S, N, 0 }
33
44const AdjointROCTensorMap{T,S,N₁,N₂} = AdjointTensorMap{T,S,N₁,N₂,ROCTensorMap{T,S,N₁,N₂}}
55
66function TensorKit. tensormaptype (S:: Type{<:IndexSpace} , N₁, N₂, TorA:: Type{<:StridedROCArray} )
77 if TorA <: ROCArray
8- return TensorMap{eltype (TorA),S,N₁,N₂,ROCVector{eltype (TorA), AMDGPU. DeviceMemory }}
8+ return TensorMap{eltype (TorA),S,N₁,N₂,ROCVector{eltype (TorA), AMDGPU. Mem . HIPBuffer }}
99 else
1010 throw (ArgumentError (" argument $TorA should specify a scalar type (`<:Number`) or a storage type `<:ROCVector{<:Number}`" ))
1111 end
@@ -68,6 +68,10 @@ function ROCTensorMap(data::AbstractDict{<:Sector,<:ROCMatrix}, codom::TensorSpa
6868 return ROCTensorMap (data, codom ← dom)
6969end
7070
71+ function ROCTensorMap (ts:: TensorMap{T, S, N₁, N₂, A} ) where {T, S, N₁, N₂, A}
72+ return ROCTensorMap {T, S, N₁, N₂} (ROCArray (ts. data), ts. space)
73+ end
74+
7175for (fname, felt) in ((:zeros , :zero ), (:ones , :one ))
7276 @eval begin
7377 function AMDGPU. $fname (codomain:: TensorSpace{S} ,
@@ -87,7 +91,7 @@ for (fname, felt) in ((:zeros, :zero), (:ones, :one))
8791 end
8892end
8993
90- for randfun in (:curand , :curandn )
94+ for randfun in (:rocrand , :rocrandn )
9195 randfun! = Symbol (randfun, :! )
9296 @eval begin
9397 # converting `codomain` and `domain` into `HomSpace`
@@ -171,7 +175,7 @@ vi_scalartype(::Type{<:ROCTensorMap{T}}) where {T} = T
171175vi_scalartype (:: Type{<:ROCArray{T}} ) where {T} = T
172176
173177function TensorKit. similarstoragetype (TT:: Type{<:ROCTensorMap{TTT,S,N₁,N₂}} , :: Type{T} ) where {TTT,T,S,N₁,N₂}
174- return ROCVector{T, AMDGPU. DeviceMemory }
178+ return ROCVector{T, AMDGPU. Mem . HIPBuffer }
175179end
176180
177181function Base. convert (TT:: Type{ROCTensorMap{T,S,N₁,N₂}} ,
0 commit comments