MCPcopy Create free account
hub / github.com/UCLA-VAST/AutoSA / copy_array_from_device

Function copy_array_from_device

cuda.c:163–179  ·  view source on GitHub ↗

Print code to "p" for copying "array" back from the device to the host * in its entirety. The bounds on the extent of "array" have * been precomputed in extract_array_info and are used in * gpu_array_info_print_size. */

Source from the content-addressed store, hash-verified

161 * gpu_array_info_print_size.
162 */
163static __isl_give isl_printer *copy_array_from_device(
164 __isl_take isl_printer *p, struct gpu_array_info *array)
165{
166 p = isl_printer_start_line(p);
167 p = isl_printer_print_str(p, "cudaCheckReturn(cudaMemcpy(");
168 if (gpu_array_is_scalar(array))
169 p = isl_printer_print_str(p, "&");
170 p = isl_printer_print_str(p, array->name);
171 p = isl_printer_print_str(p, ", dev_");
172 p = isl_printer_print_str(p, array->name);
173 p = isl_printer_print_str(p, ", ");
174 p = gpu_array_info_print_size(p, array);
175 p = isl_printer_print_str(p, ", cudaMemcpyDeviceToHost));");
176 p = isl_printer_end_line(p);
177
178 return p;
179}
180
181static void print_reverse_list(FILE *out, int len, int *list)
182{

Callers 1

print_device_nodeFunction · 0.85

Calls 2

gpu_array_is_scalarFunction · 0.85

Tested by

no test coverage detected