Class: Ignis::Memory::PinnedHostMemoryResource

Inherits:
HostMemoryResource show all
Defined in:
lib/nvruby/memory/pinned_host_memory_resource.rb

Overview

Pinned (page-locked) host memory resource Uses cudaHostAlloc for faster GPU transfers

Constant Summary collapse

HOST_ALLOC_DEFAULT =

cudaHostAllocDefault flag

0x00
HOST_ALLOC_PORTABLE =

cudaHostAllocPortable flag

0x01
HOST_ALLOC_MAPPED =

cudaHostAllocMapped flag

0x02
HOST_ALLOC_WRITE_COMBINED =

cudaHostAllocWriteCombined flag

0x04

Constants inherited from HostMemoryResource

HostMemoryResource::ALIGNMENT

Instance Method Summary collapse

Methods inherited from HostMemoryResource

#allocate, #deallocate

Constructor Details

#initialize(flags: HOST_ALLOC_DEFAULT) ⇒ PinnedHostMemoryResource

Returns a new instance of PinnedHostMemoryResource.

Parameters:

  • flags (Integer) (defaults to: HOST_ALLOC_DEFAULT)

    cudaHostAlloc flags (default: 0)



78
79
80
81
82
# File 'lib/nvruby/memory/pinned_host_memory_resource.rb', line 78

def initialize(flags: HOST_ALLOC_DEFAULT)
  super()
  @flags = flags
  CUDA::RuntimeAPI.ensure_loaded!
end