CLMSYNC(3) Standard Compute Layer (CL) Manual CLMSYNC(3)
NAME
clmsync - Synchronize memory between host and co-processor device
SYNOPSIS
#include <stdcl.h>
cl_event clmsync( CONTEXT* cp, unsigned int devnum, void* ptr, int
flags);
Link with -lstdcl.
DESCRIPTION
clmsync() is used to synchronize memory between the host and a compute
layer (CL) co-processor device. The memory pointed to by ptr must have
been created using a call to clmalloc() and associated with a CL con-
text.
The behavior of clmsync() is controlled by the flags argument which
must be set with either CL_MEM_HOST or CL_MEM_DEVICE. These flags are
mutually exclusive and it is an error to set both or none. The follow-
ing flags may be used:
CL_MEM_HOST
clmsync() will sync the memory on the host.
CL_MEM_DEVICE
clmsync() will sync the memory on the device.
CL_EVENT_WAIT
clmsync() will block until the operation has completed.
CL_EVENT_NOWAIT
clmsync() will return immediately. The programmer must ensure
that the operation has completed using clwait() or clwaitev().
CL_EVENT_RELEASE
Used with CL_EVENT_WAIT to force clmsync() to release the CL
event generated by the operation. If this flag is not used the
programmer is responsible for releasing the returned event using
clReleaseEvent(). This flag has no effect when CL_EVENT_NOWAIT
is used.
RETURN VALUE
On error clmsync() will return (cl_event)(-1) and errno is set appro-
priately.
AUTHOR
Written by David Richie.
REPORTING BUGS
Report bugs to <support@browndeertechnology.com>
COPYRIGHT
Copyright (C) 2009 Brown Deer Technology, LLC. Licensed under the GNU
Lesser General Public License version 3 (LGPLv3). There is NO WARRANTY
to the extent permitted by law.
SEE ALSO
clwait(3), clwaitev(3), clmalloc(3), clfree(3), stdcl(3)
libstdcl-1.0 2010-8-12 CLMSYNC(3)