示例#1
0
func errorString(ret C.cudaError_t) error {
	if ret == C.cudaSuccess {
		return nil
	}
	err := C.GoString(C.cudaGetErrorString(ret))
	return fmt.Errorf("cuda: %v", err)
}
示例#2
0
func cudaErr(ret C.cudaError_t) error {
	if ret == C.cudaSuccess {
		return nil
	}
	err := C.GoString(C.cudaGetErrorString(ret))
	return errors.New(err)
}
示例#3
0
// Message string for the error
func GetErrorString(err Error) string {
	return C.GoString(C.cudaGetErrorString(C.cudaError_t(int(err))))
}