func (a *Array) Pin() { if a.isPinned == 0 { cu.MemHostRegister(cu.HostPtr(unsafe.Pointer(&a.List[0])), a.SizeInBytes, cu.MEMHOSTREGISTER_PORTABLE) Debug("Successfully pinned.") a.isPinned = 1 } }
func NewArrayPinned(components int, size3D []int) *Array { t := new(Array) t.Init(components, size3D) cu.MemHostRegister(cu.HostPtr(unsafe.Pointer(&t.List[0])), t.SizeInBytes, cu.MEMHOSTREGISTER_PORTABLE) Debug("Successfully pinned.") t.isPinned = 1 return t }