Allocate the host-side storage at (n1, n2, n3), zero-filled.
GPU attachment is a separate step via enter_data —
init runs before the device exists in the typical
init-then-enter-data sequence.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(scratch_3d_buffer_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | n1 | |||
| integer, | intent(in) | :: | n2 | |||
| integer, | intent(in) | :: | n3 | |||
| character(len=*), | intent(in), | optional | :: | name |
subroutine scratch_3d_buffer_init(this, n1, n2, n3, name) !! Allocate the host-side storage at (n1, n2, n3), zero-filled. !! GPU attachment is a separate step via `enter_data` — !! `init` runs before the device exists in the typical !! init-then-enter-data sequence. class(scratch_3d_buffer_t), intent(inout) :: this integer, intent(in) :: n1, n2, n3 character(len=*), intent(in), optional :: name this%n1 = n1 this%n2 = n2 this%n3 = n3 if (present(name)) this%name = name allocate (this%data(n1, n2, n3), source=0.0_wp) this%is_init = .true. end subroutine scratch_3d_buffer_init