khronos-opencl-man-1.0~svn27110/ 0000755 0001750 0001750 00000000000 12350363105 016254 5 ustar mathieu mathieu khronos-opencl-man-1.0~svn27110/clGetCommandQueueInfo.xml 0000644 0001750 0001750 00000026334 11660441607 023173 0 ustar mathieu mathieu
clGetCommandQueueInfoclGetCommandQueueInfo2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clGetCommandQueueInfoQuery information about a command-queue.
cl_int
clGetCommandQueueInfo
cl_command_queue
command_queue
cl_command_queue_info
param_name
size_t
param_value_size
void
*param_value
size_t
*param_value_size_retParameterscommand_queueSpecifies the command-queue being queried.param_nameSpecifies the information to query.param_value_sizeSpecifies the size in bytes of memory pointed to by
param_value. This size must be ≥ size
of return type as described in the table below.
If param_value is NULL, it is ignored.param_valueA pointer to memory where the appropriate result being queried
is returned. If param_value is NULL, it is ignored.
param_value_size_retReturns the actual size in bytes of data being queried by
param_value. If param_value_size_ret
is NULL, it is ignored
The list of supported param_name values and
the information returned in param_value by
clGetCommandQueueInfo is described in the table below.
cl_command_queue_infoReturn Type and Information returned in param_valueCL_QUEUE_CONTEXT
Return type: cl_contextReturn the context specified when the command-queue is created.CL_QUEUE_DEVICE
Return type: cl_device_idReturn the device specified when the command-queue is created.CL_QUEUE_REFERENCE_COUNT
Return type: cl_uintReturn the command-queue reference count.
The reference count returned with
CL_QUEUE_REFERENCE_COUNT should be considered
immediately stale. It is unsuitable for general use in applications. This
feature is provided for identifying memory leaks.
CL_QUEUE_PROPERTIES
Return type: cl_command_queue_properties
Return the currently specified properties for the command-queue. These
properties are specified by the properties argument in
clCreateCommandQueue.
Notes
It is possible that a device(s) becomes unavailable after a context and command-queues
that use this device(s) have been created and commands have been queued to
command-queues. In this case the behavior of OpenCL API calls that use this context
(and command-queues) are considered to be implementation-defined. The user callback
function, if specified, when the context is created can be used to record appropriate
information in the errinfo, private_info
arguments passed to the callback function when the device becomes unavailable.
Errors
Returns CL_SUCCESS if the function is executed
successfully. Otherwise, it returns the following:
Returns CL_INVALID_COMMAND_QUEUE if
command_queue is not a valid command-queue.
Returns CL_INVALID_VALUE if param_name
is not one of the supported values or if size in bytes specified by
param_value_size is less than size of return type and
param_value is not a NULL value.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclCreateCommandQueue,
clReleaseCommandQueue,
clRetainCommandQueue
khronos-opencl-man-1.0~svn27110/clCreateContext.xml 0000644 0001750 0001750 00000103155 11660441607 022101 0 ustar mathieu mathieu
clCreateContextclCreateContext2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clCreateContextCreates an OpenCL context.cl_context clCreateContextconst cl_context_properties*propertiescl_uintnum_devicesconst cl_device_id*devices(void CL_CALLBACK *pfn_notify)const char *errinfo,
const void *private_info, size_t cb,
void *user_datavoid*user_datacl_int*errcode_retDescription
An OpenCL context is created with one or more devices. Contexts are used by the
OpenCL runtime for managing objects such as command-queues, memory, program and kernel
objects and for executing kernels on one or more devices specified in the context.
Parametersproperties
Specifies a list of context property names and
their corresponding values. Each property name is immediately followed
by the corresponding desired value. The list is terminated with 0.
properties can be NULL in which case the platform
that is selected is implementation-defined. The list of supported
properties is described in the table below.
If the extension
cl_khr_dx9_media_sharing
is enabled, then properties specifies a list of context
property names and their corresponding values. Each property is followed
immediately by the corresponding desired value. The list is terminated with
zero. If a property is not specified in properties, then its
default value (listed in the table below) is used (it is said to be specified
implicitly). If properties is NULL or empty (points to
a list whose first value is zero), all attributes take on their default values.
If the extension
cl_khr_d3d10_sharing
is enabled, then properties specifies a list of context
property names and their corresponding values. Each property is followed
immediately by the corresponding desired value. The list is terminated
with zero. if a property is not specified in properties,
then its default value is used (it is said to be specified implicitly). If
properties is NULL or empty (points to a list whose first
value is zero), all attributes take on their default value.
If the extension
cl_khr_gl_sharing
is enabled, then properties points to an attribute list,
which is a array of ordered <attribute name, value> pairs terminated with
zero. If an attribute is not specified in properties,
then its default value is used (it is said to be specified implicitly). If
properties is NULL or empty (points to a list whose first
value is zero), all attributes take on their default values..
cl_context_properties enumProperty valueDescriptionCL_CONTEXT_PLATFORMcl_platform_idSpecifies the platform to use.CL_CONTEXT_INTEROP_USER_SYNCcl_bool
Specifies whether the user is responsible for synchronization between OpenCL
and other APIs. Please refer to the specific sections in the OpenCL 1.2 extension specification
that describe sharing with other APIs for restrictions on using this flag.
If CL_CONTEXT_INTEROP_USER_ SYNC is not
specified, a default of CL_FALSE is assumed.
CL_CONTEXT_D3D10_DEVICE_KHRID3D10Device*
If the
cl_khr_d3d10_sharing
extension is enabled, specifies the ID3D10Device*
to use for Direct3D 10 interoperability. The default value is NULL.
CL_GL_CONTEXT_KHR0, OpenGL context handle
OpenGL context to associated
the OpenCL context with (available if the
cl_khr_gl_sharing
extension is enabled)
CL_EGL_DISPLAY_KHREGL_NO_DISPLAY, EGLDisplay handle
EGLDisplay an OpenGL context was
created with respect to (available if the
cl_khr_gl_sharing
extension is enabled)
CL_GLX_DISPLAY_KHRNone, X handle
X Display an OpenGL context was
created with respect to (available if the
cl_khr_gl_sharing
extension is enabled)
CL_CGL_SHAREGROUP_KHR0, CGL share group handle
CGL share group to associate the OpenCL context with (available if the
cl_khr_gl_sharing
extension is enabled)
CL_WGL_HDC_KHR0, HDC handle
HDC an OpenGL context was created with respect to (available if the
cl_khr_gl_sharing
extension is enabled)
CL_CONTEXT_ADAPTER_D3D9_KHRIDirect3DDevice9 *
Specifies an IDirect3DDevice9
to use for D3D9 interop (if the
cl_khr_dx9_media_sharing
extension is supported).
CL_CONTEXT_ADAPTER_D3D9EX_KHRIDirect3DDeviceEx*
Specifies an IDirect3DDevice9Ex
to use for D3D9 interop (if the
cl_khr_dx9_media_sharing
extension is supported).
CL_CONTEXT_ADAPTER_DXVA_KHRIDXVAHD_Device *
Specifies an IDXVAHD_Device
to use for DXVA interop (if the
cl_khr_dx9_media_sharing
extension is supported).
CL_CONTEXT_D3D11_DEVICE_KHRID3D11Device *
Specifies the ID3D11Device * to use for Direct3D 11
interoperability. The default value is NULL.
num_devices
The number of devices specified in the devices argument.
devices
A pointer to a list of unique devices returned by
clGetDeviceIDs
or sub-devices created by
clCreateSubDevices
for a platform.
pfn_notify
A callback function that can be registered by the application. This callback
function will be used by the OpenCL implementation to report information
on errors during context creation as well as errors that occur at runtime
in this context. This callback function may be called asynchronously by
the OpenCL implementation. It is the application's responsibility to ensure
that the callback function is thread-safe. If pfn_notify
is NULL, no callback function is registered. The parameters to this callback
function are:
errinfo is a pointer to an error string.private_info and cb represent a pointer
to binary data that is returned by the OpenCL implementation that can be used
to log additional information helpful in debugging the error.
user_data is a pointer to user supplied data.
NOTE: There are a number of cases where error notifications need to be
delivered due to an error that occurs outside a context. Such notifications
may not be delivered through the pfn_notify callback. Where
these notifications go is implementation-defined.
user_data
Passed as the user_data argument when
pfn_notify is called. user_data can
be NULL.
errcode_ret
Returns an appropriate error code. If errcode_ret is NULL,
no error code is returned.
NotesclCreateContext and
clCreateContextFromType
perform an implicit retain. This is very helpful for 3rd party libraries, which
typically get a context passed to them by the application. However, it is possible
that the application may delete the context without informing the library. Allowing
functions to attach to (i.e. retain) and release a context solves the problem of a
context being used by a library no longer being valid.
ErrorsclCreateContext returns a valid non-zero context and
errcode_ret is set to CL_SUCCESS if the
context is created successfully. Otherwise, it returns NULL value with the following
error values returned in errcode_ret:
CL_INVALID_PLATFORM if properties
is NULL and no platform could be selected or if platform value specified
in properties is not a valid platform. (If the extension
cl_khr_gl_sharing
is enabled, then this error is replaced with
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR; see below.)
CL_INVALID_PROPERTY if context property name in
properties is not a supported property name, if the
value specified for a supported property name is not valid, or if the
same property name is specified more than once. However if the extension
cl_khr_gl_sharing is
enabled, then CL_INVALID_PROPERTY is returned if an attribute
name other than those listed in the table for properties
above or if CL_CONTEXT_INTEROP_USER_SYNC is specified in
properties.
CL_INVALID_PROPERTY if an attribute name other than those
specified in table 4.5 or if CL_CONTEXT_INTEROP_USER_SYNC is
specified in properties.
CL_INVALID_VALUE if devices is NULL; if
num_devices is equal to zero; or if pfn_notify
is NULL but user_data is not NULL.
CL_INVALID_DEVICE if devices contains an invalid device.
CL_INVALID_OPERATION if Direct3D 10 interoperability is
specified by setting CL_INVALID_D3D10_DEVICE_KHR to a non-NULL
value, and interoperability with another graphics API is also specified (if the
cl_khr_d3d10_sharing
extension is enabled).
CL_DEVICE_NOT_AVAILABLE if a device in devices
is currently not available even though the device was returned by
clGetDeviceIDs.
CL_OUT_OF_RESOURCES if there is a failure to allocate resources
required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
CL_INVALID_D3D10_DEVICE_KHR if the Direct3D
10 device specified for interoperability is not compatible with
the devices against which the context is to be created (if the
cl_khr_d3d10_sharing
extension is enabled).
CL_INVALID_D3D10_DEVICE_KHR if the value of the property
CL_CONTEXT_D3D10_DEVICE_KHR is non-NULL and does not specify
a valid Direct3D 10 device with which the cl_device_ids
against which this context is to be created may interoperate (if the
cl_khr_d3d10_sharing
extension is enabled).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR when an invalid OpenGL
context or share group object handle is specified in properties (only
if the cl_khr_gl_sharing
extension is enabled).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR if no OpenGL or
OpenGL ES context or share group is specified in the attribute list given to
clCreateContext
and any of the commands in section 9.7 are called. (if the
cl_khr_gl_sharing extension
is enabled)
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR if the
cl_khr_gl_sharing
extension is enabled and if a context was specified by any of the following means:
A context specified for an EGL-based OpenGL ES or OpenGL implementation
by setting the attributes CL_GL_CONTEXT_KHR and
CL_EGL_DISPLAY_KHR.
A context was specified for a GLX-based OpenGL implementation by
setting the attributes CL_GL_CONTEXT_KHR and
CL_GLX_DISPLAY_KHR.
A context was specified for a WGL-based OpenGL implementation by
setting the attributes CL_GL_CONTEXT_KHR and
CL_WGL_HDC_KHR.
and any of the following conditions hold:
The specified display and context attributes do not identify a valid
OpenGL or OpenGL ES context.
The specified context does not support buffer and renderbuffer objects.
The specified context is not compatible with the OpenCL context being
created (for example, it exists in a physically distinct address space,
such as another hardware device, or does not support sharing data with
OpenCL due to implementation restrictions).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR if a
share group was specified for a CGL-based OpenGL implementation by
setting the attribute CL_CGL_SHAREGROUP_KHR, and the
specified share group does not identify a valid CGL share group object (if the
cl_khr_gl_sharing extension
is enabled).
CL_INVALID_OPERATION if a context was specified as described above
and any of the following conditions hold:
A context or share group object was specified for one of CGL, EGL, GLX, or WGL
and the OpenGL implementation does not support that window-system binding API.
More than one of the attributes CL_CGL_SHAREGROUP_KHR,
CL_EGL_DISPLAY_KHR, CL_GLX_DISPLAY_KHR,
and CL_WGL_HDC_KHR is set to a non-default value.
Both of the attributes CL_CGL_SHAREGROUP_KHR and
CL_GL_CONTEXT_KHR are set to non-default values.
Any of the devices specified in the devices argument cannot support OpenCL
objects which share the data store of an OpenGL object, as described in
section 9.7.
CL_INVALID_DX9_MEDIA_ADAPTER_KHR if the
media adapter specified for interoperability is not compatible with
the devices against which the context is to be created (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_ADAPTER_KHR if
any of the values of the properties CL_CONTEXT_ADAPTER_D3D9_KHR,
CL_CONTEXT_ADAPTER_D3D9EX_KHR or
CL_CONTEXT_ADAPTER_DXVA_KHR is non-NULL and
does not specify a valid media adapter with which the cl_device_ids
against which this context is to be created may interoperate (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_OPERATION if interoperability is
specified by setting CL_CONTEXT_ADAPTER_D3D9_KHR,
CL_CONTEXT_ADAPTER_D3D9EX_KHR or
CL_CONTEXT_ADAPTER_DXVA_KHR to a non-NULL value, and
interoperability with another graphics API is also specified (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_OPERATION
if Direct3D 11 interoperability is specified by setting
CL_INVALID_D3D11_DEVICE_KHR to a non-NULL value, and
interoperability with another graphics API is also specified (only if the
cl_khr_d3d11_sharing
extension is supported).
CL_INVALID_D3D11_DEVICE_KHR if the value of the property
CL_CONTEXT_D3D11_DEVICE_KHR is non-NULL and does not specify
a valid Direct3D 11 device with which the cl_device_ids
against which this context is to be created may interoperate (only if the
cl_khr_d3d11_sharing
extension is supported).
CL_INVALID_D3D11_DEVICE_KHR if the Direct3D
11 device specified for interoperability is not compatible with
the devices against which the context is to be created (only if the
cl_khr_d3d11_sharing
extension is supported).
SpecificationOpenCL SpecificationAlso seeclGetDeviceIDs,
clCreateContextFromType,
clRetainContext,
clReleaseContext,
clGetContextInfo,
Cardinality Diagram
khronos-opencl-man-1.0~svn27110/recip.xml 0000644 0001750 0001750 00000013462 11660441607 020115 0 ustar mathieu mathieu
half_recip, native_reciphalf_recip, native_recip2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3half_recip, native_recip
Floating point reciprocal.
gentype
half_recip
gentypex
gentype
native_recip
gentypexDescriptionThe half_recip computes reciprocal.native_recip computes reciprocal over an implementation-defined
range. The maximum error is implementation-defined.
Notes
This built-in math function takes scalar or vector arguments. The generic type name
gentype is used to indicate that the function can take float,
float2, float4, float8, or float16
as the type for the arguments. For any specific use of these function, the actual type
has to be the same for all arguments and the return type.
Functions with the half_ prefix are implemented with a minimum of
10-bits of accuracy i.e. an ULP value less than or equal to 8192 ulp.
Functions with the native__ prefix may map to one or more native device
instructions and will typically have better performance compared to the corresponding
functions (without the native__ prefix). The accuracy (and in some
cases the input range(s)) of these functions is implementation-defined.
The vector versions of the math functions operate component-wise. The description is
per-component.
The built-in math functions are not affected by the prevailing rounding mode in the
calling environment, and always return the same value as they would if called with the
round to nearest even rounding mode.
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/get_num_groups.xml 0000644 0001750 0001750 00000011072 11660441607 022043 0 ustar mathieu mathieu
get_num_groupsget_num_groups2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_num_groups
Returns the number of work-groups that will execute a kernel.
size_t
get_num_groups
uintdimindxDescription
Returns the number of work-groups that will execute a kernel for dimension identified
by dimindx. Valid values of dimindx are 0 to
get_work_dim() - 1. For other
values of dimindx, get_num_groups() returns 1.
For clEnqueueTask, this
always returns 1.
SpecificationOpenCL SpecificationAlso seeWork-Item Functions,
clEnqueueNDRangeKernel,
clEnqueueTask
khronos-opencl-man-1.0~svn27110/clamp.xml 0000644 0001750 0001750 00000015760 11660441607 020112 0 ustar mathieu mathieu
]>
clampclamp2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clamp
Clamp x to range given by min, max
gentype
clamp
gentypexgentypeminvalgentypemaxval
gentypef
clamp
gentypefxfloatminvalfloatmaxval
gentyped
clamp
gentypedxdoubleminvaldoublemaxvalgentypeclamp (gentypex,
gentypeminval,
gentypemaxval) // if half extension enabled
gentypeclamp (gentypex,
halfminval,
halfmaxval) // if half extension enabled
Description
Returns min(fmax(x,
minval), maxval).
Results are undefined if minval > maxval.
Notes
&commonFunctionsInc;
If extended with cl_khr_fp16,
generic type name gentype may indicate half and
half{2|3|4|8|16} as arguments and return values.
SpecificationOpenCL SpecificationAlso seeCommon Functions
khronos-opencl-man-1.0~svn27110/local.xml 0000644 0001750 0001750 00000013434 11660441607 020104 0 ustar mathieu mathieu
[
]>
__local__local2007-2011yThe Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3__local
Address Space Qualifier.
__local
local
Description
&qualifierInc;
Notes
The __local or local address space name is
used to describe variables that need to be allocated in local memory and are shared by
all work-items of a work-group. Pointers to the __local address
space are allowed as arguments to functions (including __kernel
functions). Variables allocated in the __local address space can
also be defined inside a __kernel function scope.
Example
&qualifierExampleInc;
// Examples of variables allocated in the __local address space
// inside a __kernel function
__kernel void my_func(...)
{
__local float a; // A single float allocated
// in local address space
__local float b[10]; // An array of 10 floats
// allocated in local address space.
if (...)
{
// example of variable in __local address space but not
// declared at __kernel function scope.
__local float c; // not allowed.
}
}
Variables allocated in the __local address space inside a
__kernel function cannot be initialized.
__kernel void my_func(...)
{
local float a = 1; // not allowed __local float b; b = 1; // allowed
}
NOTE: Variables allocated in the __local address
space inside a __kernel function are allocated for each work-group executing
the kernel.SpecificationOpenCL SpecificationAlso see__global,
__constant,
__private
khronos-opencl-man-1.0~svn27110/atom_dec.xml 0000644 0001750 0001750 00000017223 11660441607 020565 0 ustar mathieu mathieu
atom_decatom_dec2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3atom_dec
64-bit atom_dec functions.
long
atom_dec
volatile __global
long*plongval
long
atom_dec
volatile __local
long*plongval
ulong
atom_dec
volatile __global
ulong*pulongval
ulong
atom_dec
volatile __local
ulong*pulongvalDescription
Read the 64-bit value (referred to as old) stored at location pointed by
p. Compute (old - 1) and store
result at location pointed by p. The function returns old.
An application that wants to use this extension will need to include the #pragma
OPENCL EXTENSION cl_khr_int64_base_atomics : enable in the OpenCL program source.
This function is performed in one atomic transaction. These transactions are atomic for the device
executing these atomic functions. There is no guarantee of atomicity if the atomic operations to
the same memory location are being performed by kernels executing on multiple devices.
Atomic operations on 64-bit integers and 32-bit integers (and float) are also atomic with regard to each other.
SpecificationOpenCL SpecificationAlso seeAtomic Functions,
atomic_dec,
cl_khr_int64_base_atomics
khronos-opencl-man-1.0~svn27110/gl_lifetimeInc.xml 0000644 0001750 0001750 00000002506 11660441607 021722 0 ustar mathieu mathieu
Lifetime of Shared Objects
An OpenCL memory object created from an OpenGL object
(hereinafter refered to as a “shared CL/GL objectâ€) remains valid as long as the
corresponding GL object has not been deleted. If the GL object is deleted through the GL
API (e.g. glDeleteBuffers, glDeleteTextures,
or glDeleteRenderbuffers), subsequent use of the CL buffer or image
object will result in undefined behavior, including but not limited to possible CL errors
and data corruption, but may not result in program termination.
The CL context and corresponding command-queues are dependent
on the existence of the GL share group object, or the share group associated with the
GL context from which the CL context is created. If the GL share group object or all GL
contexts in the share group are destroyed, any use of the CL context or command-queue(s)
will result in undefined behavior, which may include program termination. Applications
should destroy the CL command-queue(s) and CL context before destroying the corresponding
GL share group or contexts.
khronos-opencl-man-1.0~svn27110/write_image3d.xml 0000644 0001750 0001750 00000025237 11660441607 021541 0 ustar mathieu mathieu
[
]>
write_image3dwrite_image (3D)2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3write_image
Write color value to location in a 3D image object.
void
write_imagef
image3d_t
image
int4
coord
float4
color
void
write_imagei
image3d_t
image
int4
coord
int4
color
void
write_imageui
image3d_t
image
int4
coord
uint4
color
void
write_imageh
image3d_t
image
int4
coord
half4
colorDescription
Writes to a 3D image memory object are only supported when the
cl_khr_3d_image_writes
extension is implemented. Reads and writes to the same 3D image memory object are
not allowed in a kernel.
An application that wants to use this extension to write to 3D
image memory objects will need to include the #pragma OPENCL EXTENSION
cl_khr_3d_image_writes
: enable directive in the OpenCL program source.
These functions write color value to location specified by coordinate (x,
y, z) in the 3D image object specified by image. Appropriate
data format conversion to the specified image format is done before writing
the color value. coord.x, coord.y and
coord.z are considered to be unnormalized coordinates and must
be in the range 0 ... image width - 1, 0 ... image height - 1 and 0 ... image depth - 1.
write_imagef can only be used with image objects created with
image_channel_data_type set to one of the pre-defined packed formats
or set to CL_SNORM_INT8, CL_UNORM_INT8,
CL_SNORM_INT16, CL_UNORM_INT16,
CL_HALF_FLOAT or CL_FLOAT. Appropriate
data format conversion will be done to convert channel data from a floating-point
value to actual data format in which the channels are stored.
write_imagei can only be used with image objects created with
image_channel_data_type set to one of the following values:
CL_SIGNED_INT8, CL_SIGNED_INT16, or
CL_SIGNED_INT32.
write_imageui can only be used with image objects created with
image_channel_data_type set to one of the following values:
CL_UNSIGNED_INT8, CL_UNSIGNED_INT16,
or CL_UNSIGNED_INT32.
The behavior of write_imagef, write_imagei
and write_imageui for image objects with
image_channel_data_type values not specified in the description
above or with (x, y, z) coordinate values that are not in the range
(0 ... image width - 1, 0 ... image height - 1, 0 ... image depth - 1), respectively,
is undefined.
write_imageh can only be used with image objects created with
image_channel_data_type set to one of the pre-defined packed formats
or set to CL_SNORM_INT8, CL_UNORM_INT8,
CL_SNORM_INT16, CL_UNORM_INT16 or
CL_HALF_FLOAT.
The behavior of write_imageh for image objects created with
image_channel_data_type values not specified in the description
above or with (x, y, z) coordinate values that are not in the
range (0 ... image width - 1, 0 ... image height - 1, 0 ... image depth - 1),
respectively, is undefined.
An application that wants to use half and
halfn types will need to include the
#pragma OPENCL EXTENSION cl_khr_fp16 : enable directive.
SpecificationOpenCL SpecificationAlso seeImage Functions,
cl_khr_3d_image_writesscalarDataTypes
khronos-opencl-man-1.0~svn27110/get_image_array_size.xml 0000644 0001750 0001750 00000010604 11660441607 023157 0 ustar mathieu mathieu
get_image_array_sizeget_image_array_size2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_image_array_size
Return the number of images in an image array.
size_t
get_image_array_size
image2d_array_t
image
size_t
get_image_array_size
image1d_array_t
imageDescriptionget_image_array_size with
image2d_t
returns the number of images in a 2D image array.
get_image_array_size with
image1d_t
returns the number of images in a 1D image array.
SpecificationOpenCL SpecificationAlso seeImage Functions
khronos-opencl-man-1.0~svn27110/ldexp.xml 0000644 0001750 0001750 00000025547 11660441607 020136 0 ustar mathieu mathieu
ldexpldexp2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3ldexp
Multiply x by 2 to the power k.
floatn
ldexp
floatnx
intnk
floatn
ldexp
floatnx
int
k
float
ldexp
float
x
int
k
doublen
ldexp
doublenx
intnk
doublen
ldexp
doublenx
int
k
double
ldexp
double
x
int
n
halfn
ldexp
halfnx
intnk
halfn
ldexp
halfnx
int
k
half
ldexp
half
x
int
kDescription
Multiply x by 2 to the power k.
Notes
The vector versions of the math functions operate component-wise. The description
is per-component.
The built-in math functions are not affected by the prevailing rounding mode in the
calling environment, and always return the same value as they would if called with
the round to nearest even rounding mode.
The built-in math functions take scalar or vector arguments. The generic type name
gentype is used to indicate that the function can take float,
float2, float3, float4, float8,
or float16 as the type for the arguments. For any specific use of these
function, the actual type has to be the same for all arguments and the return type.
If extended with cl_khr_fp16,
generic type name gentype may indicate half and
half{2|3|4|8|16} as arguments and return values.
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/clCreateContextFromType.xml 0000644 0001750 0001750 00000105104 11660441607 023563 0 ustar mathieu mathieu
clCreateContextFromType
clCreateContextFromType
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clCreateContextFromType
Create an OpenCL context from a device type that identifies the specific device(s) to use.
cl_context
clCreateContextFromType
const cl_context_properties*propertiescl_device_type
device_typevoid
(CL_CALLBACK *pfn_notify)
(const char *errinfoconst void
*private_infosize_t
cbvoid
*user_data)void
*user_datacl_int
*errcode_retParametersproperties
Specifies a list of context property names and their corresponding values.
Each property name is immediately followed by the corresponding desired
value. The list of supported properties is described in the table
below. properties can also be NULL in which case the
platform that is selected is implementation-defined.
If the
cl_khr_gl_sharing
extension is supported, properties
points to an attribute list whose format and valid contents
are identical to the properties argument of
clCreateContext
which is: properties specifies a list of context property
names and their corresponding values. Each property name is immediately
followed by the corresponding desired value. The list is terminated
with 0. The list of supported properties is described in the table
below. properties can be NULL in which case the platform
that is selected is implementation-defined.
cl_context_properties enumProperty valueDescriptionCL_CONTEXT_PLATFORMcl_platform_idSpecifies the platform to use.CL_CONTEXT_INTEROP_USER_SYNCcl_boolSpecifies whether the user is responsible for synchronization
between OpenCL and other APIs. Please refer to the specific sections
in the OpenCL 1.2 extension specification that describe sharing with
other APIs for restrictions on using this flag. If
CL_CONTEXT_INTEROP_USER_SYNC is not specified, a
default of CL_FALSE is assumed.CL_CONTEXT_D3D10_DEVICE_KHRID3D10Device *
Specifies the ID3D10Device * to use for Direct3D 10
interoperability. The default value is NULL (applies if the extension
cl_khr_d3d10_sharing
is supported)
CL_CONTEXT_ADAPTER_D3D9_KHRIDirect3DDevice9 *
Specifies an IDirect3DDevice9
to use for D3D9 intero (applies if the
cl_khr_dx9_media_sharing
extension is supported)
CL_CONTEXT_ADAPTER_D3D9EX_KHRIDirect3DDeviceEx*
Specifies an IDirect3DDevice9Ex
to use for D3D9 interop (applies if the
cl_khr_dx9_media_sharing
extension is supported)
CL_CONTEXT_ADAPTER_DXVA_KHRIDXVAHD_Device *
Specifies an IDXVAHD_Device
to use for DXVA interop (applies if the
cl_khr_dx9_media_sharing
extension is supported)
CL_GL_CONTEXT_KHR0, OpenGL context handle
OpenGL context to associated
the OpenCL context with (available if the
cl_khr_gl_sharing
extension is enabled)
CL_CGL_SHAREGROUP_KHR0, CGL share group handle
CGL share group to associate
the OpenCL context with (available if the
cl_khr_gl_sharing
extension is enabled)
CL_EGL_DISPLAY_KHREGL_NO_DISPLAY, EGLDisplay handle
CGL share group to associate
the OpenCL context with (available if the
cl_khr_gl_sharing
extension is enabled)
CL_GLX_DISPLAY_KHRNone, X handle
X Display an OpenGL context was
created with respect to (available if the
cl_khr_gl_sharing
extension is enabled)
CL_WGL_HDC_KHR0, HDC handle
HDC an OpenGL context was created with respect to (available if the
cl_khr_gl_sharing
extension is enabled)
CL_CONTEXT_D3D11_DEVICE_KHRID3D11Device *
Specifies the ID3D11Device * to use for Direct3D
11 interoperability. The default value is NULL * (applies if the
cl_khr_d3d11_sharing
extension is supported)
device_type
A bit-field that identifies the type of device and is described in the table below.
cl_device_typeDescriptionCL_DEVICE_TYPE_CPU
An OpenCL device that is the host processor. The host processor
runs the OpenCL implementations and is a single or multi-core CPU.
CL_DEVICE_TYPE_GPU
An OpenCL device that is a GPU. By this we mean that the device
can also be used to accelerate a 3D API such as OpenGL or DirectX.
CL_DEVICE_TYPE_ACCELERATOR
Dedicated OpenCL accelerators (for example the IBM CELL Blade). These
devices communicate with the host processor using a peripheral
interconnect such as PCIe.
CL_DEVICE_TYPE_CUSTOM
Dedicated accelerators that do not support programs written in
OpenCL C.
CL_DEVICE_TYPE_DEFAULT
The default OpenCL device in the system. The default device cannot
be a CL_DEVICE_TYPE_CUSTOM device.
CL_DEVICE_TYPE_ALL
All OpenCL devices available in the system except
CL_DEVICE_TYPE_CUSTOM devices.
pfn_notify
A callback function that can be registered by the application. This callback
function will be used by the OpenCL implementation to report information
on errors that occur in this context. This callback function may be called
asynchronously by the OpenCL implementation. It is the application's
responsibility to ensure that the callback function is thread-safe.
If pfn_notify is NULL, no callback function is registered.
The parameters to this callback function are:
errinfo is a pointer to an error string.private_info and cb represent a pointer
to binary data that is returned by the OpenCL implementation that can be used
to log additional information helpful in debugging the error.
user_data is a pointer to user supplied data.
There are a number of cases where error notifications need to be delivered
due to an error that occurs outside a context. Such notifications may not
be delivered through the pfn_notify callback. Where these
notifications go is implementation-defined.
user_data
Passed as the user_data argument when
pfn_notify is called. user_data can be NULL.
errcode_ret
Return an appropriate error code. If errcode_ret is NULL, no error code is returned.
Description
Only devices that are returned by
clGetDeviceIDs for
device_type are used to create the context. The context does not
reference any sub-devices that may have been created from these devices.
NotesclCreateContextFromType may return all or a subset of the actual
physical devices present in the platform and that match device_type.
clCreateContextFromType and
clCreateContext perform an
implicit retain. This is very helpful for 3rd party libraries, which typically get a
context passed to them by the application. However, it is possible that the application
may delete the context without informing the library. Allowing functions to attach to
(i.e. retain) and release a context solves the problem of a context being used by a
library no longer being valid.
ErrorsclCreateContextFromType returns a valid non-zero context and
errcode_ret is set to CL_SUCCESS if the
context is created successfully. Otherwise, it returns a NULL value with the following
error vlaues returned in errcode_ret:
CL_INVALID_PLATFORM if properties
is NULL and no platform could be selected or if platform value specified
in properties is not a valid platform. If the
cl_khr_gl_sharing
extension is supported, this error is replaced (or not) by
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR and possibly
CL_INVALID_OPERATION (see below and section 9.6.4 of the
spec for clarification).
CL_INVALID_PROPERTY if context property name in
properties is not a supported property name, or if the value
specified for a supported property name is not valid, or if the same property
name is specified more than once.
CL_INVALID_VALUE if pfn_notify is NULL
but user_data is not NULL.
CL_INVALID_DEVICE_TYPE if device_type
is not a valid value.
CL_DEVICE_NOT_AVAILABLE if no devices that
match device_type and property values specified in
properties are currently available.
CL_DEVICE_NOT_FOUND if no devices that match
device_type and property values specified in
properties were found.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
CL_INVALID_D3D10_DEVICE_KHR if the Direct3D
10 device specified for interoperability is not compatible with
the devices against which the context is to be created (if the
cl_khr_d3d10_sharing
extension is enabled).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR when an invalid OpenGL
context or share group object handle is specified in properties
if the cl_khr_gl_sharing
extension is enabled.
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR: If
no OpenGL or OpenGL ES context or share group is specified in the
attribute list, then memory objects may not be shared, and calling
any of the commands in section 9.7 will result in this error (if the
cl_khr_gl_sharing
extension is enabled).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR if the
cl_khr_gl_sharing
extension is enabled and if a context was specified by any of the following
means:
Context specified for an EGL-based OpenGL ES or OpenGL implementation
by setting the attributes CL_GL_CONTEXT_KHR and
CL_EGL_DISPLAY_KHR.
Context was specified for a GLX-based OpenGL implementation by
setting the attributes CL_GL_CONTEXT_KHR and
CL_GLX_DISPLAY_KHR.
Context was specified for a WGL-based OpenGL implementation by
setting the attributes CL_GL_CONTEXT_KHR and
CL_WGL_HDC_KHR.
and any of the following conditions hold:
The specified display and context attributes do not identify a valid
OpenGL or OpenGL ES context.
The specified context does not support buffer and renderbuffer objects.
The specified context is not compatible with the OpenCL context being
created (for example, it exists in a physically distinct address space,
such as another hardware device, or does not support sharing data with
OpenCL due to implementation restrictions).
CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR
if a share group was specified for a CGL-based OpenGL implementation by
setting the attribute CL_CGL_SHAREGROUP_KHR, and the
specified share group does not identify a valid CGL share group object (only if
the cl_khr_gl_sharing
extension is enabled).
CL_INVALID_DX9_MEDIA_ADAPTER_KHR if the
media adapter specified for interoperability is not compatible with
the devices against which the context is to be created (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_ADAPTER_KHR if
any of the values of the properties CL_CONTEXT_ADAPTER_D3D9_KHR,
CL_CONTEXT_ADAPTER_D3D9EX_KHR or
CL_CONTEXT_ADAPTER_DXVA_KHR is non-NULL and
does not specify a valid media adapter with which the cl_device_ids
against which this context is to be created may interoperate. (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_OPERATION if interoperability is
specified by setting CL_CONTEXT_ADAPTER_D3D9_KHR,
CL_CONTEXT_ADAPTER_D3D9EX_KHR or
CL_CONTEXT_ADAPTER_DXVA_KHR to a non-NULL value, and
interoperability with another graphics API is also specified. (only if the
cl_khr_dx9_media_sharing
extension is supported).
CL_INVALID_D3D11_DEVICE_KHR if the Direct3D
11 device specified for interoperability is not compatible with
the devices against which the context is to be created (only if the
cl_khr_d3d11_sharing
extension is supported).
CL_INVALID_OPERATION
if Direct3D 11 interoperability is specified by setting
CL_INVALID_D3D11_DEVICE_KHR to a non-NULL value, and
interoperability with another graphics API is also specified. (only if the
cl_khr_d3d11_sharing
extension is supported).
CL_INVALID_D3D11_DEVICE_KHR if the value of the property
CL_CONTEXT_D3D11_DEVICE_KHR is non-NULL and does not specify
a valid Direct3D 11 device with which the cl_device_ids
against which this context is to be created may interoperate. (only if the
cl_khr_d3d11_sharing
extension is supported).
SpecificationOpenCL SpecificationAlso seeclCreateContext,
clGetContextInfo,
clReleaseContext,
clRetainContext,
clGetContextInfo,
Cardinality Diagram
khronos-opencl-man-1.0~svn27110/isless.xml 0000644 0001750 0001750 00000017451 11660441607 020317 0 ustar mathieu mathieu
]>
islessisless2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3isless
Compare of x < y.
int
isless
floatxfloaty
intn
isless
floatnxfloatny
int
isless
doublexdoubley
longn
isless
doublenxdoublenyintisless
(halfx,
halfy) // if half extension enabled
shortnisless
(halfnx,
halfny) // if half extension enabled
Description
Returns the component-wise compare of x < y.
Notes
&relationalFunctionsInc1;
&relationalFunctionsInc2;
&relationalFunctionsInc3;
SpecificationOpenCL SpecificationAlso seeRelational Functions
khronos-opencl-man-1.0~svn27110/clGetEventProfilingInfo.xml 0000644 0001750 0001750 00000031130 11660441607 023531 0 ustar mathieu mathieu
clGetEventProfilingInfo
clGetEventProfilingInfo
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clGetEventProfilingInfo
Returns profiling information for the command associated with event if profiling is enabled.
cl_int
clGetEventProfilingInfocl_eventeventcl_profiling_infoparam_namesize_tparam_value_sizevoid*param_valuesize_t*param_value_size_retParameterseventSpecifies the event object.param_nameSpecifies the profiling data to query. The list of supported
param_name types and the information returned in
param_value by clGetEventProfilingInfo
is described in the table of parameter queries below.
param_value_size
Specifies the size in bytes of memory pointed to by
param_value. This size must be ≥ size of return
type as described in the table below.
param_value
A pointer to memory where the appropriate result being queried is returned.
if param_value is NULL, it is ignored.
param_value_size_ret
Returns the actual size in bytes of data copied to
param_value. If param_value_size_ret
is NULL, it is ignored.
The following is a table of clGetEventProfilingInfo
parameter queries
cl_profiling_infoReturn TypeInfo. returned in param_valueCL_PROFILING_COMMAND_QUEUEDcl_ulong
A 64-bit value that describes the current device time counter in
nanoseconds when the command identified by event
is enqueued in a command-queue by the host.
CL_PROFILING_COMMAND_SUBMITcl_ulong
A 64-bit value that describes the current device time counter in
nanoseconds when the command identified by event
that has been enqueued is submitted by the host to the device associated
with the command-queue.
CL_PROFILING_COMMAND_STARTcl_ulong
A 64-bit value that describes the current device time counter in
nanoseconds when the command identified by event
starts execution on the device.
CL_PROFILING_COMMAND_ENDcl_ulong
A 64-bit value that describes the current device time counter in
nanoseconds when the command identified by event
has finished execution on the device.
Notes
The unsigned 64-bit values returned can be used to measure the time in nano-seconds
consumed by OpenCL commands.
OpenCL devices are required to correctly track time across changes in device frequency
and power states. The CL_DEVICE_PROFILING_TIMER_RESOLUTION
specifies the resolution of the timer i.e. the number of nanoseconds elapsed before
the timer is incremented.
Event objects can be used to capture profiling information that measure execution
time of a command. Profiling of OpenCL commands can be enabled either by using a
command-queue created with CL_QUEUE_PROFILING_ENABLE
flag set in properties argument to
clCreateCommandQueue.
Errors
Returns CL_SUCCESS if the function is executed successfully
and the profiling information has been recorded. Otherwise, it returns one of the
following errors:
CL_PROFILING_INFO_NOT_AVAILABLE if the
CL_QUEUE_PROFILING_ENABLE flag is not set for the command-queue,
if the execution status of the command identified by event
is not CL_COMPLETE or if event is a user
event object.
CL_INVALID_VALUE if param_name is not
valid, or if size in bytes specified by param_value_size
is < size of return type as described in the above table and
param_value is not NULL.
CL_INVALID_EVENT if event is a not a
valid event object.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclCreateCommandQueue
khronos-opencl-man-1.0~svn27110/clSetMemObjectDestructorCallback.xml 0000644 0001750 0001750 00000027625 11660441607 025355 0 ustar mathieu mathieu
clSetMemObjectDestructorCallbackclSetMemObjectDestructorCallback2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clSetMemObjectDestructorCallback
Registers a user callback function with a memory object.
cl_int
clSetMemObjectDestructorCallbackcl_memmemobjvoid (CL_CALLBACK *pfn_notify)
(cl_mem memobjvoid*user_data)void*user_dataParametersmemobjA valid memory object.pfn_notify
The callback function that can be registered by the application. This
callback function may be called asynchronously by the OpenCL implementation.
It is the application's responsibility to ensure that the callback function
is thread-safe. The parameters to this callback function are:
memobj: the memory object being deleted.
When the user callback is called by the implementation, this memory object is
no longer valid. memobj is only provided for reference purposes.
user_data: a pointer to user supplied data.
user_data
Data which will be passed as the user_data
argument when pfn_notify is called. user_data can be NULL.
Notes
Each call to clSetMemObjectDestructorCallback registers
the specified user callback function on a callback stack associated with
memobj. The registered user callback functions are called in the
reverse order in which they were registered. The user callback functions are called
and then the memory object's resources are freed and the memory object is deleted. This
provides a mechanism for the application (and libraries) using memobj
to be notified when the memory referenced by host_ptr, specified
when the memory object is created and used as the storage bits for the memory object,
can be reused or freed.
When the user callback function is called by the implementation, the contents of
the memory region pointed to by host_ptr (if the memory object is
created with CL_MEM_USE_HOST_PTR) are undefined. The callback
function is typically used by the application to either free or reuse the memory
region pointed to by host_ptr.
The behavior of calling expensive system routines, OpenCL API calls to create contexts
or command-queues, or blocking OpenCL operations from the following list below,
in a callback is undefined.
clFinishclWaitForEvents
blocking calls to
clEnqueueReadBuffer,
clEnqueueReadBufferRect,
clEnqueueWriteBuffer,
clEnqueueWriteBufferRect
blocking calls to
clEnqueueReadImage and
clEnqueueWriteImage
blocking calls to
clEnqueueMapBuffer and
clEnqueueMapImage
blocking calls to
clBuildProgram,
clCompileProgram, or
clLinkProgram
If an application needs to wait for completion of a routine from the above list in a
callback, please use the non-blocking form of the function, and assign a completion
callback to it to do the remainder of your work. Note that when a callback (or other
code) enqueues commands to a command-queue, the commands are not required to begin
execution until the queue is flushed. In standard usage, blocking enqueue calls serve
this role by implicitly flushing the queue. Since blocking calls are not permitted in
callbacks, those callbacks that enqueue commands on a command queue should either
call clFlush
on the queue before returning or arrange for
clFlush to be called
later on another thread.
The user callback function may not call OpenCL APIs with the memory object for which
the callback function is invoked and for such cases the behavior of OpenCL APIs is
considered to be undefined.
Errors
Returns CL_SUCCESS if the function is executed
successfully. Otherwise, it returns one of the following errors:
CL_INVALID_MEM_OBJECT if memobj is not a valid memory object.
CL_INVALID_VALUE if pfn_notify is NULL.
CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the
OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the
OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclCreateCommandQueue,
clGetCommandQueueInfo,
clReleaseCommandQueue,
clRetainCommandQueue
khronos-opencl-man-1.0~svn27110/trunc.xml 0000644 0001750 0001750 00000007701 11660441607 020145 0 ustar mathieu mathieu
]>
trunctrunc2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3trunc
Round to integer toward zero.
gentype
trunc
gentypeDescription
Round to integral value using the round to zero rounding mode.
Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/clGetDeviceIDsFromD3D11KHR.xml 0000644 0001750 0001750 00000030215 11660441607 023412 0 ustar mathieu mathieu
]>
clGetDeviceIDsFromD3D11KHRclGetDeviceIDsFromD3D11KHR2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clGetDeviceIDsFromD3D11KHRQuerying OpenCL Devices Corresponding to Direct3D 11 Devices.
cl_int
clGetDeviceIDsFromD3D11KHRcl_platform_idplatformcl_d3d11_device_source_khrd3d_device_sourcevoid*d3d_objectcl_d3d11_device_set_khrd3d_device_setcl_uintnum_entriescl_device_id*devicescl_uint*num_devicesParametersplatform
Refers to the platform ID returned by
clGetPlatformIDs.
d3d_device_source
Specifies the type of d3d_object and may be one of the following:.
cl_d3d_device_source_khrType of d3d_objectCL_D3D11_DEVICE_KHRID3D11Device *CL_D3D11_DXGI_ADAPTER_KHRIDXGIAdapter *d3d_object
Specifies the object whose corresponding OpenCL devices are being queried. The type of
d3d_object must be as specified in the table above.
d3d_device_set
Specifies the set of devices to return, and must be one of the following:
cl_d3d_device_set_khrDevices returned in devicesCL_PREFERRED_DEVICES_FOR_D3D11_KHR
The OpenCL devices associated with the specified Direct3D object.
CL_ALL_DEVICES_FOR_D3D11_KHR
All OpenCL devices which may interoperate with the specified Direct3D object.
Performance of sharing data on these devices may be considerably less than on the
preferred devices.
num_entries
The number of cl_device_id entries that can be added to
devices. If devices is not NULL, the
num_entries must be greater than zero.
devices
Returns a list of OpenCL devices found. The cl_device_id values
returned in devices can be used to identify a specific
OpenCL device. If devices is NULL, this argument is
ignored. The number of OpenCL devices returned is the mininum of the value
specified by num_entries and the number of OpenCL devices
corresponding to d3d_object.
num_devices
Returns the number of OpenCL devices available that correspond to
d3d_object. If num_devices is NULL,
this argument is ignored.
Description
The OpenCL devices corresponding to a Direct3D 11 device may be queried. The OpenCL
devices corresponding to a DXGI adapter may also be queried. The OpenCL devices
corresponding to a Direct3D 11 device will be a subset of the OpenCL devices
corresponding to the DXGI adapter against which the Direct3D 11 device was created.
Notes
&sharingD3D11Inc;
&accessMappedInc;
Errors
Returns CL_SUCCESS if the function is executed
successfully. Otherwise it may return:
CL_INVALID_PLATFORM if platform is not
a valid platform.
CL_INVALID_VALUE if d3d_device_source
is not a valid value, d3d_device_set is not a valid value,
num_entries is equal to zero and devices is
not NULL, or if both num_devices and devices
are NULL.
CL_DEVICE_NOT_FOUND if no OpenCL devices that correspond
to d3d_object were found.
SpecificationOpenCL SpecificationAlso seecl_khr_d3d11_sharing,
clCreateFromD3D11BufferKHR,
clCreateFromD3D11Texture2DKHR,
clCreateFromD3D11Texture3DKHR,
clEnqueueAcquireD3D11ObjectsKHR,
clEnqueueReleaseD3D11ObjectsKHR
khronos-opencl-man-1.0~svn27110/attributes-types.xml 0000644 0001750 0001750 00000026101 11660441607 022335 0 ustar mathieu mathieu
Attributes of TypesAttributes of Types2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3Attributes of Types
Attributes of Types.
__attribute__ ((aligned))
__attribute__ ((aligned (n)))
__attribute__ ((packed))
Description
The keyword __attribute__ allows you to specify special attributes
of enum, struct and union types when you
define such types. This keyword is followed by an attribute specification inside
double parentheses. Two attributes are currently defined for types: aligned, and packed.
You may specify type attributes in an enum, struct,
or union type declaration or definition, or for other types in a
typedef declaration.
For an enum, struct, or union type, you
may specify attributes either between the enum, struct
or union tag and the name of the type, or just past the closing curly
brace of the definition. The former syntax is preferred.
aligned (alignment)
This attribute specifies a minimum alignment (in bytes) for variables of the specified
type. For example, the declarations:
struct S { short f[3]; } __attribute__ ((aligned (8)));
typedef int more_aligned_int __attribute__ ((aligned (8)));
force the compiler to ensure (as far as it can) that each variable whose type is
struct S or more_aligned_int will be allocated and aligned
at least on a 8-byte boundary.
Note that the alignment of any given struct or union type
is required by the ISO C standard to be at least a perfect multiple of the lowest
common multiple of the alignments of all of the members of the struct
or union in question and must also be a power of two. This means that
you can effectively adjust the alignment of a struct
or union type by attaching an aligned attribute to any one of the members
of such a type, but the notation illustrated in the example above is a more obvious,
intuitive, and readable way to request the compiler to adjust the alignment of an entire
struct or union type.
As in the preceding example, you can explicitly specify the alignment (in bytes) that
you wish the compiler to use for a given struct or union
type. Alternatively, you can leave out the alignment factor and just ask the compiler
to align a type to the maximum useful alignment for the target machine you are compiling
for. For example, you could write:
struct S { short f[3]; } __attribute__ ((aligned));
Whenever you leave out the alignment factor in an aligned attribute
specification, the compiler automatically sets the alignment for the type to the largest
alignment which is ever used for any data type on the target machine you are compiling
for. In the example above, the size of each short is 2 bytes, and therefore
the size of the entire struct S type is 6 bytes. The smallest power of two
which is greater than or equal to that is 8, so the compiler sets the alignment for the
entire struct S type to 8 bytes.
Note that the effectiveness of aligned attributes may be limited by inherent limitations
of the OpenCL device and compiler. For some devices, the OpenCL compiler may only be
able to arrange for variables to be aligned up to a certain maximum alignment. If the
OpenCL compiler is only able to align variables up to a maximum of 8 byte alignment, then
specifying aligned(16) in an __attribute__ will still only provide
you with 8 byte alignment. See your platform-specific documentation for further information.
The aligned attribute can only increase the alignment; but you can decrease
it by specifying packed as well. See below.
packed
The packed attribute, attached to the struct
or union type definition, specifies that each member of the structure or
union is placed to minimize the memory required. When attached to an enum
definition, it indicates that the smallest integral type should be used.
Specifying this attribute for struct and union types is equivalent
to specifying the packed attribute on each of the structure or union members.
In the following example struct my_packed_struct's members are packed closely
together, but the internal layout of its s member is not packed. To do that,
struct my_unpacked_struct would need to be packed, too.
struct my_unpacked_struct
{
char c; int i;
};
struct __attribute__ ((packed)) my_packed_struct
{
char c;
int i;
struct my_unpacked_struct s;
};
You may only specify this attribute on the definition of a enum,
struct, or union, not on a typedef which does not
also define the enumerated type, structure or union.
SpecificationOpenCL SpecificationAlso see__attribute__,
Blocks and Control-Flow Statement Attributes Attributes,
Variable Attributes
khronos-opencl-man-1.0~svn27110/mag.xml 0000644 0001750 0001750 00000012205 11660441607 017551 0 ustar mathieu mathieu
]>
maxmag, minmagmaxmag, minmag2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3maxmag, minmag
Returns the argument with the greatest (or least) magnitude.
gentype
maxmag
gentypexgentypey
gentype
minmag
gentypexgentypeyDescriptionmaxmag Returns x if | x| >
|y|, or y if |y| >
|x|,
otherwise fmax(x, y).
minmag Returns x if |x| <
|y|, or y if |y| <
|x|,
otherwise fmin(x, y).
Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/cl_khr_fp16.xml 0000644 0001750 0001750 00000031630 11660441607 021106 0 ustar mathieu mathieu
cl_khr_fp16cl_khr_fp162007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3cl_khr_fp16
Optional half floating-point support.
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
Description
This extension adds support for half scalar and vector types as built-in types that
can be used for arithmetic operations, conversions, etc. An application that wants
to use half and halfn types will
need to include the directive shown above.
The list of built-in scalar and vector data types are extended to include the types
in the table below.
The built-in vector data types for halfn are also declared as
appropriate types in the OpenCL API (and header files) that can be used by an
application. The following table describes the built-in vector data types for
halfn as defined in the OpenCL C programming
language and the corresponding data type available to the application:
Type in OpenCL LanguageDescriptionAPI type for applicationhalf22-component half-precision floating-point
vectorcl_half2half33-component half-precision floating-point vectorcl_half3half44-component half-precision floating-point
vectorcl_half4half88-component half-precision floating-point
vectorcl_half8half1616-component half-precision floating-point
vectorcl_half16
The relational, equality, logical and logical unary
operators can be used
with half scalar and halfn
vector types and shall produce a scalar int and vector
shortn result respectively.
The OpenCL compiler accepts an h and H suffix
on floating point literals, indicating the literal is typed as a half.
The macro names given in the following list must use the values specified. These constant
expressions are suitable for use in #if preprocessing directives.
The following table also describes the corresponding macro names available to the
application.
Macro in OpenCL LanguagevalueMacro for application#define HALF_DIG3HALF_DIG#define HALF_MANT_DIG11HALF_MANT_DIG#define HALF_MAX_10_EXP+4HALF_MAX_10_EXP#define HALF_MAX_EXP+16HALF_MAX_EXP#define HALF_MIN_10_EXP-4HALF_MIN_10_EXP#define HALF_MIN_EXP-13HALF_MIN_EXP#define HALF_RADIX2HALF_RADIX#define HALF_MAX0x1.ffcp15hHALF_MAX#define HALF_MIN0x1.0p-14hHALF_MIN#define HALF_EPSILON0x1.0p-10hHALF_EPSILON
The following constants are also available. They are of type half and
are accurate within the precision of the half type.
ConstantDescriptionM_E_HValue of eM_LOG2E_H Value of log2 eM_LOG10E_HValue of log10 eM_LN2_HValue of ln 2M_LN10_H Value of ln 10M_PI_H Value of πM_PI_2_HValue of π / 2M_PI_4_HValue of π / 4M_1_PI_HValue of 1 / πM_2_PI_HValue of 2 / πM_2_SQRTPI_HValue of 2 / √πM_SQRT2_HValue of √2M_SQRT1_2_HValue of 1 / √2
Ann application may query the configuration information using
the op-code CL_DEVICE_HALF_FP_CONFIG with
clGetDeviceInfo for an
OpenCL device that supports half precision floating-point.
SpecificationOpenCL SpecificationAlso seeEXTENSION,
clGetDeviceInfo,
mathFunctions,
commonFunctions,
geometricFunctions,
relationalFunctions,
vectorDataLoadandStoreFunctions,
asyncCopyFunctions,
imageFunctions
khronos-opencl-man-1.0~svn27110/attributes-variables.xml 0000644 0001750 0001750 00000027052 11660441607 023147 0 ustar mathieu mathieu
Attributes of VariablesAttributes of Variables2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3Attributes of Variables
Attributes of Variables.
__attribute__ ((aligned))
__attribute__ ((aligned (n)))
__attribute__ ((packed))
__attribute__ ((endian(host)))
__attribute__ ((endian(device)))
Description
The keyword __attribute__ allows you to specify special
attributes of variables or structure fields. This keyword is followed by an attribute
specification inside double parentheses. The aligned, packed,
and endian attribute qualifiers are defined below.
aligned (alignment)
This attribute specifies a minimum alignment for the variable or structure field, measured
in bytes. For example, the declaration:
int x __attribute__ ((aligned (16))) = 0;
causes the compiler to allocate the global variable x on a 16-byte boundary. The
alignment value specified must be a power of two.
You can also specify the alignment of structure fields. For example, to create double-word
aligned int pair, you could write:
struct foo { int x[2] __attribute__ ((aligned (8)));
};
This is an alternative to creating a union with a double member that forces
the union to be double-word aligned.
As in the preceding examples, you can explicitly specify the alignment (in bytes) that you
wish the compiler to use for a given variable or structure field. Alternatively, you can
leave out the alignment factor and just ask the compiler to align a variable or field to
the maximum useful alignment for the target machine you are compiling for. For example,
you could write:
short array[3] __attribute__ ((aligned));
Whenever you leave out the alignment factor in an aligned attribute
specification, the OpenCL compiler automatically sets the alignment for the declared
variable or field to the largest alignment which is ever used for any data type on the
target device you are compiling for.
When used on a struct, or struct member, the aligned
attribute can only increase the alignment; in order to decrease it,
the packed attribute must be specified as well. When used as part of a
typedef, the aligned attribute can both increase and decrease
alignment, and specifying the packed attribute will generate a warning.
Note that the effectiveness of aligned attributes may be limited by inherent limitations
of the OpenCL device and compiler. For some devices, the OpenCL compiler may only be
able to arrange for variables to be aligned up to a certain maximum alignment. If the
OpenCL compiler is only able to align variables up to a maximum of 8 byte alignment, then
specifying aligned(16) in an __attribute__ will still only provide
you with 8 byte alignment. See your platform-specific documentation for further information.
packed
The packed attribute specifies that a variable or structure field should
have the smallest possible alignment -- one byte for a variable, unless you specify a
larger value with the aligned attribute.
Here is a structure in which the field x is packed, so that it immediately
follows a:
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
An attribute list placed at the beginning of a user-defined type applies to the variable
of that type and not the type, while attributes following the type body apply to the type.
For example:
/* a has alignment of 128 */
__attribute__((aligned(128))) struct A {int i;} a;
/* b has alignment of 16 */
__attribute__((aligned(16))) struct B {double d;}
__attribute__((aligned(32))) b ;
struct A a1; /* a1 has alignment of 4 */
struct B b1; /* b1 has alignment of 32 */endian (endiantype)
The endian attribute determines the byte ordering of a variable.
endiantype can be set to host indicating the variable uses
the endianness of the host processor or can be set to device indicating
the variable uses the endianness of the device on which the kernel will be executed. The
default is device. For example:
float4 *p __attribute__ ((endian(host)));
specifies that data stored in memory pointed to by p will be in the host
endian format.
SpecificationOpenCL SpecificationAlso see__attribute__,
Blocks and Control-Flow Statement Attributes Attributes,
Types Attributes
khronos-opencl-man-1.0~svn27110/clCreateProgramWithBuiltInKernels.xml 0000644 0001750 0001750 00000021037 11660441607 025531 0 ustar mathieu mathieu
clCreateProgramWithBuiltInKernels
clCreateProgramWithBuiltInKernels
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clCreateProgramWithBuiltInKernels
Creates a program object for a context, and loads the information related to the built-in kernels
into a program object.
cl_program clCreateProgramWithBuiltInKernelscl_contextcontextcl_uintnum_devicesconst cl_device_id*device_listconst char*kernel_namescl_int*errcode_retParameters context
Must be a valid OpenCL context.
num_devices
The number of devices listed in device_list.
device_list
A pointer to a list of devices that are in context.
device_list must be a non-NULL
value. The built-in kernels are loaded for devices specified in this list.
The devices associated with the program object will be the list of devices specified by
device_list. The list of devices specified by
device_list must be devices associated with context.
kernel_names
A semi-colon separated list of built-in kernel names.
Errors
Returns a valid non-zero program object and errcode_ret is set
to CL_SUCCESS if the program object is created successfully.
Otherwise, it returns a NULL value with one of the following error values returned
in errcode_ret:
CL_INVALID_CONTEXT if context is not
a valid context.
CL_INVALID_VALUE if device_list is NULL
or num_devices is zero;
CL_INVALID_VALUE if kernel_names is NULL
or kernel_names contains a kernel name that is not supported
by any of the devices in device_list.
CL_INVALID_DEVICE if devices listed in
device_list are not in the list of devices associated with
context.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclCreateProgramWithSource,
clReleaseProgram,
clRetainProgram,
Cardinality Diagram
khronos-opencl-man-1.0~svn27110/relationalFunctionsIGEN.xml 0000644 0001750 0001750 00000000645 11660441607 023500 0 ustar mathieu mathieu
The argument type igentype refers to signed integer types,
i.e. char, charn,
short, shortn, int,
intn, long, and
longn.
khronos-opencl-man-1.0~svn27110/cl_khr_fp64.xml 0000644 0001750 0001750 00000010716 11660441607 021113 0 ustar mathieu mathieu
cl_khr_fp64cl_khr_fp642007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3cl_khr_fp64
Provided for backward compatibility if double floating-point precision is supported.
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
Description
The 64-bit double scalar and corresponding vector types are optional types
that are supported if CL_DEVICE_DOUBLE_FP_CONFIG
in the table of allowed values for param_name for
clGetDeviceInfo for a
device is not zero.
The double data type must confirm to the IEEE-754 double precision storage format.
SpecificationOpenCL SpecificationAlso seeclGetDeviceInfo
khronos-opencl-man-1.0~svn27110/atomic_min.xml 0000644 0001750 0001750 00000016360 11660441607 021132 0 ustar mathieu mathieu
atomic_minatomic_min2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3atomic_min
atomic_min functions.
int
atomic_min
volatile __global
int*pintval
unsigned int
atomic_min
volatile __global
unsigned int*punsigned intval
int
atomic_min
volatile __local
int*pintval
unsigned int
atomic_min
volatile __local
unsigned int*punsigned intvalDescription
Read the 32-bit value (referred to as old) stored at location pointed by
p. Compute min
(old, val) and store result at location pointed by
p. The function returns old.
A 64-bit version of this function, atom_min,
is enabled by cl_khr_int64_extended_atomics.
SpecificationOpenCL SpecificationAlso seeAtomic Functions,
atom_min
khronos-opencl-man-1.0~svn27110/clCreateImage.xml 0000644 0001750 0001750 00000044421 12057236107 021475 0 ustar mathieu mathieu
]>
clCreateImage
clCreateImage
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clCreateImage
Creates a 1D image, 1D image buffer, 1D image array, 2D image, 2D image array or 3D image object.
cl_mem clCreateImagecl_contextcontextcl_mem_flagsflagsconst cl_image_format*image_formatconst cl_image_desc*image_descvoid*host_ptrcl_int*errcode_retParameters context
A valid OpenCL context on which the image object is to be created.
flags
A bit-field that is used to specify allocation
and usage information about the image memory object being created and is
described in the table below.
For all image types except CL_MEM_OBJECT_IMAGE1D_BUFFER,
if value specified for flags is 0, the default is used
which is CL_MEM_READ_WRITE.
For CL_MEM_OBJECT_IMAGE1D_BUFFER image type, if the
CL_MEM_READ_WRITE, CL_MEM_READ_ONLY
or CL_MEM_WRITE_ONLY values are not specified in
flags, they are inherited from the corresponding
memory access qualifers associated with buffer.
The CL_MEM_USE_HOST_PTR,
CL_MEM_ALLOC_HOST_PTR and
CL_MEM_COPY_HOST_PTR values cannot
be specified in flags but are inherited
from the corresponding memory access qualifiers associated with
buffer. If CL_MEM_COPY_HOST_PTR
is specified in the memory access qualifier values associated with
buffer it does not imply any additional copies
when the sub-buffer is created from buffer.
If the CL_MEM_HOST_WRITE_ONLY,
CL_MEM_HOST_READ_ONLY or
CL_MEM_HOST_NO_ACCESS values are not specified in
flags, they are inherited from the corresponding memory
access qualifiers associated with buffer.
&clCreate_memflagsInc;
image_format
A pointer to a structure that
describes format properties of the image to be allocated. See
cl_image_format
for a detailed description of the image format descriptor.
image_desc
A pointer to a structure that
describes type and dimensions of the image to be allocated. See
imageDescriptor
for more information.
host_ptr
A pointer to the image data that may already be allocated by the application.
Refer to table below for a description of how large the buffer that
host_ptr points to must be.
Image TypeSize of buffer that host_ptr points toCL_MEM_OBJECT_IMAGE1D≥ image_row_pitchCL_MEM_OBJECT_IMAGE1D_BUFFER≥ image_row_pitchCL_MEM_OBJECT_IMAGE2D≥ image_row_pitch * image_heightCL_MEM_OBJECT_IMAGE3D≥ image_slice_pitch * image_depthCL_MEM_OBJECT_IMAGE1D_ARRAY≥ image_slice_pitch * image_array_sizeCL_MEM_OBJECT_IMAGE2D_ARRAY≥ image_slice_pitch * image_array_size
For a 3D image or 2D image array, the image data specified by
host_ptr is stored as a linear sequence of adjacent 2D
image slices or 2D images respectively. Each 2D image is a linear sequence
of adjacent scanlines. Each scanline is a linear sequence of image elements.
For a 2D image, the image data specified by host_ptr
is stored as a linear sequence of adjacent scanlines. Each scanline is
a linear sequence of image elements.
For a 1D image array, the image data specified by host_ptr
is stored as a linear sequence of adjacent 1D images respectively. Each 1D
image or 1D image buffer is a single scanline which is a linear sequence
of adjacent elements.
errcode_ret
Will return an appropriate error code. If errcode_ret
is NULL, no error code is returned.
ErrorsclCreateImage returns a valid non-zero image object and
errcode_ret is set to CL_SUCCESS if the
image object is created successfully. Otherwise, it returns a NULL value with one of
the following error values returned in errcode_ret:
CL_INVALID_CONTEXT if context is not a valid context.
CL_INVALID_VALUE if values specified in flags are not valid.
CL_INVALID_IMAGE_FORMAT_DESCRIPTOR if values specified in
image_format are not valid or if image_format
is NULL.
CL_INVALID_IMAGE_DESCRIPTOR if values specified in
image_desc are not valid or if image_desc
is NULL.
CL_INVALID_IMAGE_SIZE if image dimensions specified
in image_desc exceed the minimum maximum image dimensions
described in the table of allowed values for param_name
for clGetDeviceInfo
for all devices in context.
CL_INVALID_HOST_PTR if host_ptr in
image_desc is NULL and CL_MEM_USE_HOST_PTR or
CL_MEM_COPY_HOST_PTR are set in flags or if
host_ptr is not NULL but CL_MEM_COPY_HOST_PTR
or CL_MEM_USE_HOST_PTR are not set in flags.
CL_INVALID_VALUE if a 1D image buffer is being created
and the buffer object was created with CL_MEM_WRITE_ONLY
and flags specifies CL_MEM_READ_WRITE
or CL_MEM_READ_ONLY, or if the buffer object was
created with CL_MEM_READ_ONLY and flags specifies
CL_MEM_READ_WRITE or CL_MEM_WRITE_ONLY, or
if flags specifies CL_MEM_USE_HOST_PTR
or CL_MEM_ALLOC_HOST_PTR or
CL_MEM_COPY_HOST_PTR.
CL_INVALID_VALUE if a 1D image buffer is being created and
the buffer object was created with CL_MEM_HOST_WRITE_ONLY
and flags specifies CL_MEM_HOST_READ_ONLY,
or if the buffer object was created with CL_MEM_HOST_READ_ONLY
and flags specifies CL_MEM_HOST_WRITE_ONLY,
or if the buffer object was created with CL_MEM_HOST_NO_ACCESS
and flags specifies CL_MEM_HOST_READ_ONLY
or CL_MEM_HOST_WRITE_ONLY.
CL_IMAGE_FORMAT_NOT_SUPPORTED if the
image_format is not supported.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for image object.
CL_INVALID_OPERATION if there are
no devices in context that support
images (i.e. CL_DEVICE_IMAGE_SUPPORT
(specified in the table of OpenCL Device Queries for
clGetDeviceInfo)
is CL_FALSE).
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seecl_image_desc,
cl_image_format,
Cardinality Diagram
khronos-opencl-man-1.0~svn27110/atomicFunctions.xml 0000644 0001750 0001750 00000021256 11660441607 022160 0 ustar mathieu mathieu
Atomic FunctionsAtomic Functions2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3Atomic Functions
The atomic functions are shown below.
Click an item in the table below for details about that function.
atomic_addatomic_subatomic_xchgatomic_incatomic_decatomic_cmpxchgatomic_minatomic_maxatomic_andatomic_oratomic_xor
The cl_khr_int64_base_atomics
extension enables additional atomic functions using types long
and unsigned long. An application that wants to use
this extension will need to include the #pragma OPENCL EXTENSION
cl_khr_int64_base_atomics :
enable in the OpenCL program source.
atom_addatom_subatom_xchgatom_incatom_decatom_cmpxchg
The cl_khr_int64_extended_atomics
extension enables additional atomic functions using types long
and unsigned long. An application that wants to use
this extension will need to include the #pragma OPENCL EXTENSION
cl_khr_int64_extended_atomics
: enable in the OpenCL program source.
atom_minatom_maxatom_xoratom_andatom_orDescription
These functions provide atomic operations on 32-bit signed, unsigned
integers and single precision floating-point to locations in __global or __local memory. Only the
atomic_xchg operation is supported for single precision
floating-point data type.
The atomic built-in functions that use the atom_ prefix and are
described in the OpenCL Extension Specification and are
enabled by: cl_khr_global_int32_base_atomics, cl_khr_global_int32_extended_atomics,
cl_khr_local_int32_base_atomics, and cl_khr_local_int32_extended_atomics in sections
9.5 and 9.6 of the OpenCL 1.0 specification are also supported. .
The 64-bit transactions are atomic for the device executing these atomic functions. There
is no guarantee of atomicity if the atomic operations to the same memory location
are being performed by kernels executing on multiple devices.
SpecificationOpenCL Specification
khronos-opencl-man-1.0~svn27110/geometricFunctionsInc.xml 0000644 0001750 0001750 00000001642 11660441607 023311 0 ustar mathieu mathieu
Built-in geometric functions operate component-wise. The description
is per-component. floatn is
float, float2, float3, or float4 and
doublen is double, double2,
double3, or double4. The built-in geometric functions are
implemented using the round to nearest even rounding mode.
The geometric functions can be implemented using contractions such
as mad or
fma.
khronos-opencl-man-1.0~svn27110/get_work_dim.xml 0000644 0001750 0001750 00000010601 11660441607 021455 0 ustar mathieu mathieu
get_work_dimget_work_dim2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_work_dim
Returns the number of dimensions in use.
uintget_work_dim ()Description
This is the value given to the work_dim argument specified in
clEnqueueNDRangeKernel.
For clEnqueueTask, this
returns one.
SpecificationOpenCL SpecificationAlso seeWork-Item Functions,
clEnqueueNDRangeKernel,
clEnqueueTask
khronos-opencl-man-1.0~svn27110/floor.xml 0000644 0001750 0001750 00000007776 11660441607 020147 0 ustar mathieu mathieu
]>
floorfloor2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3floor
Round to integer toward negative infinity.
gentype
floor
gentypeDescriptionfloor rounds to integral value using the round to negative
infinity rounding mode.
Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/read_imageh2d.xml 0000644 0001750 0001750 00000026307 11660441607 021470 0 ustar mathieu mathieu
[
]>
read_imageh (2D, Half)read_image (2D, Half)2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3read_imageh (2D, Half)
Do an element lookup in the 2D image object, returning half floating-point values.
half4
read_imageh
image2d_t
image
sampler_t
sampler
int2
coord
half4
read_imageh
image2d_t
image
sampler_t
sampler
float2
coord
half4
read_imageh
image2d_t
image
int2
coord
half4
read_imageh
image2d_array_t
image
int4
coord
half4
read_imageh
image2d_array_t
image
sampler_t
sampler
int4
coord
half4
read_imageh
image2d_array_t
image
sampler_t
sampler
float4
coordDescription
For the forms that take an image2d_t, use the coordinate (x,
y) to do an element lookup in the 2D image object specified by
image.
For the forms that take an image2d_array_t, Use
coord.xy to do an element lookup in the 2D image identified by
coord.z in the 2D image array specified by image.
The samplerless read image functions behave exactly as the corresponding read
image functions that take integer coordinates and a sampler with filter mode
set to CLK_FILTER_NEAREST, normalized coordinates set
to CLK_NORMALIZED_COORDS_FALSE and addressing mode to
CLK_ADDRESS_NONE.
read_imageh returns half floating-point values in the range
[0.0... 1.0] for image objects created with image_channel_data_type
set to one of the predefined packed formats or CL_UNORM_INT8
or CL_UNORM_INT16.
read_imageh returns half floating-point values in the range
[-1.0... 1.0] for image objects created with image_channel_data_type
set to CL_SNORM_INT8, or CL_SNORM_INT16.
read_imageh returns half floating-point values for
image objects created with image_channel_data_type set to
CL_HALF_FLOAT.
The read_imageh calls that take integer coordinates must
use a sampler with filter mode set to CLK_FILTER_NEAREST,
normalized coordinates set to CLK_NORMALIZED_COORDS_FALSE
and addressing mode set to CLK_ADDRESS_CLAMP_TO_EDGE,
CLK_ADDRESS_CLAMP or CLK_ADDRESS_NONE;
otherwise the values returned are undefined.
Values returned by read_imageh for image objects with
image_channel_data_type values not specified in the description
above are undefined.
Notes
General information about the read_image* functions follows.
&imageFunctionsInc;
&imageMappingInc;
SpecificationOpenCL SpecificationAlso seeImage Functions
khronos-opencl-man-1.0~svn27110/atan.xml 0000644 0001750 0001750 00000014163 11660441607 017735 0 ustar mathieu mathieu
]>
atan, atan2, atanh, atanpi, atan2piatan2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3atan, atan2, atanh, atanpi, atan2pi
Tangent functions.
gentype
atan
gentypey_over_x
gentype
atan2
gentypeygentypex
gentype
atanh
gentype
gentype
atanpi
gentypex
gentype
atan2pi
gentypeygentypexDescriptionatan is the arc tangent function. atan2 is the arc tangent of y / x. atanh is the hyperbolic arc tangent function. atanpi computes atan (x) / π. atan2pi computes atan2 (y, x) / π. Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/clEnqueueReadBuffer.xml 0000644 0001750 0001750 00000037732 11660441607 022675 0 ustar mathieu mathieu
clEnqueueReadBuffer
clEnqueueReadBuffer
2007-2010The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clEnqueueReadBuffer
Enqueue commands to read from a buffer object to host memory.
cl_int
clEnqueueReadBuffercl_command_queuecommand_queuecl_membuffercl_boolblocking_readsize_toffsetsize_tsizevoid*ptrcl_uintnum_events_in_wait_listconst cl_event*event_wait_listcl_event*eventParameterscommand_queue
Refers to the command-queue in which the read command will be
queued. command_queue and buffer
must be created with the same OpenCL context.
bufferRefers to a valid buffer object.blocking_read
Indicates if the read operations are
blocking or non-blocking.
If blocking_read is CL_TRUE
i.e. the read command is blocking, clEnqueueReadBuffer
does not return until the buffer data has been read and copied into memory
pointed to by ptr.
If blocking_read is CL_FALSE
i.e. the read command is non-blocking,
clEnqueueReadBuffer queues a
non-blocking read command and returns. The contents of
the buffer that ptr points to cannot be used until the
read command has completed. The event argument returns
an event object which can be used to query the execution status of the
read command. When the read command has completed, the contents of the
buffer that ptr points to can be used by the application.
offsetThe offset in bytes in the buffer object to read from.sizeThe size in bytes of data being read.ptr
The pointer to buffer in host memory where data is to be read into.
event_wait_list
num_events_in_wait_list
event_wait_list
and num_events_in_wait_list specify events that
need to complete before this particular command can be executed.
If event_wait_list is NULL, then this particular command
does not wait on any event to complete. If event_wait_list
is NULL, num_events_in_wait_list must be 0. If
event_wait_list is not NULL, the list of events
pointed to by event_wait_list must be valid
and num_events_in_wait_list must be greater
than 0. The events specified in event_wait_list
act as synchronization points. The context associated with events in
event_wait_list and command_queue must
be the same. The memory associated with event_wait_list
can be reused or freed after the function returns.
event
Returns an event object that identifies
this particular read command and can be used to query or queue a wait
for this particular command to complete. event can be
NULL in which case it will not be possible for the application to query
the status of this command or queue a wait for this command to complete.
If the event_wait_list and the event arguments are
not NULL, the event argument should not refer to an
element of the event_wait_list array.
Notes
Calling clEnqueueReadBuffer to read a region of the buffer object
with the ptr argument value set to host_ptr
+ offset, where host_ptr is a pointer to
the memory region specified when the buffer object being read is created with
CL_MEM_USE_HOST_PTR, must meet the following requirements in
order to avoid undefined behavior:
All commands that use this buffer object or a memory object (buffer or image)
created from this buffer object have finished execution before the read command
begins execution.
The buffer object or memory objects created from this buffer object are not mapped.
The buffer object or memory objects created from this buffer object are not used
by any command-queue until the read command has finished execution.
ErrorsclEnqueueReadBuffer returns CL_SUCCESS if
the function is executed successfully. Otherwise, it returns one of the following errors:
CL_INVALID_COMMAND_QUEUE if command_queue
is not a valid command-queue.
CL_INVALID_CONTEXT if the context associated with
command_queue and buffer are not the same
or if the context associated with command_queue and events in
event_wait_list are not the same.
CL_INVALID_MEM_OBJECT if buffer is not
a valid buffer object.
CL_INVALID_VALUE if the region being read specified by
(offset, size) is out of bounds or if
ptr is a NULL value or if size is 0.
CL_INVALID_EVENT_WAIT_LIST
if event_wait_list is NULL and
num_events_in_wait_list greater than
0, or event_wait_list is not NULL and
num_events_in_wait_list is 0, or if event objects in
event_wait_list are not valid events.
CL_MISALIGNED_SUB_BUFFER_OFFSET if
buffer is a sub-buffer object and offset
specified when the sub-buffer object is created is not aligned to
CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated
with queue.
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the read
and write operations are blocking and the execution status of any of the events
in event_wait_list is a negative integer value.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for data store associated with buffer.
CL_INVALID_OPERATION if
clEnqueueReadBuffer is called on buffer
which has been created with CL_MEM_HOST_WRITE_ONLY or
CL_MEM_HOST_NO_ACCESS.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclEnqueueCopyBuffer,
clEnqueueWriteBuffer,
clEnqueueWriteBufferRect,
clEnqueueReadBufferRect
khronos-opencl-man-1.0~svn27110/get_image_channel_order.xml 0000644 0001750 0001750 00000025032 11660441607 023613 0 ustar mathieu mathieu
get_image_channel_orderget_image_channel_order2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_image_channel_order
Return the image channel data order.
int
get_image_channel_order
image1d_t
image
int
get_image_channel_order
image1d_buffer_t
image
int
get_image_channel_order
image2d_t
image
int
get_image_channel_order
image3d_t
image
int
get_image_channel_order
image1d_array_t
image
int
get_image_channel_order
image2d_array_t
imageDescription
Return the image channel order. Valid values are:
CLK_A
CLK_R
CLK_Rx
CLK_RG
CLK_RGx
CLK_RA
CLK_RGB
CLK_RGBx
CLK_RGBA
CLK_ARGB
CLK_BGRA
CLK_INTENSITY
CLK_LUMINANCENotes
The values returned by get_image_channel_order
as shown above with the CLK_ prefixes correspond
to the CL_ prefixes used to describe the image
channel order and data type in the table of supported names and values in
clCreateSubBuffer
and list of supported Image Channel Order Values for
clCreateImage. For
example, both CL_UNORM_INT8 and CLK_UNORM_INT8
refer to an image channel data type that is an unnormalized unsigned 8-bit integer.
The following table describes the mapping of the number of channels of an image
element to the appropriate components in the float4, int4 or uint4 vector data type
for the color values returned by read_image{f|i|ui} or supplied
to write_image{f|i|ui}. The unmapped components will be set
to 0.0 for red, green and blue channels and will be set to
1.0 for the alpha channel.
Channel Orderfloat4, int4 or unsigned int4 components of channel dataCL_R, CL_Rx(r, 0.0, 0.0, 1.0)CL_A(0.0, 0.0, 0.0, a)CL_RG, CL_RGx(r, g, 0.0, 1.0)CL_RA(r, 0.0, 0.0, a)CL_RGB, CL_RGBx(r, g, b, 1.0)CL_RGBA, CL_BGRA, CL_ARGB(r, g, b, a)CL_INTENSITY(I, I, I, I)CL_LUMINANCE(L, L, L, 1.0)
A kernel that uses a sampler with the CL_ADDRESS_CLAMP addressing
mode with multiple images may result in additional samplers being used internally by an
implementation. If the same sampler is used with multiple images called via read_image{f|i|ui},
then it is possible that an implementation may need to allocate an additional
sampler to handle the different border color values that may be needed depending
on the image formats being used. These implementation allocated samplers
will count against the maximum sampler values supported by the device and
given by CL_DEVICE_MAX_SAMPLERS. Enqueuing a kernel that
requires more samplers than the implementation can support will result in a
CL_OUT_OF_RESOURCES error being returned.
SpecificationOpenCL SpecificationAlso seeImage Functions
khronos-opencl-man-1.0~svn27110/acos.xml 0000644 0001750 0001750 00000011474 11660441607 017741 0 ustar mathieu mathieu
]>
acos, acosh, acospiacos2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3acos, acosh, acospi
Arc cosine functions.
gentype
acos
gentype
gentype
acosh
gentype
gentype
acospi
gentypexDescriptionacos is the arc cosine function. acosh is the inverse hyperbolic cosine function. acospi computes acos (x) / π. Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/clCreateFromD3D10Texture2DKHR.xml 0000644 0001750 0001750 00000024141 11660441607 024125 0 ustar mathieu mathieu
]>
clCreateFromD3D10Texture2DKHRclCreateFromD3D10Texture2DKHR2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clCreateFromD3D10Texture2DKHRCreates an OpenCL 2D image object from a subresource of a Direct3D 10 2D texture.
cl_mem
clCreateFromD3D10Texture2DKHRcl_contextcontextcl_mem_flagsflagsID3D10Texture2D*resourceUINTsubresource
cl_int
*errcode_retParameterscontext
A valid OpenCL context created from a Direct3D 10 device.
flags
A bit-field that is used to specify usage information.
May be CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY,
or CL_MEM_READ_WRITE. (See the table for
clCreateBuffer
for more information.)
resource
A pointer to the Direct3D 10 2D texture to share.
subresource
The subresource of resource to share.
errcode_ret
An appropriate error code. If errcode_ret is NULL, no error code is returned.
Notes
The width, height and depth of the returned OpenCL 2D image object are determined
by the width, height and depth of subresource subresource of
resource. The channel type and order of the returned OpenCL 2D
image object is determined by the format of resource as shown in of
Direct3D 10 and corresponding OpenCL image formats of resource in
clCreateFromD3D10Texture3DKHR.
This call will increment the internal Direct3D reference count on
resource. The internal Direct3D reference count on
resource will be decremented when the OpenCL reference count on
the returned OpenCL memory object drops to zero.
&sharingD3D10Inc;
Errors
Returns CL_SUCCESS returns a valid non-zero OpenCL image object
and errcode_ret is set to CL_SUCCESS if the
image object is created successfully. Otherwise, it returns a NULL value with one of
the following error values returned in errcode_ret:
CL_INVALID_CONTEXT if context is not
a valid context.
CL_INVALID_VALUE if values specified in
flags are not valid or if subresource
is not a valid subresource index for resource.
CL_INVALID_D3D10_RESOURCE_KHR if resource
is not a Direct3D 10 texture resource, if resource
was created with the D3D10_USAGE flag D3D10_USAGE_IMMUTABLE, if
a resource is a multisampled texture, if cl_mem from
subresource subresource of resource has
already been created using clCreateFromD3D10Texture2DKHR,
or if context was not created against the same Direct3D 10
device from which resource was created.
CL_INVALID_IMAGE_FORMAT_DESCRIPTOR if the Direct3D
10 texture format of resource is not a value listed
in the table of Direct3D 10 and corresponding OpenCL image formats for
clCreateFromD3D10Texture3DKHR,
or if the Direct3D 10 texture format of resource does not map
to a supported OpenCL image format.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seecl_khr_d3d10_sharing,
clGetDeviceIDsFromD3D10KHR,
clCreateFromD3D10BufferKHR,
clCreateFromD3D10Texture3DKHR,
clEnqueueAcquireD3D10ObjectsKHR,
clEnqueueReleaseD3D10ObjectsKHR
khronos-opencl-man-1.0~svn27110/normalize.xml 0000644 0001750 0001750 00000013165 11660441607 021013 0 ustar mathieu mathieu
]>
normalizenormalize2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3normalize
Normal vector length 1.
floatn
normalize
floatnp
doublen
normalize
doublenpgentypenormalize (gentypep) // if half extension enabled
Description
Returns a vector in the same direction as p but with a length of 1.
Notes
&geometricFunctionsInc;
If extended with cl_khr_fp16,
generic type name gentype may indicate half and
half{2|3|4} as arguments and return values.
SpecificationOpenCL SpecificationAlso seefast_normalizeGeometric Functions
khronos-opencl-man-1.0~svn27110/clEnqueueReadImage.xml 0000644 0001750 0001750 00000052045 11660441607 022500 0 ustar mathieu mathieu
clEnqueueReadImage
clEnqueueReadImage
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clEnqueueReadImage
Enqueue commands to read from an image or image array object to host memory.
cl_int
clEnqueueReadImage
cl_command_queue
command_queue
cl_mem
image
cl_bool
blocking_readconst
size_t
*originconst
size_t
*region
size_t
row_pitch
size_t
slice_pitch
void
*ptr
cl_uint
num_events_in_wait_listconst
cl_event
*event_wait_list
cl_event*eventParameters command_queue
Refers to the command-queue in which the read command will be
queued. command_queue and image
must be created with the same OpenCL context.
image
Refers to a valid image or image array object.
blocking_read
Indicates if the read operations are blocking or
non-blocking.
If blocking_read is CL_TRUE
i.e. the read command is blocking, clEnqueueReadImage
does not return until the buffer data has been read and copied into memory
pointed to by ptr.
If blocking_read is CL_FALSE
i.e. map operation is non-blocking, clEnqueueReadImage
queues a non-blocking read command and returns. The contents of the
buffer that ptr points to cannot be used until the read
command has completed. The event argument returns an
event object which can be used to query the execution status of the read
command. When the read command has completed, the contents of the buffer
that ptr points to can be used by the application.
origin
Defines the (x, y, z) offset in pixels in the 1D, 2D, or
3D image, the (x, y) offset and the image index in the
image array or the (x) offset and the image index in the 1D image array. If
image is a 2D image object, origin[2]
must be 0. If image is a 1D image or 1D image buffer
object, origin[1] and origin[2]
must be 0. If image is a 1D image array object,
origin[2] must be 0. If image
is a 1D image array object, origin[1] describes the
image index in the 1D image array. If image is a 2D
image array object, origin[2] describes the image
index in the 2D image array.
region
Defines the (width, height, depth) in pixels of the
1D, 2D or 3D rectangle, the (width, height) in pixels
of the 2D rectangle and the number of images of a 2D image array or the
(width) in pixels of the 1D rectangle and the number
of images of a 1D image array. If image is a 2D image
object, region[2] must be 1. If image
is a 1D image or 1D image buffer object, region[1]
and region[2] must be 1. If image is a 1D image array
object, region[2] must be 1.
row_pitch
The length of each row in bytes. This value must be greater than or
equal to the element size in bytes * width. If
row_pitch is set to 0, the appropriate row pitch
is calculated based on the size of each element in bytes multiplied by
width.
slice_pitch
Size in bytes of the 2D slice of the 3D region of a 3D image or
each image of a 1D or 2D image array being read. This must be 0 if
image is a 1D or 2D image. This value must be greater
than or equal to row_pitch * height.
If slice_pitch is set to 0, the appropriate slice
pitch is calculated based on the row_pitch *
height.
ptr
The pointer to a buffer in host memory where image data is to be read from.
event_wait_list
,
num_events_in_wait_list
Specify events that need to complete before this particular
command can be executed. If event_wait_list
is NULL, then this particular command does not wait on any
event to complete. If event_wait_list is
NULL, num_events_in_wait_list must be 0. If
event_wait_list is not NULL, the list of events
pointed to by event_wait_list must be valid
and num_events_in_wait_list must be greater
than 0. The events specified in event_wait_list
act as synchronization points. The context associated with events in
event_wait_list and command_queue must
be the same. The memory associated with event_wait_list
can be reused or freed after the function returns.
event
Returns an event object that identifies this particular read command
and can be used to query or queue a wait for this particular command
to complete. event can be NULL in which case
it will not be possible for the application to query the status of
this command or queue a wait for this command to complete. If the
event_wait_list and the event
arguments are not NULL, the event argument should not
refer to an element of the event_wait_list array.
Notes
Calling clEnqueueReadImage to read a region of the
image with the ptr argument value set to
host_ptr + (origin[2] * image
slice pitch + origin[1] * image
row pitch + origin[0] * bytes per
pixel), where host_ptr is a pointer to the memory
region specified when the image being read is created with
CL_MEM_USE_HOST_PTR, must meet the following requirements in
order to avoid undefined behavior:
All commands that use this image object have finished execution before the read
command begins execution.
The row_pitch and slice_pitch argument
values in clEnqueueReadImage must be set to the image row
pitch and slice pitch.
The image object is not mapped.
The image object is not used by any command-queue until the read command has
finished execution.
ErrorsclEnqueueReadImage returns CL_SUCCESS if
the function is executed successfully. Otherwise, it returns one of the following errors.
CL_INVALID_COMMAND_QUEUE if command_queue
is not a valid command-queue.
CL_INVALID_CONTEXT if the context associated with
command_queue and image are not the same
or if the context associated with command_queue and events in
event_wait_list are not the same.
CL_INVALID_MEM_OBJECT if image is not
a valid image object.
CL_INVALID_VALUE if the region being read specified by
origin and region is out of bounds or if
ptr is a NULL value.
CL_INVALID_VALUE if values in origin
and region do not follow rules described in the argument
description for origin and region.
CL_INVALID_EVENT_WAIT_LIST
if event_wait_list is NULL and
num_events_in_wait_list > 0,
or event_wait_list is not NULL and
num_events_in_wait_list is 0, or if event objects in
event_wait_list are not valid events.
CL_INVALID_IMAGE_SIZE if image dimensions (image width,
height, specified or compute row and/or slice pitch) for image
are not supported by device associated with queue.
CL_INVALID_IMAGE_FORMAT if image format (image channel
order and data type) for image are not supported by device
associated with queue.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for data store associated with image.
CL_INVALID_OPERATION if the device associated
with command_queue does not support images
(i.e. CL_DEVICE_IMAGE_SUPPORT specified in
the table of allowed values for param_name for
clGetDeviceInfo
is CL_FALSE).
CL_INVALID_OPERATION if
clEnqueueReadImage is called on image
which has been created with CL_MEM_HOST_WRITE_ONLY or
CL_MEM_HOST_NO_ACCESSCL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the read
and write operations are blocking and the execution status of any of the events
in event_wait_list is a negative integer value.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclEnqueueWriteImage,
clEnqueueCopyImage
khronos-opencl-man-1.0~svn27110/clRetainSampler.xml 0000644 0001750 0001750 00000012770 11660441607 022101 0 ustar mathieu mathieu
clRetainSampler
clRetainSampler
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clRetainSampler
Increments the sampler reference count.
cl_int
clRetainSamplercl_samplersamplerParameterssampler
Specifies the sampler being retained.
NotesclCreateSampler performs an implicit retain.
Errors
Returns CL_SUCCESS if the function is executed
successfully. Otherwise, it returns one of the following errors:
CL_INVALID_SAMPLER if sampler is not a valid sampler object.
CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the
OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources
required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclCreateSampler,
clGetSamplerInfo,
clReleaseSampler
khronos-opencl-man-1.0~svn27110/islessequal.xml 0000644 0001750 0001750 00000017535 11660441607 021352 0 ustar mathieu mathieu
]>
islessequalislessequal2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3islessequal
Compare of x <= y.
int
islessequal
floatxfloaty
intn
islessequal
floatnxfloatny
int
islessequal
doublexdoubley
longn
islessequal
doublenxdoublenyintislessequal
(halfx,
halfy) // if half extension enabled
shortnislessequal
(halfnx,
halfny) // if half extension enabled
Description
Returns the component-wise compare of x <= y.
Notes
&relationalFunctionsInc1;
&relationalFunctionsInc2;
&relationalFunctionsInc3;
SpecificationOpenCL SpecificationAlso seeRelational Functions
khronos-opencl-man-1.0~svn27110/vstore_halfn.xml 0000644 0001750 0001750 00000043600 11660441607 021502 0 ustar mathieu mathieu
]>
vstore_halfnvstore_halfn2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3vstore_halfn
Convert float vector to half vector and write to a pointer to memory.
void
vstore_halfnfloatndatasize_toffset__global half*p
void
vstore_halfn_rte
floatndatasize_toffset__global half*p
void
vstore_halfn_rtz
floatndatasize_toffset__global half*p
void
vstore_halfn_rtp
floatndatasize_toffset__global half*p
void
vstore_halfn_rtn
floatndatasize_toffset__global half*p
void
vstore_halfnfloatndatasize_toffset__local half*p
void
vstore_halfn_rte
floatndatasize_toffset__local half*p
void
vstore_halfn_rtz
floatndatasize_toffset__local half*p
void
vstore_halfn_rtp
floatndatasize_toffset__local half*p
void
vstore_halfn_rtn
floatndatasize_toffset__local half*p
void
vstore_halfnfloatndatasize_toffset__private half*p
void
vstore_halfn_rte
floatndatasize_toffset__private half*p
void
vstore_halfn_rtz
floatndatasize_toffset__private half*p
void
vstore_halfn_rtp
floatndatasize_toffset__private half*p
void
vstore_halfn_rtn
floatndatasize_toffset__private half*p
If the optional double is supported, you may use doublen instead of floatn.
Description
The floatn (or
doublen if optional double
is supported) value given by data is converted to
a halfn value using the appropriate
rounding mode. The halfn value is then
written to address computed as (p + (offset
* n)). The address computed as (p +
(offset * n)) must be 16-bit aligned.
vstore_halfn uses the default rounding
mode. The default rounding mode is round to nearest even.
Notes
&vectorFunctionsInc;
vload3 and vload_half3 read x,
y, z components from address (p +
(offset * 3)) into a 3-component vector. vstore3,
and vstore_half3 write x, y,
z components from a 3-component vector to address (p
+ (offset * 3)).
In addition vloada_half3 reads x,
y, z components from address
(p + (offset * 4)) into a 3- component vector and
vstorea_half3 writes x, y,
z components from a 3-component vector to address (p
+ (offset * 4)).
SpecificationOpenCL SpecificationAlso seeVector Data Load and Store Functions
khronos-opencl-man-1.0~svn27110/clEnqueueWriteImage.xml 0000644 0001750 0001750 00000051736 11660441607 022725 0 ustar mathieu mathieu
clEnqueueWriteImage
clEnqueueWriteImage
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clEnqueueWriteImage
Enqueues a command to write to an image or image array object from host memory.
cl_int
clEnqueueWriteImage
cl_command_queue
command_queue
cl_mem
image
cl_bool
blocking_writeconst
size_t
*originconst
size_t
*region
size_t
input_row_pitch
size_t
input_slice_pitchconst
void
* ptr
cl_uint
num_events_in_wait_listconst
cl_event
*event_wait_list
cl_event
*eventParameters command_queue
Refers to the command-queue in which the write command will be
queued. command_queue and image
must be created with the same OpenCL context.
image
Refers to a valid image or image array object.
blocking_write
Indicates if the write operation is blocking or
non-blocking.
If blocking_write is CL_TRUE the
OpenCL implementation copies the data referred to by ptr
and enqueues the write command in the command-queue. The memory pointed
to by ptr can be reused by the application after the
clEnqueueWriteImage call returns.
If blocking_write is CL_FALSE
the OpenCL implementation will use ptr to perform a
nonblocking write. As the write is non-blocking the implementation can return
immediately. The memory pointed to by ptr cannot be reused
by the application after the call returns. The event
argument returns an event object which can be used to query the execution
status of the write command. When the write command has completed, the memory
pointed to by ptr can then be reused by the application.
origin
Defines the (x, y, z) offset in pixels in the 1D, 2D, or
3D image, the (x, y) offset and the image index in the
image array or the (x) offset and the image index in the 1D image array. If
image is a 2D image object, origin[2]
must be 0. If image is a 1D image or 1D image buffer
object, origin[1] and origin[2]
must be 0. If image is a 1D image array object,
origin[2] must be 0. If image
is a 1D image array object, origin[1] describes the
image index in the 1D image array. If image is a 2D
image array object, origin[2] describes the image
index in the 2D image array.
region
Defines the (width, height, depth) in pixels of the
1D, 2D or 3D rectangle, the (width, height) in pixels
of the 2D rectangle and the number of images of a 2D image array or the
(width) in pixels of the 1D rectangle and the number
of images of a 1D image array. If image is a 2D image
object, region[2] must be 1. If image
is a 1D image or 1D image buffer object, region[1]
and region[2] must be 1. If image is a 1D image array
object, region[2] must be 1.
input_row_pitch
The length of each row in bytes. This value must be greater than or
equal to the element size in bytes * width. If
row_pitch is set to 0, the appropriate row pitch
is calculated based on the size of each element in bytes multiplied by
width.
input_slice_pitch
Size in bytes of the 2D slice of the 3D region of a 3D image or each
image of a 1D or 2D image array being written. This must be 0 if
image is a 1D or 2D image. This value must be greater
than or equal to row_pitch * height. If
slice_pitch is set to 0, the appropriate slice
pitch is calculated based on the row_pitch *
height.
ptr
The pointer to a buffer in host memory where image data is to be written to.
event_wait_list
,
num_events_in_wait_list
Specify events that need to complete before this particular
command can be executed. If event_wait_list
is NULL, then this particular command does not wait on any
event to complete. If event_wait_list is
NULL, num_events_in_wait_list must be 0. If
event_wait_list is not NULL, the list of events
pointed to by event_wait_list must be valid
and num_events_in_wait_list must be greater
than 0. The events specified in event_wait_list
act as synchronization points. The context associated with events in
event_wait_list and command_queue must
be the same. The memory associated with event_wait_list
can be reused or freed after the function returns.
event
Returns an event object that identifies this particular write command
and can be used to query or queue a wait for this particular command
to complete. event can be NULL in which case it will
not be possible for the application to query the status of this command
or queue a wait for this command to complete.
Notes
Calling clEnqueueWriteImage to update the latest bits in a
region of the image with the ptr argument
value set to host_ptr + (origin[2]
* image slice pitch + origin[1] *
image row pitch + origin[0] * bytes
per pixel), where host_ptr is a pointer to the memory
region specified when the image being written is created with
CL_MEM_USE_HOST_PTR, must meet the following requirements in
order to avoid undefined behavior:
The host memory region being written contains the latest bits when the enqueued
write command begins execution.
The input_row_pitch and input_slice_pitch
argument values in clEnqueueWriteImage must be set to the
image row pitch and slice pitch.
The image object is not mapped.
The image object is not used by any command-queue until the write command has
finished execution.
ErrorsclEnqueueWriteImage return CL_SUCCESS if
the function is executed successfully. Otherwise, it returns one of the following errors:
CL_INVALID_COMMAND_QUEUE if command_queue
is not a valid command-queue.
CL_INVALID_CONTEXT if the context associated with
command_queue and image are
not the same or if the context associated with command_queue
and events in event_wait_list are not the same.
CL_INVALID_MEM_OBJECT if image is
not a valid image object.
CL_INVALID_VALUE if the region being written specified by
origin and region is out of bounds or if
ptr is a NULL value.
CL_INVALID_VALUE if values in origin
and region do not follow rules described in the argument
description for origin and region.
CL_INVALID_EVENT_WAIT_LIST
if event_wait_list is NULL and
num_events_in_wait_list > 0,
or event_wait_list is not NULL and
num_events_in_wait_list is 0, or if event objects in
event_wait_list are not valid events.
CL_INVALID_IMAGE_SIZE if image dimensions (image width,
height, specified or compute row and/or slice pitch) for image
are not supported by device associated with queue.
CL_INVALID_IMAGE_FORMAT if image format (image channel
order and data type) for image are not supported by device
associated with queue.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for data store associated with image.
CL_INVALID_OPERATION if the device associated
with command_queue does not support images
(i.e. CL_DEVICE_IMAGE_SUPPORT specified
the table of allowed values for param_name for
clGetDeviceInfo
is CL_FALSE).
CL_INVALID_OPERATION if
clEnqueueWriteImage is called on image
which has been created with CL_MEM_HOST_WRITE_ONLY or
CL_MEM_HOST_NO_ACCESS.
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the
write operations are blocking and the execution status of any of the events in
event_wait_list is a negative integer value.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclEnqueueReadImage,
clEnqueueCopyImage
khronos-opencl-man-1.0~svn27110/write_mem_fence.xml 0000644 0001750 0001750 00000010572 11660441607 022142 0 ustar mathieu mathieu
write_mem_fencewrite_mem_fence2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3write_mem_fence
Write memory barrier that orders only stores.
void
write_mem_fence
cl_mem_fence_flagsflagsDescription
Write memory barrier that orders only stores.
The flags argument specifies the memory address
space and can be set to a combination of the following literal values:
CLK_LOCAL_MEM_FENCE, CLK_GLOBAL_MEM_FENCE.
SpecificationOpenCL SpecificationAlso seeExplicit Memory Fence Functions
khronos-opencl-man-1.0~svn27110/dataTypes.xml 0000644 0001750 0001750 00000031015 11660441607 020743 0 ustar mathieu mathieu
Data TypesData Types2007-2010The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3Data Types
OpenCL data types.
Description
These are the data types available in the OpenCL C programming language. Click on a
category name in the table below to see information about specific data types.
Data type categoryIncluded data typesScalar data typesbool, char, cl_char,
unsigned char, uchar, cl_uchar,
short, cl_short, unsigned short,
ushort, int, unsigned int,
uint, long, unsigned long,
ulong, float, half, size_t,
ptrdiff_t, intptr_t, uintptr_t,
void, double, and half floating point types.
Vector data typescharn, ucharn,
shortn, ushortn,
intn, uintn,
longn, ulongn,
floatn, doublen, and optional halfn types.
Abstract data typescl_platform_id, cl_device_id,
cl_context, cl_command_queue,
cl_mem, cl_program,
cl_kernel, cl_event, and
cl_sampler.
Reserved Data Typesbooln,
halfn, quad,
quadn,
complex half, complex halfn,
imaginary half, imaginary halfn,
complex float, complex floatn,
imaginary float, imaginary floatn,
complex double, complex doublen,
imaginary double, imaginary doublen,
complex quad, complex quadn,
imaginary quad, imaginary quadn,
floatnxm,
doublenxm,
long double, long doublen,
long long, long longn,
unsigned long long, ulong long, and
ulong longn.
Other data typesimage2d_t, image3d_t, image2d_array_t,
image1d_t, image31_buffer_t, image1d_array_t,
sampler_t, and event_t.
Alignment of Types
A data item declared to be a data type in memory is always aligned to the size of the
data type in bytes. For example, a float4 variable will be aligned to a
16-byte boundary, and a char2 variable will be aligned to a 2-byte boundary.
For 3-component vector data types, the size of the data type is 4 *
sizeof(component). This means that a 3-component vector data type
will be aligned to a 4 * sizeof(component) boundary. The vload3 and vstore3 built-in functions
can be used to read and write, respectively, 3-component vector data types from an
array of packed scalar data type.
A built-in data type that is not a power of two bytes in size must be aligned to the next
larger power of two. This rule applies to built-in types only, not structs
or unions.
The OpenCL compiler is responsible for aligning data items to the appropriate
alignment as required by the data type. For arguments to a __kernel
function declared to be a pointer to a data type, the OpenCL compiler can
assume that the pointee is always appropriately aligned as required by the
data type. The behavior of an unaligned load or store is undefined, except
for the vloadn,
vload_halfn,
vstoren, and
vstore_halfn functions. The
vector load functions can read a vector from an address aligned to the element type
of the vector. The vector store functions can write a vector to an address aligned
to the element type of the vector.
The user is responsible for ensuring that data passed into and out of OpenCL buffers are
natively aligned relative to the start of the buffer as described above. This implies
that OpenCL buffers created with CL_MEM_USE_HOST_PTR need to provide
an appropriately aligned host memory pointer that is aligned to the data types used to
access these buffers in a kernel(s). As well, the user is responsible to ensure that
data passed into and out of OpenCL images are properly aligned to the granularity of
the data representing a single pixel (e.g. image_num_channels
* sizeof(image_channel_data_type)) except for
CL_RGB and CL_RGBx images where
the data must be aligned to the granularity of a single channel in a pixel
(i.e. sizeof(image_channel_data_type)).
OpenCL makes no requirement about the alignment of OpenCL application defined data
types outside of buffers and images, except that the underlying vector primitives (e.g.
__cl_float4) where defined shall be directly accessible as such
using appropriate named fields in the cl_type union. Nevertheless,
it is recommended that the cl_platform.h header should attempt to
naturally align OpenCL defined application data types (e.g. cl_float4)
according to their type.
SpecificationOpenCL Specification
khronos-opencl-man-1.0~svn27110/clCreateFromD3D11BufferKHR.xml 0000644 0001750 0001750 00000021211 11660441607 023504 0 ustar mathieu mathieu
]>
clCreateFromD3D11BufferKHRclCreateFromD3D11BufferKHR2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clCreateFromD3D11BufferKHRCreates an OpenCL buffer object from a Direct3D 11 buffer.
cl_mem
clCreateFromD3D11BufferKHRcl_contextcontextcl_mem_flagsflagsID3D11Buffer*resource
cl_int
*errcode_retParameterscontext
A valid OpenCL context created from a Direct3D 11 device.
flags
A bit-field that is used to specify usage information.
May be CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY, or
CL_MEM_READ_WRITE. (See the table for
clCreateBuffer
for more information.)
resource
A pointer to the Direct3D 11 buffer to share.
errcode_ret
An appropriate error code. If errcode_ret is NULL, no error code is returned.
Notes
The size of the returned OpenCL buffer object is the same as the size
of resource. This call will increment the internal Direct3D
reference count on resource. The internal Direct3D reference count
on resource will be decremented when the OpenCL reference count on the returned OpenCL
memory object drops to zero.
&sharingD3D11Inc;
&accessMappedInc;
Errors
Returns CL_SUCCESS returns a valid non-zero OpenCL buffer
object and errcode_ret is set to CL_SUCCESS
if the buffer object is created successfully. Otherwise, it returns a NULL value with
one of the following error values returned in errcode_ret:
CL_INVALID_CONTEXT if context is not
a valid context.
CL_INVALID_VALUE if values specified in
flags are not valid.
CL_INVALID_D3D11_RESOURCE_KHR if resource
is not a Direct3D 11 buffer resource, if resource was created with
the D3D11_USAGE flag D3D11_USAGE_IMMUTABLE,
if a cl_mem from resource has already
been created using clCreateFromD3D11BufferKHR, or if
context was not created against the same Direct3D 11 device
from which resource was created.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seecl_khr_d3d11_sharing,
clGetDeviceIDsFromD3D11KHR,
clCreateFromD3D11Texture2DKHR,
clCreateFromD3D11Texture3DKHR,
clEnqueueAcquireD3D11ObjectsKHR,
clEnqueueReleaseD3D11ObjectsKHR
khronos-opencl-man-1.0~svn27110/atom_inc.xml 0000644 0001750 0001750 00000017223 11660441607 020603 0 ustar mathieu mathieu
atom_incatom_inc2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3atom_inc
64-bit atom_inc functions.
long
atom_inc
volatile __global
long*plongval
long
atom_inc
volatile __local
long*plongval
ulong
atom_inc
volatile __global
ulong*pulongval
ulong
atom_inc
volatile __local
ulong*pulongvalDescription
Read the 64-bit value (referred to as old) stored at location pointed by
p. Compute (old + 1) and store
result at location pointed by p. The function returns old.
An application that wants to use this extension will need to include the #pragma
OPENCL EXTENSION cl_khr_int64_base_atomics : enable in the OpenCL program source.
This function is performed in one atomic transaction. These transactions are atomic for the device
executing these atomic functions. There is no guarantee of atomicity if the atomic operations to
the same memory location are being performed by kernels executing on multiple devices.
Atomic operations on 64-bit integers and 32-bit integers (and float) are also atomic with regard to each other.
SpecificationOpenCL SpecificationAlso seeAtomic Functions,
atomic_inc,
cl_khr_int64_base_atomics
khronos-opencl-man-1.0~svn27110/clGetPlatformIDs.xml 0000644 0001750 0001750 00000014654 11660441607 022162 0 ustar mathieu mathieu
clGetPlatformIDsclGetPlatformIDs2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clGetPlatformIDsObtain the list of platforms available.cl_int clGetPlatformIDscl_uintnum_entriescl_platform_id*platformscl_uint*num_platformsParametersnum_entries
The number of cl_platform_id
entries that can be added to platforms. If
platforms is not NULL, the num_entries
must be greater than zero.
platforms
Returns a list of OpenCL platforms found. The cl_platform_id values returned
in platforms can be used to identify a specific OpenCL
platform. If platforms argument is NULL, this argument
is ignored. The number of OpenCL platforms returned is the mininum of the
value specified by num_entries or the number of OpenCL
platforms available.
num_platforms
Returns the number of OpenCL platforms available. If
num_platforms is NULL, this argument is ignored.
Errors
Returns CL_SUCCESS if the function is executed
successfully. Otherwise it returns CL_INVALID_VALUE if
num_entries is equal to zero and platforms is
not NULL, or if both num_platforms and platforms
are NULL.
Returns CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclGetPlatformInfo,
clGetDeviceInfo,
Cardinality Diagram
khronos-opencl-man-1.0~svn27110/vloadn.xml 0000644 0001750 0001750 00000017172 11660441607 020300 0 ustar mathieu mathieu
]>
vloadnvloadn2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3vloadn
Read vectors from a pointer to memory.
gentypen
vloadn
size_t
offsetconst
__global gentype
*p
gentypen
vloadn
size_t
offset
const __local gentype *p
gentypen
vloadn
size_t
offset
const __constant gentype *p
gentypen
vloadn
size_t
offsetconst __private gentype
*pDescription
Return sizeof (gentypen) bytes of data read
from address (p + (offset * n)).
The address computed as (p + (offset *
n)) must be 8-bit aligned if gentype is char
or uchar; 16-bit aligned if gentype is short
or ushort; 32-bit aligned if gentype is int,
uint, or float; 64-bit aligned if gentype
is long or ulong.
If the half extension is enabled, the address computed as
(p + (offset * n)) must be
16-bit aligned.
Notes
&vectorFunctionsInc;
&vectorHalfFunctionsInc;
vload3 and vload_half3 read x,
y, z components from address (p +
(offset * 3)) into a 3-component vector.
SpecificationOpenCL SpecificationAlso seeVector Data Load and Store Functions
khronos-opencl-man-1.0~svn27110/clEnqueueTask.xml 0000644 0001750 0001750 00000032226 11660441607 021563 0 ustar mathieu mathieu
clEnqueueTaskclEnqueueTask2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clEnqueueTask
Enqueues a command to execute a kernel on a device.
cl_int
clEnqueueTask
cl_command_queue
command_queue
cl_kernel
kernel
cl_uint
num_events_in_wait_listconst
cl_event
*event_wait_list
cl_event
*eventParameters command_queue
A valid command-queue. The kernel
will be queued for execution on the device associated with
command_queue.
kernel
A valid kernel object. The
OpenCL context associated with kernel and
command_queue must be the same.
num_events_in_wait_list
,
event_wait_list
Sspecify events that need to
complete before this particular command can be executed. If
event_wait_list is NULL, then this particular command does
not wait on any event to complete. If event_wait_list
is NULL, num_events_in_wait_list must be 0.
If event_wait_list is not NULL, the list of
events pointed to by event_wait_list must be
valid and num_events_in_wait_list must be greater
than 0. The events specified in event_wait_list
act as synchronization points. The context associated with events in
event_wait_list and command_queue must
be the same. The memory associated with event_wait_list
can be reused or freed after the function returns.
event
Returns an event object that identifies
this particular kernel execution instance. Event objects are unique and
can be used to identify a particular kernel execution instance later on. If
event is NULL, no event will be created for this kernel
execution instance and therefore it will not be possible for the application
to query or queue a wait for this particular kernel execution instance.
Notes
The kernel is executed using a single work-item.
clEnqueueTask is equivalent to calling
clEnqueueNDRangeKernel
with work_dim = 1, global_work_offset
= NULL, global_work_size[0] set to 1, and
local_work_size[0] set to 1.
Errors
Returns CL_SUCCESS if the kernel execution was successfully
queued, or one of the errors below:
CL_INVALID_PROGRAM_EXECUTABLE if there is no
successfully built program executable available for device associated with
command_queue.
CL_INVALID_COMMAND_QUEUE if command_queue
is not a valid command-queue.
CL_INVALID_KERNEL if kernel is not a
valid kernel object.
CL_INVALID_CONTEXT if context associated with
command_queue and kernel is not the same
or if the context associated with command_queue and events in
event_wait_list are not the same.
CL_INVALID_KERNEL_ARGS if the kernel argument values have
not been specified.
CL_INVALID_WORK_GROUP_SIZE if a work-group size is
specified for kernel using the __attribute__
((reqd_work_group_size(X, Y, Z))) qualifier in program source and is
not (1, 1, 1).
CL_MISALIGNED_SUB_BUFFER_OFFSET if a sub-buffer object
is specified as the value for an argument that is a buffer object and the
offset specified when the sub-buffer object is created is not
aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device
associated with queue.
CL_INVALID_IMAGE_SIZE if an image object is specified
as an argument value and the image dimensions (image width, height, specified
or compute row and/or slice pitch) are not supported by device associated with
queue.
CL_INVALID_IMAGE_FORMAT if an image object is specified
as an argument value and the image format (image channel order and data type)
is not supported by device associated with queue.
CL_OUT_OF_RESOURCES if there is a failure to queue the
execution instance of kernel on the command-queue because of
insufficient resources needed to execute the kernel.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for data store associated with image or buffer objects specified
as arguments to kernel.
CL_INVALID_EVENT_WAIT_LIST
if event_wait_list is NULL and
num_events_in_wait_list > 0,
or event_wait_list is not NULL and
num_events_in_wait_list is 0, or if event objects in
event_wait_list are not valid events.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclEnqueueNDRangeKernel,
clEnqueueNativeKernel
khronos-opencl-man-1.0~svn27110/printfFunction.xml 0000644 0001750 0001750 00000112415 11660441607 022021 0 ustar mathieu mathieu
printf Function
printf Function
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
printf Function
The OpenCL C programming language implements the printf function.
int
printfconstant
char
* restrictformat, ...
Description
The printf built-in function writes output to
an implementation-defined stream such as stdout under control of the
string pointed to by format that specifies how
subsequent arguments are converted for output. If there are insufficient
arguments for the format, the behavior is undefined. If the format is
exhausted while arguments remain, the excess arguments are evaluated
(as always) but are otherwise ignored. The printf
function returns when the end of the format string is encountered.
Notesprintf returns 0 if it was executed successfully
and -1 otherwise.
printf output synchronization
When the event that is associated with a particular kernel invocation is completed,
the output of all printf() calls executed by this kernel
invocation is flushed to the implementation-defined output stream. Calling
clFinish on a command
queue flushes all pending output by printf in previously enqueued
and completed commands to the implementation-defined output stream. In the case that
printf is executed from multiple work-items concurrently, there
is no guarantee of ordering with respect to written data. For example, it is valid
for the output of a work-item with a global id (0,0,1) to appear intermixed with the
output of a work-item with a global id (0,0,4) and so on.
printf format string
The format shall be a character sequence, beginning and ending in its initial shift
state. The format is composed of zero or more directives: ordinary characters (not
%), which are copied unchanged to the output stream; and conversion specifications,
each of which results in fetching zero or more subsequent arguments, converting them,
if applicable, according to the corresponding conversion specifier, and then writing
the result to the output stream. As format is in the constant address space it must
be resolvable at compile time and thus cannot be dynamically created by the executing
program, itself.
Each conversion specification is introduced by the character %. After the %, the
following appear in sequence:
Zero or more flags (in any order) that modify the meaning
of the conversion specification.
An optional minimum field width. If the converted value has
fewer characters than the field width, it is padded with spaces (by default)
on the left (or right, if the left adjustment flag, described later, has been
given) to the field width. The field width takes the form of a nonnegative decimal
integer.) Note that 0 is taken as a flag, not as the beginning of a field width.
An optional precision that gives the minimum number of digits
to appear for the d, i, o, u, x, and X conversions, the number of digits to
appear after the decimal point character for a, A, e, E, f, and F conversions,
the maximum number of significant digits for the g and G conversions, or the
maximum number of bytes to be written for s conversions. The precision takes
the form of a period (.) followed by an optional decimal integer; if only the
period is specified, the precision is taken as zero. If a precision appears
with any other conversion specifier, the behavior is undefined.
An optional vector specifier.
A length modifier that specifies the size of the argument. The
length modifier is required with a vector specifier and together
specifies the vector type. Implicit conversions between vector types are disallowed
(as per section 6.2.1). If the vector specifier is not specified,
the length modifier is optional.
A conversion specifier character that specifies the type of
conversion to be applied.
The flag characters and their meanings are:
-
The result of the conversion is left-justified within the field. (It
is right-justified if this flag is not specified.)
+
The result of a signed conversion always begins with a plus or
minus sign. (It begins with a sign only when a negative value
is converted if this flag is not specified.) The results of all
floating conversions of a negative zero, and of negative values
that round to zero, include a minus sign.
space
If the first character of a signed conversion is not a sign, or if
a signed conversion results in no characters, a space is prefixed to
the result. If the space and + flags both appear,
the space flag is ignored.
#
The result is converted to an "alternative form". For o conversion,
it increases the precision, if and only if necessary, to force the
first digit of the result to be a zero (if the value and precision
are both 0, a single 0 is printed). For x (or X) conversion, a
nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f,
F, g, and G conversions, the result of converting a floating-point
number always contains a decimal-point character, even if no digits
follow it. (Normally, a decimal-point character appears in the
result of these conversions only if a digit follows it.) For g and
G conversions, trailing zeros are not removed from the result. For
other conversions, the behavior is undefined.
0
For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading
zeros (following any indication of sign or base) are used to pad to
the field width rather than performing space padding, except when
converting an infinity or NaN. If the 0 and
- flags both appear, the 0 flag is ignored. For
d, i, o, u, x, and X conversions, if a precision is specified, the
0 flag is ignored. For other conversions, the behavior is undefined.
The vector specifier and its meaning is:
vn
Specifies that a following a, A, e, E, f, F, g, G, d, i, o, u,
x, or X conversion specifier applies to a vector argument, where
n is the size of the vector and must be 2,
3, 4, 8 or 16. The vector value is displayed in the following general
form:
value1 C value2 C ... C valuen
where C is a separator character. The value for this separator
character is a comma.
If the vector specifier is not used, the length modifiers and their meanings are:
hh
Specifies that a following d, i, o, u, x, or X conversion specifier
applies to a char or uchar argument (the argument will have been promoted
according to the integer promotions, but its value shall be converted to
char or uchar before printing).
h
Specifies that a following d, i, o, u, x, or X conversion specifier
applies to a short or ushort argument (the
argument will have been promoted according to the integer promotions,
but its value shall be converted to short or unsigned
short before printing).
l (ell)
Specifies that a following d, i, o, u, x, or X conversion specifier
applies to a long or ulong argument. The l modifier is supported
by the full profile. For the embedded profile, the l modifier is
supported only if 64-bit integers are supported by the device.
If the vector specifier is used, the length modifiers and their meanings are:
hh
Specifies that a following d, i, o, u, x, or X conversion
specifier applies to a charn or
ucharn argument (the argument will not
be promoted).
h
Specifies that a following d, i, o, u, x, or X conversion
specifier applies to a shortn or
ushortn argument (the argument will not
be promoted); that a following a, A, e, E, f, F, g, or G conversion
specifier applies to a halfn argument if the
cl_khr_fp16
extension is supported.
hl
This modifier can only be used with the vector specifier. Specifies
that a following d, i, o, u, x, or X conversion specifier applies to a
intn or uintn
argument; that a following a, A, e, E, f, F, g, or G conversion
specifier applies to a floatn argument.
l (ell)
Specifies that a following d, i, o, u, x, or X conversion
specifier applies to a longn or
ulongn argument; that a following
a, A, e, E, f, F, g, or G conversion specifier applies to
a doublen argument. The l modifier
is supported by the full profile. For the embedded profile, the l
modifier is supported only if 64-bit integers or double-precision
floating-point are supported by the device.
If a vector specifier appears without a length modifier, the behavior is undefined.
The vector data type described by the vector specifier and length modifier must match
the data type of the argument; otherwise the behavior is undefined.
If a length modifier appears with any conversion specifier other than as specified
above, the behavior is undefined
The conversion specifiers and their meanings are:
d,i
The int, charn,
shortn, intn
or longn argument is converted to signed
decimal in the style [−]dddd. The precision
specifies the minimum number of digits to appear; if the value being
converted can be represented in fewer digits, it is expanded with
leading zeros. The default precision is 1. The result of converting
a zero value with a precision of zero is no characters.
o,u,x,X
The unsigned int, ucharn,
ushortn, uintn
or ulongn argument is converted to unsigned
octal (o), unsigned decimal (u), or unsigned hexadecimal notation (x
or X) in the style dddd; the letters abcdef are
used for x conversion and the letters ABCDEF for X conversion. The
precision specifies the minimum number of digits to appear; if the
value being converted can be represented in fewer digits, it is
expanded with leading zeros. The default precision is 1. The result
of converting a zero value with a precision of zero is no characters.
f,F
A double, halfn,
floatn or doublen
argument representing a floating-point number is converted to decimal
notation in the style [−]ddd.ddd,
where the number of digits after the decimal-point character is
equal to the precision specification. If the precision is missing,
it is taken as 6; if the precision is zero and the # flag is not
specified, no decimal-point character appears. If a decimal-point
character appears, at least one digit appears before it. The
value is rounded to the appropriate number of digits. A double,
halfn, floatn
or doublen argument representing an infinity
is converted in one of the styles [-]inf or [-]infinity — which style
is implementation-defined. A double, halfn,
floatn or doublen
argument representing a NaN is converted in one of the styles [-
]nan or [-]nan(n-char-sequence) — which style, and the meaning
of any n-charsequence, is implementation-defined. The F conversion
specifier produces INF, INFINITY, or NAN instead of inf, infinity, or
nan, respectively. When applied to infinite and NaN values, the -,
+, and space flag characters have their
usual meaning; the # and 0 flag characters have no effect.
e,E
A double, halfn,
floatn or doublen
argument representing a floating-point number is converted in the style
[−]d.ddd e±dd,
where there is one digit (which is nonzero if the argument is nonzero)
before the decimal-point character and the number of digits after it is
equal to the precision; if the precision is missing, it is taken as 6; if
the precision is zero and the # flag is not specified, no decimal-point
character appears. The value is rounded to the appropriate number of
digits. The E conversion specifier produces a number with E instead
of e introducing the exponent. The exponent always contains at least
two digits, and only as many more digits as necessary to represent
the exponent. If the value is zero, the exponent is zero. A double,
halfn, floatn
or doublen argument representing an infinity
or NaN is converted in the style of an f or F conversion specifier
g,G
A double, halfn,
floatn or doublen
argument representing a floating-point number is converted in
style f or e (or in style F or E in the case of a G conversion
specifier), depending on the value converted and the precision. Let
P equal the precision if nonzero, 6 if
the precision is omitted, or 1 if the precision is zero. Then, if a
conversion with style E would have an exponent of X:
— if P > X ≥ −4, the
conversion is with style f (or F) and precision P
− (X + 1). — otherwise, the conversion is with
style e (or E) and precision P − 1. Finally,
unless the # flag is used, any trailing zeros are removed from the
fractional portion of the result and the decimal-point character
is removed if there is no fractional portion remaining. A double,
halfn, floatn or
doublen e argument representing an infinity
or NaN is converted in the style of an f or F conversion specifier.
a,A
A double, halfn,
floatn or doublen
argument representing a floating-point number is converted in the style
[−]0xh.hhhh p±d,
where there is one hexadecimal digit (which is nonzero if the argument
is a normalized floating-point number and is otherwise unspecified)
before the decimal-point character) and the number of hexadecimal digits
after it is equal to the precision; if the precision is missing, then
the precision is sufficient for an exact representation of the value;
if the precision is zero and the # flag is not specified, no decimal
point character appears. The letters abcdef are used for a conversion
and the letters ABCDEF for A conversion. The A conversion specifier
produces a number with X and P instead of x and p. The exponent
always contains at least one digit, and only as many more digits as
necessary to represent the decimal exponent of 2. If the value is zero,
the exponent is zero. A double, halfn,
floatn or doublen
argument representing an infinity or NaN is converted in the style
of an f or F conversion specifier. Binary implementations can choose
the hexadecimal digit to the left of the decimal-point character so
that subsequent digits align to nibble (4-bit) boundaries.
NOTE: The conversion specifiers e,E,g,G,a,A convert a float or half argument that is
a scalar type to a double only if the double data type is supported. If the double
data type is not supported, the argument will be a float instead of a double and the
half type will be converted to a float.
c
The int argument is converted to an unsigned char, and the resulting character is written.
s
The argument shall be a literal string. No special provisions are made
for multibyte characters. The behavior of printf
with the s conversion specifier is undefined if the argument value
is not a pointer to a literal string. Characters from the literal
string array are written up to (but not including) the terminating
null character. If the precision is specified, no more than that many
bytes are written. If the precision is not specified or is greater
than the size of the array, the array shall contain a null character.
p
The argument shall be a pointer to void. The pointer can refer to
a memory region in the global, constant, local or private address
space. The value of the pointer is converted to a sequence of
printing characters in an implementation-defined manner.
%
A % character is written. No argument is converted. The complete conversion
specification shall be %%.
If a conversion specification is invalid, the behavior is undefined. If any argument
is not the correct type for the corresponding conversion specification, the behavior
is undefined.
In no case does a nonexistent or small field width cause truncation of a field; if
the result of a conversion is wider than the field width, the field is expanded to
contain the conversion result.
For a and A conversions, the value is correctly rounded to a hexadecimal floating
number with the given precision.
Differences between OpenCL C and C99 printf
The l modifier followed by a c conversion specifier or s conversion specifier
is not supported by OpenCL C.
The ll, j, z, t, and L length modifiers are not supported by OpenCL C.
The n conversion specifier is not supported by OpenCL C but is reserved.
OpenCL C adds the optional vn vector specifier to support printing of vector types.
The conversion specifiers f, F, e, E, g, G, a, A convert a float argument to
a double only if the double data type is supported. Refer to the description
of CL_DEVICE_DOUBLE_FP_CONFIG. If the double data type is
not supported, the argument will be a float instead of a double.
For the embedded profile, the l length modifier is supported only if 64-bit integers are supported.
In OpenCL C, printf returns 0 if it was executed successfully
and -1 otherwise vs. C99 where printf returns the number
of characters printed or a negative value if an output or encoding error occurred.
In OpenCL C, the conversion specifier s can only be used for arguments that are literal strings.
Examples
float4 f = (float4)(1.0f, 2.0f, 3.0f, 4.0f);
uchar4 uc = (uchar4)(0xFA, 0xFB, 0xFC, 0xFD);
printf("f4 = %2.2v4hlf\n", f);
printf("uc = %#v4hhx\n", uc);
// The above two calls print the following:
f4 = 1.00,2.00,3.00,4.00
uc = 0xfa,0xfb,0xfc,0xfd
A few examples of valid use cases of printf for the conversion
specifier s are given below. The argument value must be a pointer to a literal string.
kernel void my_kernel( ... )
{
printf("%s\n", "this is a test string\n");
}
A few examples of invalid use cases of printf for the conversion
specifier s are given below:
kernel void my_kernel(global char *s, ... )
{
printf("%s\n", s);
constant char *p = "this is a test string\n";
printf("%s\n", p);
printf("%s\n", &p[3]);
}
A few examples of invalid use cases of printf where data types given by the vector
specifier and length modifier do not match the argument type are given below:
kernel void my_kernel(global char *s, … )
{
uint2 ui = (uint2)(0x12345678, 0x87654321);
printf("unsigned short value = (%#v2hx)\n", ui)
printf("unsigned char value = (%#v2hhx)\n", ui)
}
SpecificationOpenCL Specification
khronos-opencl-man-1.0~svn27110/write_image1d.xml 0000644 0001750 0001750 00000043001 11660441607 021524 0 ustar mathieu mathieu
[
]>
write_image1dwrite_image (1D)2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3write_image1d
Write color value to location in a 1D image object.
void
write_imagef
image1d_t
image
int
coord
float4
color
void
write_imagef
image1d_buffer_t
image
int
coord
float4
color
void
write_imagef
image1d_array_t
image
int2
coord
float4
color
void
write_imagei
image1d_t
image
int
coord
int4
color
void
write_imagei
image1d_buffer_t
image
int
coord
int4
color
void
write_imagei
image1d_array_t
image
int2
coord
int4
color
void
write_imageui
image1d_t
image
int
coord
uint4
color
void
write_imageui
image1d_buffer_t
image
int
coord
uint4
color
void
write_imageui
image1d_array_t
image
int2
coord
uint4
color
void
write_imageh
image1d_t
image
int
coord
half4
color
void
write_imageh
image1d_buffer_t
image
int
coord
half4
color
void
write_imageh
image1d_array_t
image
int2
coord
half4
colorDescriptionwrite_imagef can only be used with image objects created with
image_channel_data_type set to one of the pre-defined packed formats
or set to CL_SNORM_INT8, CL_UNORM_INT8,
CL_SNORM_INT16, CL_UNORM_INT16,
CL_HALF_FLOAT, or CL_FLOAT. Appropriate data
format conversion will be done to convert channel data from a floating-point value to
actual data format in which the channels are stored.
write_imagei functions can only be used with image objects
created with image_channel_data_type set to one of the following
values: CL_SIGNED_INT8, CL_SIGNED_INT16,
or CL_SIGNED_INT32.
write_imageui functions can only be used with image objects
created with image_channel_data_type set to one of the following
values: CL_UNSIGNED_INT8, CL_UNSIGNED_INT16,
or CL_UNSIGNED_INT32.
The write_imageh functions are enabled when the half type is
supported and can only be used with image objects created with
image_channel_data_type set to one of the pre-defined packed formats
or set to CL_SNORM_INT8, CL_UNORM_INT8,
CL_SNORM_INT16, CL_UNORM_INT16 or
CL_HALF_FLOAT. Appropriate data format conversion will be done
to convert channel data from a floating-point value to actual data format in which
the channels are stored.
Functions that take image1d_t or image1d_buffer_t
The functions that take image1d_t or image1d_buffer_t write the color
value to the location specified by coord in the 1D image or 1D image buffer
object specified by image. Appropriate data format conversion to the
specified image format is done before writing the color value. coord is
considered to be unnormalized coordinates and must be in the range 0... image width - 1.
for functions taking image1d_t or image1d_buffer_t, the behavior of
write_imagef, write_imagei,
write_imageui, and write_imageh for image
objects created with image_channel_data_type values not specified in
the description above or with coordinate values that are not in the range (0... image
width - 1), is undefined.
Functions that take image1d_array_t
The functions that take image1d_array_t write the color value to the location specified by
coord.x in the 1D image identified by coord.y
in the 1D image array specified by image. Appropriate data format
conversion to the specified image format is done before writing the color value.
coord.x and coord.y are considered to be
unnormalized coordinates and must be in the range 0 … image width - 1 and 0 …
image number of layers - 1.
For functions taking image1d_array_t, the behavior of write_imagef,
write_imagei and write_imageui for image
objects created with image_channel_data_type values not specified
in the description above or with (x, y) coordinate values that are not in the range
(0 … image width - 1, 0 …image number of layers - 1), respectively, is undefined.
Notes
&imageFunctionsInc;
SpecificationOpenCL SpecificationAlso seeImage Functions
khronos-opencl-man-1.0~svn27110/dot.xml 0000644 0001750 0001750 00000013345 11660441607 017601 0 ustar mathieu mathieu
]>
dotdot2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3dot
Dot product.
float
dot
floatnp0floatnp1
double
dot
doublenp0doublenp1halfdot (gentypep0,
gentypep1) // if half extension enabled
Description
Computes the dot product.
Notes
&geometricFunctionsInc;
If extended with
cl_khr_fp16, generic type name
gentype may indicate half and half{2|3|4} as
arguments.
SpecificationOpenCL SpecificationAlso seeGeometric Functions
khronos-opencl-man-1.0~svn27110/clGetDeviceIDsFromD3D10KHR.xml 0000644 0001750 0001750 00000030063 11660441607 023412 0 ustar mathieu mathieu
]>
clGetDeviceIDsFromD3D10KHRclGetDeviceIDsFromD3D10KHR2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3clGetDeviceIDsFromD3D10KHRQuerying OpenCL Devices Corresponding to Direct3D 10 Devices.
cl_int
clGetDeviceIDsFromD3D10KHRcl_platform_idplatformcl_d3d10_device_source_khrd3d_device_sourcevoid*d3d_objectcl_d3d10_device_set_khrd3d_device_setcl_uintnum_entriescl_device_id*devicescl_uint*num_devicesParametersplatform
Refers to the platform ID returned by
clGetPlatformIDs.
d3d_device_source
Specifies the type of d3d_object and may be one of the following:.
cl_d3d_device_source_khrType of d3d_objectCL_D3D10_DEVICE_KHRID3D10Device *CL_D3D10_DXGI_ADAPTER_KHRIDXGIAdapter *d3d_object
Specifies the object whose corresponding OpenCL devices are being queried. The type of
d3d_object must be as specified in the table above.
d3d_device_set
Specifies the set of devices to return, and must be one of the following:
cl_d3d_device_set_khrDevices returned in devicesCL_PREFERRED_DEVICES_FOR_D3D10_KHR
The OpenCL devices associated with the specified Direct3D object.
CL_ALL_DEVICES_FOR_D3D10_KHR
All OpenCL devices which may interoperate with the specified
Direct3D object. Performance of sharing data on these devices
may be considerably less than on the preferred devices.
num_entries
The number of cl_device_id entries that can be added to
devices. If devices is not NULL,
the num_entries must be greater than zero.
devices
Returns a list of OpenCL devices found. The cl_device_id values returned
in devices can be used to identify a specific OpenCL
device. If devices is NULL, this argument is ignored. The
number of OpenCL devices returned is the mininum of the value specified by
num_entries and the number of OpenCL devices corresponding
to d3d_object.
num_devices
Returns the number of OpenCL devices available that correspond to
d3d_object. If num_devices is NULL,
this argument is ignored.
Description
The OpenCL devices corresponding to a Direct3D 10 device may be queried. The OpenCL
devices corresponding to a DXGI adapter may also be queried. The OpenCL devices
corresponding to a Direct3D 10 device will be a subset of the OpenCL devices
corresponding to the DXGI adapter against which the Direct3D 10 device was created.
Notes
&sharingD3D10Inc;
Errors
Returns CL_SUCCESS if the function is executed successfully. Otherwise it may return:
CL_INVALID_PLATFORM if platform is not
a valid platform.
CL_INVALID_VALUE if d3d_device_source
is not a valid value, d3d_device_set is not a valid value,
num_entries is equal to zero and devices is
not NULL, or if both num_devices and devices
are NULL.
CL_DEVICE_NOT_FOUND if no OpenCL devices that correspond
to d3d_object were found.
SpecificationOpenCL SpecificationAlso seecl_khr_d3d10_sharing,
clCreateFromD3D10BufferKHR,
clCreateFromD3D10Texture2DKHR,
clCreateFromD3D10Texture3DKHR,
clEnqueueAcquireD3D10ObjectsKHR,
clEnqueueReleaseD3D10ObjectsKHR
khronos-opencl-man-1.0~svn27110/get_image_channel_data_type.xml 0000644 0001750 0001750 00000025434 11660441607 024460 0 ustar mathieu mathieu
get_image_channel_data_typeget_image_channel_data_type2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_image_channel_data_type
Return the channel data type.
int
get_image_channel_data_type
image1d_t
image
int
get_image_channel_data_type
image1d_buffer_t
image
int
get_image_channel_data_type
image2d_t
image
int
get_image_channel_data_type
image3d_t
image
int
get_image_channel_data_type
image1d_array_t
image
int
get_image_channel_data_type
image2d_array_t
imageDescription
Return the channel data type. Valid values are:
CLK_SNORM_INT8
CLK_SNORM_INT16
CLK_UNORM_INT8
CLK_UNORM_INT16
CLK_UNORM_SHORT_565
CLK_UNORM_SHORT_555
CLK_UNORM_SHORT_101010
CLK_SIGNED_INT8
CLK_SIGNED_INT16
CLK_SIGNED_INT32
CLK_UNSIGNED_INT8
CLK_UNSIGNED_INT16
CLK_UNSIGNED_INT32
CLK_HALF_FLOAT
CLK_FLOATNotes
The values returned by get_image_channel_order
as shown above with the CLK_ prefixes correspond
to the CL_ prefixes used to describe the image
channel order and data type in the table of supported names and values in
clCreateSubBuffer
and list of supported Image Channel Order Values for
clCreateImage. For
example, both CL_UNORM_INT8 and CLK_UNORM_INT8
refer to an image channel data type that is an unnormalized unsigned 8-bit integer.
The following table describes the mapping of the number of channels of an image
element to the appropriate components in the float4, int4 or uint4 vector data type
for the color values returned by read_image{f|i|ui} or supplied
to write_image{f|i|ui}. The unmapped components will be set
to 0.0 for red, green and blue channels and will be set to
1.0 for the alpha channel.
Channel Orderfloat4, int4 or unsigned int4 components of channel dataCL_R, CL_Rx(r, 0.0, 0.0, 1.0)CL_A(0.0, 0.0, 0.0, a)CL_RG, CL_RGx(r, g, 0.0, 1.0)CL_RA(r, 0.0, 0.0, a)CL_RGB, CL_RGBx(r, g, b, 1.0)CL_RGBA, CL_BGRA, CL_ARGB(r, g, b, a)CL_INTENSITY(I, I, I, I)CL_LUMINANCE(L, L, L, 1.0)
A kernel that uses a sampler with the CL_ADDRESS_CLAMP addressing
mode with multiple images may result in additional samplers being used internally by an
implementation. If the same sampler is used with multiple images called via read_image{f|i|ui},
then it is possible that an implementation may need to allocate an additional
sampler to handle the different border color values that may be needed depending
on the image formats being used. These implementation allocated samplers
will count against the maximum sampler values supported by the device and
given by CL_DEVICE_MAX_SAMPLERS. Enqueuing a kernel that
requires more samplers than the implementation can support will result in a
CL_OUT_OF_RESOURCES error being returned.
SpecificationOpenCL SpecificationAlso seeImage Functions
khronos-opencl-man-1.0~svn27110/commonFunctionsInc.xml 0000644 0001750 0001750 00000002506 11660441607 022623 0 ustar mathieu mathieu
The generic type name gentype is used to indicate that the function can
take float, float2, float3, float4,
float8, float16, double, double2,
double3, double4, double8, or double16
as the type for the arguments.
The generic type name gentypef is used to indicate that the function can
take float, float2, float3, float4,
float8, or float16 as the type for the arguments.
The generic type name gentyped is used to indicate that the function can take
double, double2, double3, double4,
double8, or double16 as the type for the arguments.
The built-in common functions are implemented using the round to nearest even rounding mode.
khronos-opencl-man-1.0~svn27110/get_local_id.xml 0000644 0001750 0001750 00000011061 11660441607 021411 0 ustar mathieu mathieu
get_local_idget_local_id2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3get_local_id
Returns the unique local work-item ID.
size_t
get_local_id
uintdimindxDescription
Returns the unique local work-item ID, i.e. a work-item
within a specific work-group for dimension identified by
dimindx. Valid values of dimindx are 0 to
get_work_dim() - 1. For other
values of dimindx, get_local_id() returns 0.
For clEnqueueTask, this
returns 0.
SpecificationOpenCL SpecificationAlso seeWork-Item Functions,
clEnqueueNDRangeKernel,
clEnqueueTask
khronos-opencl-man-1.0~svn27110/erf.xml 0000644 0001750 0001750 00000010645 11660441607 017567 0 ustar mathieu mathieu
]>
erf, erfcacos2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3erf, erfc
Error functions.
gentype
erf
gentype
gentype
erfc
gentypeDescriptionerf is the error function encountered in integrating the normal
distribution.
erfc is the complementary error function.
Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/lgamma.xml 0000644 0001750 0001750 00000044227 11660441607 020254 0 ustar mathieu mathieu
]>
lgamma, lgamma_rlgamma, lgamma_r2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3lgamma, lgamma_r
Log gamma functions.
gentype
lgamma
gentypex
floatn
lgamma_r
floatnx__global
intn*signp
floatn
lgamma_r
floatnx__local
intn*signp
floatn
lgamma_r
floatnx__private
intn*signp
float
lgamma_r
float
x__global
int
*signp
float
lgamma_r
float
x__local
int
*signp
float
lgamma_r
float
x__private
int
*signp
doublen
lgamma_r
doublenx__global
intn*signp
doublen
lgamma_r
doublenx__local
intn*signp
doublen
lgamma_r
doublenx__private
intn*signp
double
lgamma_r
double
x__global
int
*signp
double
lgamma_r
double
x__local
int
*signp
double
lgamma_r
double
x__private
int
*signp
halfn
lgamma_r
halfnx__global
intn*signp
halfn
lgamma_r
halfnx__local
intn*signp
halfn
lgamma_r
halfnx__private
intn*signp
half
lgamma_r
half
x__global
int
*signp
half
lgamma_r
half
x__local
int
*signp
half
lgamma_r
half
x__private
int
*signpDescription
Returns the natural logarithm of the absolute value of the gamma function. The sign
of the gamma function is returned in the signp argument of the
lgamma_r.
An application that wants to use half
and halfn types
will need to include the #pragma OPENCL EXTENSION
cl_khr_fp16
: enable directive. If extended with
cl_khr_fp16,
generic type name gentype also includes half and
half{2|3|4|8|16}.
Notes
&mathFunctionsInc;
SpecificationOpenCL SpecificationAlso seeMath Functions
khronos-opencl-man-1.0~svn27110/clEnqueueWriteBuffer.xml 0000644 0001750 0001750 00000040064 11660441607 023104 0 ustar mathieu mathieu
clEnqueueWriteBuffer
clEnqueueWriteBuffer
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clEnqueueWriteBuffer
Enqueue commands to write to a buffer object from host memory.
cl_int
clEnqueueWriteBuffercl_command_queuecommand_queuecl_membuffercl_boolblocking_writesize_toffsetsize_tsizeconst void*ptrcl_uintnum_events_in_wait_listconst cl_event*event_wait_listcl_event*eventParameters command_queue
Refers to the command-queue in which the write command will be
queued. command_queue and buffer must
be created with the same OpenCL context.
buffer
Refers to a valid buffer object.
blocking_write
Indicates if the write operations are
blocking or nonblocking.
If blocking_write is CL_TRUE, the
OpenCL implementation copies the data referred to by ptr
and enqueues the write operation in the command-queue. The memory pointed
to by ptr can be reused by the application after the
clEnqueueWriteBuffer call returns.
If blocking_write is CL_FALSE,
the OpenCL implementation will use ptr to perform a
nonblocking write. As the write is non-blocking the implementation can return
immediately. The memory pointed to by ptr cannot be reused
by the application after the call returns. The event
argument returns an event object which can be used to query the execution
status of the write command. When the write command has completed, the memory
pointed to by ptr can then be reused by the application.
offset
The offset in bytes in the buffer object to write to.
size
The size in bytes of data being written.
ptr
The pointer to buffer in host memory where data is to be written from.
event_wait_list
num_events_in_wait_list
event_wait_list
and num_events_in_wait_list specify events that
need to complete before this particular command can be executed. If
event_wait_list is NULL, then this particular command does
not wait on any event to complete. If event_wait_list
is NULL, num_events_in_wait_list must be 0. If
event_wait_list is not NULL, the list of events
pointed to by event_wait_list must be valid
and num_events_in_wait_list must be greater
than 0. The events specified in event_wait_list
act as synchronization points. The context associated with events in
event_wait_list and command_queue must
be the same. The memory associated with event_wait_list
can be reused or freed after the function returns.
event
Returns an event object that identifies
this particular write command and can be used to query or queue a wait
for this particular command to complete. event can be
NULL in which case it will not be possible for the application to query
the status of this command or queue a wait for this command to complete.
Notes
Calling clEnqueueWriteBuffer to update the latest bits
in a region of the buffer object with the ptr argument
value set to host_ptr + offset, where
host_ptr is a pointer to the memory region specified when the
buffer object being written is created with CL_MEM_USE_HOST_PTR,
must meet the following requirements in order to avoid undefined behavior:
The host memory region given by (host_ptr + offset, cb)
contains the latest bits when the enqueued write command begins execution.
The buffer object or memory objects created from this buffer object are not mapped.
The buffer object or memory objects created from this buffer object are not used
by any command-queue until the read command has finished execution.
ErrorsclEnqueueWriteBuffer returns CL_SUCCESS if
the function is executed successfully. Otherwise, it returns one of the following errors:
CL_INVALID_COMMAND_QUEUE if command_queue
is not a valid command-queue.
CL_INVALID_CONTEXT if the context associated with
command_queue and buffer are not the same
or if the context associated with command_queue and events in
event_wait_list are not the same.
CL_INVALID_MEM_OBJECT if buffer
is not a valid buffer object.
CL_INVALID_VALUE if the region being written specified
by (offset, size) is out of bounds or if
ptr is a NULL value or if size is 0.
CL_INVALID_EVENT_WAIT_LIST
if event_wait_list is NULL and
num_events_in_wait_list greater than
0, or event_wait_list is not NULL and
num_events_in_wait_list is 0, or if event objects in
event_wait_list are not valid events.
CL_MISALIGNED_SUB_BUFFER_OFFSET if
buffer is a sub-buffer object and offset
specified when the sub-buffer object is created is not aligned to
CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated
with queue.
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the read
and write operations are blocking and the execution status of any of the events
in event_wait_list is a negative integer value.
CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to
allocate memory for data store associated with buffer.
CL_INVALID_OPERATION if
clEnqueueWriteBuffer
is called on buffer which has been
created with CL_MEM_HOST_READ_ONLY or
CL_MEM_HOST_NO_ACCESS.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclEnqueueCopyBuffer,
clEnqueueReadBuffer,
clEnqueueReadBufferRect,
clEnqueueWriteBufferRect
khronos-opencl-man-1.0~svn27110/clGetMemObjectInfo.xml 0000644 0001750 0001750 00000060650 11660441607 022454 0 ustar mathieu mathieu
clGetMemObjectInfo
clGetMemObjectInfo
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clGetMemObjectInfo
Get information that is common to all memory objects (buffer and image objects).
cl_int
clGetMemObjectInfo
cl_mem
memobj
cl_mem_info
param_name
size_t
param_value_size
void
*param_value
size_t
*param_value_size_retParameters memobj
Specifies the memory object being queried.
param_name
Specifies the information to query. The list of supported
param_name types and the
information returned in param_value by
clGetMemObjectInfo is described
in the table below.
cl_mem_infoReturn TypeInfo. returned in param_valueCL_MEM_TYPEcl_mem_object_type
Returns one of the following values:
CL_MEM_OBJECT_BUFFER
if memobj is created with
clCreateBuffer
or
clCreateSubBuffer.
cl_image_desc.image_type argument value if
memobj is created with
clCreateImage.
CL_MEM_FLAGScl_mem_flags
Returns the flags argument value
specified when memobj is created with
clCreateBuffer,
clCreateSubBuffer,
or
clCreateImage.
If memobj is a sub-buffer the memory
access qualifiers inherited from parent buffer is also
returned
CL_MEM_SIZEsize_t
Return actual size of the data store associated with memobj in bytes.
CL_MEM_HOST_PTRvoid *
If memobj is created with
clCreateBuffer
or
clCreateImage
and CL_MEM_USE_HOST_PTR is
specified in mem_flags, return the
host_ptr argument value specified when
memobj is created. Otherwise a NULL
value is returned.
If memobj is created with
clCreateSubBuffer,
return the host_ptr
+ origin value
specified when memobj
is created. host_ptr
is the argument value specified to
clCreateBuffer
and CL_MEM_USE_HOST_PTR is specified
in mem_flags for memory object from
which memobj is created. Otherwise a
NULL value is returned.
CL_MEM_MAP_COUNTcl_uint
Map count. The map count returned should be considered immediately stale. It is
unsuitable for general use in applications. This feature is provided for debugging.
CL_MEM_REFERENCE_COUNTcl_uint
Return memobj reference count. The reference count returned should
be considered immediately stale. It is unsuitable for general use in
applications. This feature is provided for identifying memory leaks.
CL_MEM_CONTEXTcl_context
Return context specified when memory object is created.
If memobj is created using
clCreateSubBuffer, the context
associated with the memory object specified as the buffer argument to
clCreateSubBuffer is returned.
CL_MEM_ASSOCIATED_-
MEMOBJECTcl_mem
Return memory object from which memobj is created.
This returns the memory object specified
as buffer argument to
clCreateSubBuffer.
Otherwise a NULL value is returned.
CL_MEM_OFFSETsize_t
Return offset if memobj is a sub-buffer object created using
clCreateSubBuffer.
This returns 0 if memobj is not a subbuffer object.
CL_MEM_D3D10_RESOURCE_KHRID3D10Resource *
The property being queried (if the
cl_khr_d3d10_sharing
extension is enabled). If memobj was created using
clCreateFromD3D10BufferKHR,
clCreateFromD3D10Texture2DKHR,
or clCreateFromD3D10Texture3DKHR,
returns the resource argument specified
when memobj was created.
CL_MEM_DX9_MEDIA_-
ADAPTER_TYPE_KHRcl_dx9_media_-
adapter_type_khr
Returns the cl_dx9_media_adapter_type_khr argument
value specified when memobj is created using
clCreateFromDX9MediaSurfaceKHR
(If the cl_khr_dx9_media_sharing
extension is supported)CL_MEM_DX9_MEDIA_-
SURFACE_INFO_KHRcl_dx9_-
surface_info_khr
Returns the cl_dx9_surface_info_khr
argument value specified when memobj is created using
clCreateFromDX9MediaSurfaceKHR
(If the cl_khr_dx9_media_sharing
extension is supported)
CL_MEM_D3D11_RESOURCE_KHRID3D11Resource *If the cl_khr_d3d11_sharing extension is supported,
If memobj was created using
clCreateFromD3D11BufferKHR,
clCreateFromD3D11Texture2DKHR, or
clCreateFromD3D11Texture3DKHR,
returns the resource argument specified when memobj was created.
param_value
A pointer to memory where the appropriate result being queried is returned.
If param_value is NULL, it is ignored.
param_value_size
Used to specify the size in bytes of memory pointed to by param_value.
This size must be ≥ size of return type as described in the table above.
param_value_size_ret
Returns the actual size in bytes of data being queried by param_value.
If param_value_size_ret is NULL, it is ignored.
Errors
Returns CL_SUCCESS if the function is executed successfully.
Otherwise, it returns one of the following errors:
CL_INVALID_VALUE if param_name is not valid, or if size
in bytes specified by param_value_size is < the size of return type as
described in the table above and param_value is not NULL.
CL_INVALID_MEM_OBJECT if memobj
is a not a valid memory object.
CL_OUT_OF_RESOURCES if there is a failure to
allocate resources required by the
OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to
allocate resources required by the
OpenCL implementation on the host.
CL_INVALID_D3D10_RESOURCE_KHR If the
cl_khr_d3d10_sharing
extension is enabled and if param_name
is CL_MEM_D3D10_RESOURCE_KHR
and memobj was not created by the function
clCreateFromD3D10BufferKHR,
clCreateFromD3D10Texture2DKHR,
or
clCreateFromD3D10Texture3DKHR.
CL_INVALID_DX9_MEDIA_SURFACE_KHR
if param_name is
CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR
and memobj was not created by the function
clCreateFromDX9MediaSurfaceKHR
from a Direct3D9 surface. (If the
cl_khr_dx9_media_sharing
extension is supported)
CL_INVALID_D3D11_RESOURCE_KHR
If the cl_khr_d3d11_sharing extension is supported, if
param_name is CL_MEM_D3D11_RESOURCE_KHR
and memobj was not created by the function
clCreateFromD3D11BufferKHR,
clCreateFromD3D11Texture2DKHR,
or
clCreateFromD3D11Texture3DKHR."
SpecificationOpenCL SpecificationAlso seeclGetImageInfo
khronos-opencl-man-1.0~svn27110/clBuildProgram.xml 0000644 0001750 0001750 00000033552 11660441607 021723 0 ustar mathieu mathieu
]>
clBuildProgram
clBuildProgram
2007-2011The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the condition that this copyright notice and permission notice shall be included
in all copies or substantial portions of the Materials.3
clBuildProgram
Builds (compiles and links) a program executable from the program source or binary.
cl_int
clBuildProgramcl_programprogramcl_uintnum_devicesconst cl_device_id*device_listconst char*optionsvoid(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data)void*user_dataParameters program
The program object.
device_list
A pointer to a list of devices associated with program. If
device_list is NULL value, the program executable is
built for all devices associated with program for which
a source or binary has been loaded. If device_list is
a non-NULL value, the program executable is built for devices specified
in this list for which a source or binary has been loaded.
num_devices
The number of devices listed in device_list.
options
A pointer to a null-terminated string of characters that describes the
build options to be used for building the program executable. The list
of supported options is described below.
pfn_notify
A function pointer to a notification routine. The notification routine
is a callback function that an application can register and which will
be called when the program executable has been built (successfully
or unsuccessfully). If pfn_notify is not NULL,
clBuildProgram does not need to wait for the
build to complete and can return immediately once the build operation
can begin. The build operation can begin if the context, program whose
sources are being compiled and linked, list of devices and build options
specified are all valid and appropriate host and device resources needed
to perform the build are available. If pfn_notify
is NULL, clBuildProgram does not return until the
build has completed. This callback function may be called asynchronously
by the OpenCL implementation. It is the application’s responsibility
to ensure that the callback function is thread-safe.
user_data
Passed as an argument when pfn_notify is
called. user_data can be NULL.
Notes
Builds (compiles & links) a program executable from the program source
or binary for all the devices or a specific device(s) in the OpenCL context
associated with program. OpenCL allows program executables to
be built using the source or the binary. clBuildProgram
must be called for program created using either
clCreateProgramWithSource or
clCreateProgramWithBinary
to build the program executable for one or more devices associated with
program. If program is created with
clCreateProgramWithBinary,
then the program binary must be an executable binary (not a compiled binary or library).
The executable binary can be queried using
clGetProgramInfo(program,
CL_PROGRAM_BINARIES, ...) and can be specified to
clCreateProgramWithBinary
to create a new program object.
&buildOptionsInc;
ErrorsclBuildProgram returns CL_SUCCESS if the
function is executed successfully. Otherwise, it returns one of the following errors:
CL_INVALID_PROGRAM if program is not
a valid program object.
CL_INVALID_VALUE if device_list
is NULL and num_devices is greater than zero, or if
device_list is not NULL and num_devices
is zero.
CL_INVALID_VALUE if pfn_notify is NULL
but user_data is not NULL.
CL_INVALID_DEVICE if OpenCL devices listed in
device_list are not in the list of devices associated with
program.
CL_INVALID_BINARY
if program is created with
clCreateProgramWithBinary
and devices listed in device_list do not have a valid program
binary loaded.
CL_INVALID_BUILD_OPTIONS if the build options specified
by options are invalid.
CL_INVALID_OPERATION if the build of a program executable for
any of the devices listed in device_list by a previous call to
clBuildProgram for program has not completed.
CL_COMPILER_NOT_AVAILABLE
if program is created with
clCreateProgramWithSource
and a compiler is not available i.e.
CL_DEVICE_COMPILER_AVAILABLE
specified in the table of OpenCL Device Queries for
clGetDeviceInfo
is set to CL_FALSE.
CL_BUILD_PROGRAM_FAILURE if there is a failure
to build the program executable. This error will be returned if
clBuildProgram does not return until the build has completed.
CL_INVALID_OPERATION if there are kernel objects attached
to program.
CL_INVALID_OPERATION if program was not created with
clCreateProgramWithSource
or
clCreateProgramWithBinary.
CL_OUT_OF_RESOURCES if there is a failure to allocate
resources required by the OpenCL implementation on the device.
CL_OUT_OF_HOST_MEMORY if there is a failure to allocate
resources required by the OpenCL implementation on the host.
SpecificationOpenCL SpecificationAlso seeclGetDeviceInfo
khronos-opencl-man-1.0~svn27110/sharingD3D11Inc.xml 0000644 0001750 0001750 00000010017 11660441607 021526 0 ustar mathieu mathieu
General information about sharing memory objects with Direct3D 11 follows.
The goal of this extension is to provide
interoperability between OpenCL and Direct3D 11. This is designed to function analogously
to the OpenGL interoperability. If this extension is
supported by an implementation, the string
cl_khr_d3d11_sharing
will be present in the
CL_PLATFORM_EXTENSIONS or CL_DEVICE_EXTENSIONS
string described in the table of allowed
values for param_name for
clGetDeviceInfo.
As currently proposed the interfaces for this extension would be provided in
cl_d3d11.h.
This section discusses OpenCL functions that allow
applications to use Direct3D 11 resources as OpenCL memory objects. This allows efficient
sharing of data between OpenCL and Direct3D 11. The OpenCL API may be used to execute
kernels that read and/or write memory objects that are also Direct3D 11 resources. An
OpenCL image object may be created from a Direct3D 11 texture resource. An OpenCL buffer
object may be created from a Direct3D 11 buffer resource. OpenCL memory objects may be
created from Direct3D 11 objects if and only if the OpenCL context has been created from
a Direct3D 11 device.
An OpenCL memory object created from a
Direct3D 11 resource remains valid as long as the corresponding Direct3D 11 resource has
not been deleted. If the Direct3D 11 resource is deleted through the Direct3D 11 API,
subsequent use of the OpenCL memory object will result in undefined behavior, including
but not limited to possible OpenCL errors, data corruption, and program termination.
The successful creation of a
cl_context against a Direct3D 11 device specified via the context create parameter
CL_CONTEXT_D3D11_DEVICE_KHR will increment the internal Direct3D
reference count on the specified Direct3D 11 device. The internal Direct3D reference
count on that Direct3D 11 device will be decremented when the OpenCL reference count on
the returned OpenCL context drops to zero.
The OpenCL context and corresponding command-queues are dependent on the
existence of the Direct3D 11 device from which the OpenCL context was created. If the
Direct3D 11 device is deleted through the Direct3D 11 API, subsequent use of the OpenCL
context will result in undefined behavior, including but not limited to possible OpenCL
errors, data corruption, and program termination.
Properties of Direct3D 11 objects may be queried
using clGetMemObjectInfo
and clGetImageInfo
with param_nameCL_MEM_D3D11_RESOURCE_KHR and
CL_IMAGE_D3D11_SUBRESOURCE_KHR as described for clGetImageInfo and in the information
below about accessing mapped regions of a memory object.