Skip to content

Commit

Permalink
Debugging WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
wertysas committed Dec 11, 2024
1 parent 7a606ed commit d90d5f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions fieldType.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__ (self, **kwargs):
self.viewRank = self.rank-1
self.viewShape = ','.join ([':'] * (self.rank-1))
self.lbptr = ', '.join (list (map (lambda i: "LBOUNDS(" + str (i+1) + "):", range (0, self.rank))))
self.lbptr_blk = ', '.join([ f"LBOUNDS({i}):" for i in range range(1, self.rank)] + ["BLK_BOUNDS(1):"])
self.devptr_blk = ':, ' * (ft.rank-1) + 'BLK_BOUNDS(1):BLK_BOUNDS(2)'
self.lbptr_blk = ', '.join([ f"LBOUNDS({i}):" for i in range(1, self.rank)] + ["BLK_BOUNDS(1):"])
self.devptr_blk = ':, ' * (self.rank-1) + 'BLK_BOUNDS(1):BLK_BOUNDS(2)'
self.hasView = self.rank > 1
self.ganged = self.rank > 2

Expand Down
11 changes: 8 additions & 3 deletions field_RANKSUFF_module.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ CONTAINS
CALL SELF%SET_STATUS (IAND (SELF%GET_STATUS (), NOT (NDEVFRESH)))
ENDIF

T
END SUBROUTINE ${ftn}$_GET_HOST_DATA

SUBROUTINE ${ftn}$_OWNER_GET_HOST_DATA (SELF, MODE, PTR, QUEUE, BLK_BOUNDS)
CLASS(${ftn}$_OWNER) :: SELF
Expand All @@ -501,7 +501,7 @@ CONTAINS
CALL SELF%SET_STATUS (NHSTFRESH)
ENDIF
ENDIF
CALL SELF%${ftn}$_GET_HOST_DATA(MODE, PTR, QUEUE, BLK_BOUNDS)
CALL SELF%${ftn}$_GET_HOST_DATA(MODE, PTR, QUEUE=QUEUE, BLK_BOUNDS=BLK_BOUNDS)

END SUBROUTINE ${ftn}$_OWNER_GET_HOST_DATA

Expand All @@ -518,6 +518,7 @@ CONTAINS
SUBROUTINE ${ftn}$_SYNC_HOST_RDONLY (SELF, QUEUE, BLK_BOUNDS)
CLASS(${ftn}$) :: SELF
INTEGER(KIND=JPIM), OPTIONAL, INTENT(IN) :: QUEUE
INTEGER(KIND=JPIM), OPTIONAL, INTENT(IN) :: BLK_BOUNDS(2)
${ft.type}$, POINTER :: ZPTR(${ft.shape}$)

CALL SELF%GET_HOST_DATA_RDONLY (ZPTR, QUEUE, BLK_BOUNDS=BLK_BOUNDS)
Expand All @@ -534,9 +535,10 @@ CONTAINS

END SUBROUTINE ${ftn}$_GET_HOST_DATA_RDWR

SUBROUTINE ${ftn}$_SYNC_HOST_RDWR (SELF, QUEUE)
SUBROUTINE ${ftn}$_SYNC_HOST_RDWR (SELF, QUEUE, BLK_BOUNDS)
CLASS(${ftn}$) :: SELF
INTEGER(KIND=JPIM), OPTIONAL, INTENT(IN) :: QUEUE
INTEGER(KIND=JPIM), OPTIONAL, INTENT(IN) :: BLK_BOUNDS(2)
${ft.type}$, POINTER :: ZPTR(${ft.shape}$)

CALL SELF%GET_HOST_DATA_RDWR (ZPTR, QUEUE, BLK_BOUNDS=BLK_BOUNDS)
Expand Down Expand Up @@ -567,6 +569,9 @@ CONTAINS
CALL SELF%SET_STATUS (IOR (SELF%GET_STATUS (), NDEVFRESH))
ENDIF
IF ( PRESENT(BLK_BOUNDS) ) THEN
PRINT *, "BLK_BOUNDS", BLK_BOUNDS
PRINT *, "lbptr_blk: ${ft.lbptr_blk}$"
PRINT *, "devtr_blk: ${ft.devptr_blk}$"
PTR ( ${ft.lbptr_blk}$) => SELF%DEVPTR (${ft.devptr_blk}$)
ELSE
PTR (${ft.lbptr}$) => SELF%DEVPTR (${','.join(':' for _ in range(ft.rank))}$)
Expand Down
4 changes: 3 additions & 1 deletion field_basic_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ MODULE FIELD_BASIC_MODULE
PUBLIC :: FIELD_BASIC

ABSTRACT INTERFACE
SUBROUTINE FIELD_BASIC_SYNC (SELF, QUEUE)
SUBROUTINE FIELD_BASIC_SYNC (SELF, QUEUE, BLK_BOUNDS)
IMPORT FIELD_BASIC
CLASS(FIELD_BASIC) :: SELF
INTEGER, OPTIONAL, INTENT(IN) :: QUEUE
INTEGER, OPTIONAL, INTENT(IN) :: BLK_BOUNDS(2)

END SUBROUTINE
SUBROUTINE FIELD_BASIC_DELETE_DEVICE_DATA (SELF)
IMPORT FIELD_BASIC
Expand Down
2 changes: 1 addition & 1 deletion tests/test_get_device_data_bounds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PROGRAM TEST_GET_DEVICE_DATA_BOUNDS
DO I=1,128
DO J = 1,2
IF ( PTR_GPU(I,J) /= 42 ) THEN
OKAY =.FALSE.
OKAY = .FALSE.
END IF
END DO
END DO
Expand Down

0 comments on commit d90d5f6

Please sign in to comment.