示例#1
0
文件: init.go 项目: callistoaz/3
// cu.Init(), but error is fatal and does not dump stack.
func tryCuInit() {
	defer func() {
		err := recover()
		if err == cu.ERROR_UNKNOWN {
			log.Println("\n Try running: sudo nvidia-modprobe -u \n")
		}
		util.FatalErr(err)
	}()
	cu.Init(0)
}
示例#2
0
文件: init_test.go 项目: callistoaz/3
// needed for all other tests.
func init() {
	cu.Init(0)
	ctx := cu.CtxCreate(cu.CTX_SCHED_AUTO, 0)
	cu.CtxSetCurrent(ctx)
	fmt.Println("Created CUDA context")
}