コード例 #1
0
ファイル: arrayfire.go プロジェクト: pavanky/arrayfire-go
// GetDeviceCount returned the device count
func (af *AFInfo) GetDeviceCount() (int, error) {
	var cnt int
	aferr := C.af_get_device_count((*C.int)(unsafe.Pointer(&cnt)))
	if aferr != 0 {
		return 0, ErrGetDeviceCount
	}
	af.Count = cnt
	return cnt, nil
}
コード例 #2
0
ファイル: device.go プロジェクト: arrayfire/arrayfire-go
// GetDeviceCount returned the device count
func GetDeviceCount() (count int, e error) {
	e = af_call(C.af_get_device_count((*C.int)(unsafe.Pointer(&count))))
	return
}