-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding MI300A specific optimizations for GPU aware MPI.
- Loading branch information
1 parent
156ea96
commit a04594a
Showing
10 changed files
with
205 additions
and
46 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
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
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,48 @@ | ||
MODULE HIP_ALLOCATOR_MOD | ||
USE ISO_C_BINDING | ||
|
||
IMPLICIT NONE | ||
SAVE | ||
PRIVATE | ||
|
||
PUBLIC :: DEVICE_ALLOCATE, DEVICE_FREE | ||
|
||
INTERFACE | ||
SUBROUTINE HIPMALLOC(CPTR, PSIZE) BIND(C, NAME="hipMalloc") | ||
USE ISO_C_BINDING, ONLY : C_PTR, C_SIZE_T | ||
IMPLICIT NONE | ||
TYPE(C_PTR) :: CPTR | ||
INTEGER(C_SIZE_T), VALUE :: PSIZE | ||
END SUBROUTINE HIPMALLOC | ||
|
||
SUBROUTINE HIPFREE(PTR) BIND(C, NAME="hipFree") | ||
USE ISO_C_BINDING, ONLY : C_PTR | ||
IMPLICIT NONE | ||
TYPE(C_PTR) :: PTR | ||
END SUBROUTINE HIPFREE | ||
END INTERFACE | ||
|
||
CONTAINS | ||
|
||
SUBROUTINE DEVICE_ALLOCATE(X, PSIZE) | ||
USE ISO_C_BINDING, ONLY : C_PTR, C_SIZE_T, C_INT8_T | ||
IMPLICIT NONE | ||
INTEGER(C_INT8_T), DIMENSION(:), POINTER, INTENT(INOUT) :: X | ||
INTEGER(C_SIZE_T), VALUE :: PSIZE | ||
TYPE(C_PTR) :: PTR | ||
PTR = C_LOC(X) | ||
CALL HIPMALLOC(PTR, PSIZE) | ||
CALL C_F_POINTER(PTR, X, [PSIZE]) | ||
|
||
END SUBROUTINE DEVICE_ALLOCATE | ||
|
||
SUBROUTINE DEVICE_FREE(X) | ||
USE ISO_C_BINDING, ONLY : C_PTR, C_INT8_T | ||
IMPLICIT NONE | ||
INTEGER(C_INT8_T), DIMENSION(:), POINTER, INTENT(INOUT) :: X | ||
TYPE(C_PTR) :: PTR | ||
PTR = C_LOC(X) | ||
CALL HIPFREE(PTR) | ||
END SUBROUTINE DEVICE_FREE | ||
|
||
END MODULE HIP_ALLOCATOR_MOD |
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
Oops, something went wrong.