m_cuda_allocator Module



Interfaces

public interface cuda_allocator_t

  • public function cuda_allocator_init(mesh, sz) result(allocator)

    Arguments

    Type IntentOptional Attributes Name
    class(mesh_t), intent(inout) :: mesh
    integer, intent(in) :: sz

    Return Value type(cuda_allocator_t)

public interface cuda_field_t

  • public function cuda_field_init(ngrid, next, id) result(f)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: ngrid
    type(cuda_field_t), intent(in), pointer :: next
    integer, intent(in) :: id

    Return Value type(cuda_field_t)


Derived Types

type, public, extends(allocator_t) ::  cuda_allocator_t

Components

Type Visibility Attributes Name Initial
integer, public :: ngrid
integer, public :: next_id = 0

The id for the next allocated block. This counter is incremented each time a new block is allocated.

class(mesh_t), public, pointer :: mesh

The pointer to the first block on the list. Non associated if the list is empty

class(field_t), public, pointer :: first => null()

Constructor

public function cuda_allocator_init (mesh, sz)

Type-Bound Procedures

procedure, public :: get_block
procedure, public :: release_block
procedure, public :: get_block_ids
procedure, public :: destroy
procedure, public :: compute_padded_dims
procedure, public :: create_block => create_cuda_block

type, public, extends(field_t) ::  cuda_field_t

Components

Type Visibility Attributes Name Initial
class(field_t), public, pointer :: next
real(kind=dp), public, pointer, contiguous :: data(:,:,:)
integer, public :: dir
integer, public :: data_loc
integer, public :: refcount = 0
integer, public :: id

An integer identifying the memory block.

real(kind=dp), public, device, pointer, contiguous :: data_d(:,:,:)

Constructor

public function cuda_field_init (ngrid, next, id)

Type-Bound Procedures

procedure, public :: set_data_loc
procedure, public :: set_shape => set_shape_cuda

Functions

public function cuda_field_init(ngrid, next, id) result(f)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ngrid
type(cuda_field_t), intent(in), pointer :: next
integer, intent(in) :: id

Return Value type(cuda_field_t)

public function cuda_allocator_init(mesh, sz) result(allocator)

Arguments

Type IntentOptional Attributes Name
class(mesh_t), intent(inout) :: mesh
integer, intent(in) :: sz

Return Value type(cuda_allocator_t)

public function create_cuda_block(self, next) result(ptr)

Arguments

Type IntentOptional Attributes Name
class(cuda_allocator_t), intent(inout) :: self
type(cuda_field_t), intent(in), pointer :: next

Return Value class(field_t), pointer


Subroutines

public subroutine set_shape_cuda(self, dims)

Arguments

Type IntentOptional Attributes Name
class(cuda_field_t) :: self
integer, intent(in) :: dims(3)