On 17 Mar 16:00, Thomas Schwinge wrote: > > GOMP_4.0 { > > global: > > + GOMP_offload_register; > > GOMP_barrier_cancel; > > GOMP_cancel; > > GOMP_cancellation_point; > > Now that the GOMP_4.0 symbol version is being used in GCC trunk, and will > be in the GCC 4.9 release, can we still add new symbols to it here? > (Jakub?)
I moved it to GOMP_4.0.1. > > + /* This is the TYPE of device. */ > > + int type; > > Use enum target_type instead of int? Done. > > + offload_images = realloc (offload_images, > > + (num_offload_images + 1) > > + * sizeof (struct offload_image_descr)); > > + > > + if (offload_images == NULL) > > + return; > > Fail silently, or use gomp_realloc to fail loudly? Replaced with gomp_realloc. > > if (dir) > > closedir (dir); > > + free (offload_images); > > I suggest to set offload_images = NULL, for clarity. Done. > OK to commit, thanks! Committed as r208657. > Would it make sense to have device_run return a value to make it able to > indicate to libgomp that the function cannot be run on the device (for > whatever reason), and libgomp should use host-fallback execution? > (Probably that needs more thought and discussion, OK to defer.) Consider the following example (using OpenMP, I don't know OpenACC :) int foo () { int x = 0; /* offload_fn1 */ #pragma omp target map(to: x) { x += 5; } /* Some code on host without updating 'x' from target. */ /* offload_fn2 */ #pragma omp target map(from: x) { x += 10; } return x; } If both offload_fn1 and offload_fn2 are executed on host, everything is fine and x = 15. The same goes to the case when both offload_fn1 and offload_fn2 are executed on target. But if offload_fn1 is executed on target and offload_fn2 is executed on host, then 'x' will have incorrect value (10). Therefore, I proposed to check for target device availability only during initialization of the plugin. And to make a decision at this point, will libgomp run all functions on host or on target. Probably libgomp should return an error if something was executed on device, but then it becomes unavailable. -- Ilya