MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / clblasCreateMatrixFromHost

Function clblasCreateMatrixFromHost

src/library/blas/matrix.c:165–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165cl_mem clblasCreateMatrixFromHost(
166 cl_context context,
167 clblasOrder order,
168 size_t rows,
169 size_t columns,
170 size_t elemsize,
171 size_t ld,
172 void * host,
173 size_t off_host,
174 size_t ld_host,
175 cl_command_queue command_queue,
176 cl_uint numEventsInWaitList,
177 const cl_event *eventWaitList,
178 cl_int * err)
179{
180 size_t fullsize;
181 cl_mem out;
182 size_t i;
183
184 out = clblasCreateMatrixWithLd(
185 context,
186 order,
187 rows,
188 columns,
189 elemsize,
190 ld,
191 &fullsize,
192 err);
193
194 if( ! *err )
195 {
196 printf("ok\n");
197 // TODO use ReadMatrix instead ?
198 if( order == clblasRowMajor )
199 {
200 for( i = 0; i < rows; i++ )
201 {
202 const size_t host_orig[3] = {off_host, off_host, 0};
203 const size_t buff_orig[3] = {0, 0, 0};
204 const size_t region[3] = {columns*elemsize, rows, 1};
205 *err = clEnqueueWriteBufferRect(
206 command_queue,
207 out,
208 CL_TRUE,
209 buff_orig,
210 host_orig,
211 region,
212 columns * elemsize,
213 0,
214 ld_host * elemsize,
215 0,
216 host,
217 numEventsInWaitList,
218 eventWaitList,
219 NULL);
220 }
221 }
222 }

Callers

nothing calls this directly

Calls 1

clblasCreateMatrixWithLdFunction · 0.85

Tested by

no test coverage detected