CLMATTACH(3) Standard Compute Layer (CL) Manual CLMATTACH(3)
NAME
clmattach, clmdetach - Attach and detach memory from a CL context
SYNOPSIS
#include <stdcl.h>
int clmattach( CONTEXT* cp, void* ptr );
int clmdetach( void* ptr );
Link with -lstdcl.
DESCRIPTION
clmattach() is used to attach memory to a compute layer (CL) context.
The memory pointed to by ptr must be allocated with clmalloc() and
suitable for sharing between the host and CL co-processor devices. In
order to change the attachment of memory from one CL context to
another, the memory must first be unattached using a call to clmde-
tach(). It is an error to pass clmattach() memory that is already
attached to a CL context.
clmdetach() is used to detach memory from a CL context. The memory
pointed to by ptr must be allocated with clmalloc() and suitable for
sharing between the host and CL co-processor devices.
If ptr does not point to memory allocated by clmalloc() the behavior of
clmattach() and clmdetach() is undefined.
RETURN VALUE
Both clmattach() and clmdetach() return 0 on success. On error, -1 is
returned and errno is set appropriately.
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
clmalloc(3), clfree(3), clmsync(3), malloc(3), stdcl(3)
libstdcl-0.7 2009-11-10 CLMATTACH(3)