示例#1
0
文件: cuda.go 项目: kashif/gocuda
func DeviceGetCount() (count, err int) {
	var cCount, cErr C.int
	cErr = C.int(C.cuDeviceGetCount(&cCount))
	count = int(cCount)
	err = int(cErr)
	return
}
示例#2
0
// Returns the number of devices with compute capability greater than or equal to 1.0 that are available for execution.
func DeviceGetCount() int {
	var count C.int
	err := Result(C.cuDeviceGetCount(&count))
	if err != SUCCESS {
		panic(err)
	}
	return int(count)
}