Ejemplo n.º 1
0
// Returns whether peer access is possible between device and peerDevice.
func DeviceCanAccessPeer(device, peerDevice int) bool {
	var can C.int
	err := Error(C.cudaDeviceCanAccessPeer(&can, C.int(device), C.int(peerDevice)))
	if err != Success {
		panic(err)
	}
	return int(can) != 0

}
Ejemplo n.º 2
0
func deviceCanAccessPeer(h1, h2 handle) (bool, error) {
	var ok C.int

	r := C.cudaDeviceCanAccessPeer(&ok, h1.dev, h2.dev)
	return (ok != 0), errorString(r)
}
Ejemplo n.º 3
0
func CanAccessPeer(dev1, dev2 *Device) (bool, error) {
	var ok C.int

	err := cudaErr(C.cudaDeviceCanAccessPeer(&ok, dev1.handle, dev2.handle))
	return (ok != 0), err
}