addressing.go passes p instead of &p to cuPointerGetAttribute:
var p unsafe.Pointer
C.cuPointerGetAttribute(p, a, devPtr) // p is nil here
return p, nil // so this is always nil
The API writes the result into the address you give it, so passing nil means nothing gets written
and on some drivers it'll segfault.
Fix is just:
C.cuPointerGetAttribute(unsafe.Pointer(&p), a, devPtr)
addressing.gopassespinstead of&ptocuPointerGetAttribute:The API writes the result into the address you give it, so passing nil means nothing gets written
and on some drivers it'll segfault.
Fix is just: