Ejemplo n.º 1
0
// Returns in a device handle given an ordinal in the range [0, DeviceGetCount()-1].
func DeviceGet(ordinal int) Device {
	var device C.CUdevice
	err := Result(C.cuDeviceGet(&device, C.int(ordinal)))
	if err != SUCCESS {
		panic(err)
	}
	return Device(device)
}
Ejemplo n.º 2
0
func DeviceGet(ordinal int) (device, err int) {
	var cDevice C.CUdevice
	var cErr C.int
	cErr = C.int(C.cuDeviceGet(&cDevice, C.int(ordinal)))
	device = int(cDevice)
	err = int(cErr)
	return
}