コード例 #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
ファイル: device.go プロジェクト: LStoleriu/hotspin
// 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)
}