1 ! Copyright (C) 2010 Erik Charlebois.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax kernel quotations strings opencl.private
4 math byte-arrays alien ;
7 HELP: sampler>cl-addressing-mode
9 { "sampler" cl-sampler }
10 { "addressing-mode" cl-addressing-mode }
12 { $description "Returns the addressing mode of the given sampler." } ;
15 { $description "Insert a synchronization barrier into the current command queue." } ;
17 HELP: cl-barrier-events
19 { "event/events" "a single event or sequence of events" }
21 { $description "Insert a synchronization barrier for the specified events into the current command queue." } ;
24 { $var-description "Tuple wrapper which will release the memory object handle when disposed." } ;
27 { $var-description "A buffer and offset pair for specifying a starting point for a copy." } ;
30 { $var-description "A buffer, offset and size triplet for specifying copy ranges." } ;
33 { $var-description "Tuple wrapper which will release the context handle when disposed." } ;
35 HELP: cl-current-context
36 { $var-description "Symbol for the current cl-context tuple." } ;
38 HELP: cl-current-device
39 { $var-description "Symbol for the current cl-device tuple." } ;
41 HELP: cl-current-queue
42 { $var-description "Symbol for the current cl-queue tuple." } ;
45 { $var-description "Tuple wrapper which will release the device handle when disposed." } ;
48 { $var-description "Tuple wrapper which will release the event handle when disposed." } ;
53 { "execution-status" cl-execution-status }
55 { $description "Returns the current execution status of the operation represented by the event." } ;
60 { "command-type" cl-execution-status }
62 { $description "Returns the type of operation that created the event." } ;
64 HELP: sampler>cl-filter-mode
66 { "sampler" cl-sampler }
67 { "filter-mode" cl-filter-mode }
69 { $description "Returns the filter mode of the sampler object." } ;
72 { $description "Flush the current command queue and wait till all operations are completed." } ;
75 { $description "Flush the current command queue to kick off pending operations." } ;
78 { $var-description "Tuple wrapper which will release the kernel handle when disposed." } ;
82 { "kernel" cl-kernel }
85 { $description "Returns the number of inputs that this kernel function accepts." } ;
87 HELP: cl-kernel-local-size
89 { "kernel" cl-kernel }
92 { $description "Returns the maximum size of a local work group for this kernel." } ;
96 { "kernel" cl-kernel }
99 { $description "Returns the name of the kernel function." } ;
106 { $description "Inserts a marker into the current command queue." } ;
108 HELP: cl-normalized-coords?
110 { "sampler" cl-sampler }
113 { $description "Returns whether the sampler uses normalized coords or not." } ;
115 HELP: cl-out-of-order-execution?
117 { "command-queue" cl-queue }
120 { $description "Returns whether the given command queue allows out of order execution or not." } ;
123 { $var-description "Tuple summarizing the capabilities and devices of an OpenCL platform." } ;
128 { "platforms" "sequence of cl-platform" }
130 { $description "Returns the platforms available for OpenCL computation on this hardware." } ;
132 HELP: cl-profile-counters
135 { "queued" integer } { "submitted" integer } { "started" integer } { "finished" integer }
137 { $description "Returns the profiling counters for the operation represented by event." } ;
141 { "command-queue" cl-queue }
144 { $description "Returns true if the command queue allows profiling." } ;
147 { $var-description "Tuple wrapper which will release the program handle when disposed." } ;
150 { $var-description "Tuple wrapper which will release the command queue handle when disposed." } ;
154 { "buffer-range" cl-buffer-range }
155 { "byte-array" byte-array }
157 { $description "Synchronously read a byte-array from the specified buffer location." } ;
160 { $var-description "Tuple wrapper which will release the sampler handle when disposed." } ;
162 HELP: cl-queue-copy-buffer
164 { "src-buffer-ptr" cl-buffer-ptr } { "dst-buffer-ptr" cl-buffer-ptr } { "size" integer } { "dependent-events" "sequence of events" }
167 { $description "Queue a copy operation from " { $snippet "src-buffer-ptr" } " to " { $snippet "dst-buffer-ptr" } ". Dependent events can be passed to order the operation relative to other operations." } ;
169 HELP: cl-queue-kernel
171 { "kernel" cl-kernel } { "args" "sequence of cl-buffer or byte-array" } { "sizes" "sequence of integers" } { "dependent-events" "sequence of events" }
174 { $description "Queue a kernel for execution with the given arguments. The " { $snippet "sizes" } " argument specifies input array sizes for each dimension. Dependent events can be passed to order the operation relative to other operations." } ;
176 HELP: cl-queue-read-buffer
178 { "buffer-range" cl-buffer-range } { "alien" alien } { "dependent-events" "a sequence of events" }
181 { $description "Queue a read operation from " { $snippet "buffer-range" } " to " { $snippet "alien" } ". Dependent events can be passed to order the operation relative to other operations." } ;
183 HELP: cl-queue-write-buffer
185 { "buffer-range" cl-buffer-range } { "alien" alien } { "dependent-events" "a sequence of events" }
188 { $description "Queue a write operation from " { $snippet "alien" } " to " { $snippet "buffer-range" } ". Dependent events can be passed to order the operation relative to other operations." } ;
192 { "event/events" "a single event or sequence of events" }
194 { $description "Synchronously wait for the events to complete." } ;
196 HELP: cl-write-buffer
198 { "buffer-range" cl-buffer-range } { "byte-array" byte-array }
200 { $description "Synchronously write a byte-array to the specified buffer location." } ;
204 { "options" string } { "strings" "sequence of source code strings" }
205 { "program" "compiled cl-program" }
207 { $description "Compile the given source code and return a program object. A " { $link cl-error } " is thrown in the event of a compile error." } ;
211 { "context/f" { $maybe cl-context } } { "device/f" { $maybe cl-device } } { "queue/f" { $maybe cl-queue } } { "quot" quotation }
213 { $description "Run the specified quotation with the given context, device and command queue. False arguments are not bound." } ;
215 ARTICLE: "opencl" "OpenCL"
216 "The " { $vocab-link "opencl" } " vocabulary provides high-level words for using OpenCL."
229 cl-queue-write-buffer
231 "Programs and Kernels:"
237 "Running and Waiting for Completion:"