-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
NDTensors/ext/NDTensorsGPUArraysCoreExt/NDTensorsGPUArraysCoreExt.jl
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,3 +1,4 @@ | ||
module NDTensorsGPUArraysCoreExt | ||
include("contract.jl") | ||
include("diag.jl") | ||
end |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using GPUArraysCore: AbstractGPUArray | ||
using NDTensors: NDTensors, BlockSparseTensor, dense, diag | ||
using NDTensors.Expose: Exposed, unexpose | ||
|
||
## TODO to circumvent issues with blocksparse and scalar indexing | ||
## convert blocksparse GPU tensors to dense tensors and call diag | ||
## copying will probably have some impact on timing but this code | ||
## currently isn't used in the main code, just in tests. | ||
function NDTensors.diag(ETensor::Exposed{<:AbstractGPUArray,<:BlockSparseTensor}) | ||
return diag(dense(unexpose(ETensor))) | ||
end |
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