示例#1
0
文件: cuda.go 项目: kashif/gocuda
func DeviceComputeCapability(dev int) (major, minor, err int) {
	var cErr, cMajor, cMinor C.int
	cErr = C.int(C.cuDeviceComputeCapability(&cMajor, &cMinor, C.CUdevice(dev)))
	major = int(cMajor)
	minor = int(cMinor)
	err = int(cErr)
	return
}
示例#2
0
// Returns the compute capability of the device.
func DeviceComputeCapability(device Device) (major, minor int) {
	var maj, min C.int
	err := Result(C.cuDeviceComputeCapability(&maj, &min, C.CUdevice(device)))
	if err != SUCCESS {
		panic(err)
	}
	major = int(maj)
	minor = int(min)
	return
}