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) }
func cudaErr(ret C.cudaError_t) error { if ret == C.cudaSuccess { return nil } err := C.GoString(C.cudaGetErrorString(ret)) return errors.New(err) }
// Message string for the error func GetErrorString(err Error) string { return C.GoString(C.cudaGetErrorString(C.cudaError_t(int(err)))) }