Hi!

On Tue, 9 Jun 2015 16:43:57 +0200, Martin Jambor <mjam...@suse.cz> wrote:
> [hsa libgomp plugin]

> I'm looking forward to any comments and suggestions, meanwhile I have
> committed the patch to the branch as r224284.

Commenting better late than never?  ;-)

Is there a specific reason why you're not using the standard
GOMP_PLUGIN_debug interface guarded by the GOMP_DEBUG environment
variable, and instead essentially re-implement that functionality guarded
by a new HSA_DEBUG environment variable?  (I might be talked into
creating the obvious patch.)

With a HSA_LOG macro used by HSA_DEBUG and HSA_WARNING macros, and the
HSA_DEBUG environment variable, similar code to the following original
code is still present in the current sources:

> --- /dev/null
> +++ b/libgomp/plugin/plugin-hsa.c

> +/* Flag to decide whether print to stderr information about what is going on.
> +   Set in init_debug depending on environment variables.  */
> +
> +static bool debug;
> +
> +/* Initialize debug according to the environment.  */
> +
> +static void
> +init_debug (void)
> +{
> +  if (getenv ("HSA_DEBUG"))
> +    debug = true;
> +  else
> +    debug = false;
> +}

> +  if (debug)
> +    fprintf (stderr, "HSA run-time initialized\n");

> +  if (debug)
> +    fprintf (stderr, "There are %i HSA GPU devices.\n", 
> hsa_context.agent_count);

> +  if (debug)
> +    fprintf (stderr, "HSA agent initialized, queue has id %llu\n",
> +          (long long unsigned) agent->command_q->id);

> +  if (debug)
> +    fprintf (stderr, "Destroying the current HSA program.\n");

> +  if (debug)
> +    fprintf (stderr, "Encountered %d kernels in an image\n", kernel_count);

> [...]


Grüße
 Thomas

Reply via email to