mirror of
https://github.com/bububa/openvision.git
synced 2025-10-04 13:22:41 +08:00
36 lines
639 B
Go
36 lines
639 B
Go
package common
|
|
|
|
/*
|
|
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include "openvision/common/common.h"
|
|
*/
|
|
import "C"
|
|
|
|
// GetGPUCount get gpu number
|
|
func GetGPUCount() int {
|
|
count := C.get_gpu_count()
|
|
return int(count)
|
|
}
|
|
|
|
// CreateGPUInstance create gpu instance
|
|
func CreateGPUInstance() int {
|
|
i := C.create_gpu_instance()
|
|
return int(i)
|
|
}
|
|
|
|
// DestroyGPUInstance destory gpu instance
|
|
func DestroyGPUInstance() {
|
|
C.destroy_gpu_instance()
|
|
}
|
|
|
|
// GetBigCPUCount get cpu number
|
|
func GetBigCPUCount() int {
|
|
return int(C.get_big_cpu_count())
|
|
}
|
|
|
|
// SetOMPThreads set omp thread number
|
|
func SetOMPThreads(n int) {
|
|
C.set_omp_num_threads(C.int(n))
|
|
}
|