1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
<!-- table 5.3 -->
<informaltable frame="all">
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<colspec colname="col1" colnum="1" />
<thead>
<row>
<entry>cl_mem_flags</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>CL_MEM_READ_WRITE</constant></entry>
<entry>
This flag specifies that the memory object will be read and written by a kernel. This
is the default.
</entry>
</row>
<row>
<entry><constant>CL_MEM_WRITE_ONLY</constant></entry>
<entry>
<para>
This flags specifies that the memory object will be written but not read by
a kernel.
</para>
<para>
Reading from a buffer or image object created with
<constant>CL_MEM_WRITE_ONLY</constant> inside a kernel is undefined.
</para>
<para>
<constant>CL_MEM_READ_WRITE</constant> and <constant>CL_MEM_WRITE_ONLY</constant>
are mutually exclusive.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_READ_ONLY</constant></entry>
<entry>
<para>
This flag specifies that the memory object is a read-only memory object when
used inside a kernel.
</para>
<para>
Writing to a buffer or image object created with
<constant>CL_MEM_READ_ONLY</constant> inside a kernel is undefined.
</para>
<para>
<constant>CL_MEM_READ_WRITE</constant> or <constant>CL_MEM_WRITE_ONLY</constant>
and <constant>CL_MEM_READ_ONLY</constant> are mutually exclusive.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_USE_HOST_PTR</constant></entry>
<entry>
<para>
This flag is valid only if <varname>host_ptr</varname> is not NULL. If
specified, it indicates that the application wants the OpenCL implementation
to use memory referenced by <varname>host_ptr</varname> as the storage bits
for the memory object.
</para>
<para>
OpenCL implementations are allowed to cache the buffer contents pointed to by
<varname>host_ptr</varname> in device memory. This cached copy can be used when
kernels are executed on a device.
</para>
<para>
The result of OpenCL commands that operate on multiple buffer objects created with
the same <varname>host_ptr</varname> or overlapping host regions is considered
to be undefined.
</para>
<para>
Refer to the <citerefentry href="dataTypes"> <refentrytitle>description
of the alignment rules</refentrytitle> </citerefentry> for
<varname>host_ptr</varname> for memory objects (buffer and images) created
using <constant>CL_MEM_USE_HOST_PTR</constant>.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_ALLOC_HOST_PTR</constant></entry>
<entry>
<para>
This flag specifies that the application wants the OpenCL implementation to
allocate memory from host accessible memory.
</para>
<para>
<constant>CL_MEM_ALLOC_HOST_PTR</constant> and
<constant>CL_MEM_USE_HOST_PTR</constant> are mutually exclusive.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_COPY_HOST_PTR</constant></entry>
<entry>
<para>
This flag is valid only if <varname>host_ptr</varname> is not NULL. If specified,
it indicates that the application wants the OpenCL implementation to allocate
memory for the memory object and copy the data from memory referenced by
<varname>host_ptr</varname>.
</para>
<para>
<constant>CL_MEM_COPY_HOST_PTR</constant> and
<constant>CL_MEM_USE_HOST_PTR</constant> are mutually exclusive.
</para>
<para>
<constant>CL_MEM_COPY_HOST_PTR</constant> can be used with
<constant>CL_MEM_ALLOC_HOST_PTR</constant> to initialize the contents of the
<type>cl_mem</type> object allocated using host-accessible (e.g. PCIe) memory.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_HOST_WRITE_ONLY</constant></entry>
<entry>
<para>
This flag specifies that the host will only write to the memory object (using
OpenCL APIs that enqueue a write or a map for write). This can be used to optimize
write access from the host (e.g. enable write combined allocations for memory
objects for devices that communicate with the host over a system bus such as PCIe).
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_HOST_READ_ONLY</constant></entry>
<entry>
<para>
This flag specifies that the host will only read the memory object (using OpenCL
APIs that enqueue a read or a map for read).
</para>
<para>
<constant>CL_MEM_HOST_WRITE_ONLY</constant> and
<constant>CL_MEM_HOST_READ_ONLY</constant> are mutually exclusive.
</para>
</entry>
</row>
<row>
<entry><constant>CL_MEM_HOST_NO_ACCESS</constant></entry>
<entry>
<para>
This flag specifies that the host will not read or write the memory object.
</para>
<para>
<constant>CL_MEM_HOST_WRITE_ONLY</constant> or
<constant>CL_MEM_HOST_READ_ONLY</constant> and
<constant>CL_MEM_HOST_NO_ACCESS</constant> are mutually exclusive.
</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<!-- 21-Oct-2011 -->
|