func (s *Stream) Synchronize() error {
	s.assertOpen()
	return newErrorDriver("cuStreamSynchronize", C.cuStreamSynchronize(s.stream))
}
Synchronize waits for the stream's tasks to complete.
package cuda
import "C"
import "unsafe"
func Synchronize() error {
	return newErrorDriver("cuCtxSynchronize", C.cuCtxSynchronize())
}
type Stream struct {
	stream C.CUstream
	closed bool
}
func NewStream(nonBlocking bool) (*Stream, error) {
	res := &Stream{}
	status := C.cuStreamCreate(&res.stream, streamCreationFlags(nonBlocking))
	if err := newErrorDriver("cuStreamCreate", status); err != nil {
		return nil, err
	}
	return res, nil
}
func NewStreamPriority(nonBlocking bool, priority int) (*Stream, error) {
	res := &Stream{}
	status := C.cuStreamCreateWithPriority(&res.stream, streamCreationFlags(nonBlocking),
		safeIntToC(priority))
	if err := newErrorDriver("cuStreamCreate", status); err != nil {
		return nil, err
	}
	return res, nil
}