export_field_to_device Subroutine

public subroutine export_field_to_device(self, buffer, f, dims, to_sp)

Pack the first dims Cartesian points of field f into a contiguous device buffer, in (i, j, k) order without padding.

buffer is the device address of product(dims) elements, of kind sp when to_sp is true and dp otherwise. The buffer holds the complete result when this returns, so a library that reads device memory outside the backend's stream can consume it directly. Only called when supports_device_field_export(f) is true.

Type Bound

base_backend_t

Arguments

Type IntentOptional Attributes Name
class(base_backend_t) :: self
type(c_ptr), intent(in) :: buffer
class(field_t), intent(in) :: f
integer, intent(in) :: dims(3)
logical, intent(in) :: to_sp