public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Stubbs <ams@codesourcery.com>
To: "Harwath, Frederik" <frederik@codesourcery.com>,
	GCC Patches	<gcc-patches@gcc.gnu.org>,
	Thomas Schwinge <thomas@codesourcery.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] Add OpenACC acc_get_property support for AMD GCN
Date: Wed, 29 Jan 2020 11:07:00 -0000	[thread overview]
Message-ID: <c8badb52-eb3a-5082-6140-04786ecb5195@codesourcery.com> (raw)
In-Reply-To: <eba14f94-16fb-8134-e0f4-6123fc4d13e4@codesourcery.com>

On 29/01/2020 09:52, Harwath, Frederik wrote:
> @@ -1513,6 +1518,23 @@ init_hsa_context (void)
>  	GOMP_PLUGIN_error ("Failed to list all HSA runtime agents");
>      }
>  
> +  uint16_t minor, major;
> +  status = hsa_fns.hsa_system_get_info_fn (HSA_SYSTEM_INFO_VERSION_MINOR, &minor);
> +  if (status != HSA_STATUS_SUCCESS)
> +    GOMP_PLUGIN_error ("Failed to obtain HSA runtime minor version");
> +  status = hsa_fns.hsa_system_get_info_fn (HSA_SYSTEM_INFO_VERSION_MAJOR, &major);
> +  if (status != HSA_STATUS_SUCCESS)
> +    GOMP_PLUGIN_error ("Failed to obtain HSA runtime major version");
> +
> +  size_t len = sizeof hsa_context.driver_version_s;
> +  int printed = snprintf (hsa_context.driver_version_s, len,
> +			  "HSA Runtime %hu.%hu", (unsigned short int)major,
> +			  (unsigned short int)minor);
> +  if (printed >= len)
> +    GCN_WARNING ("HSA runtime version string was truncated."
> +		 "Version %hu.%hu is too long.", (unsigned short int)major,
> +		 (unsigned short int)minor);
> +
>    hsa_context.initialized = true;
>    return true;
>  }

Please wrap the long lines (I should have spotted this before, sorry).

The buffer checking is good, thank you.

> +void expect_device_string_properties (acc_device_t dev_type, int dev_num,
> +				      const char* expected_vendor,
> +				      const char* expected_name,
> +				      const char* expected_driver)
> +

GNU style would be ...

void
expect_device_string_properties (acc_device_t dev_type, int dev_num,
                                  const char* expected_vendor,
                                  const char* expected_name,
                                  const char* expected_driver)

That is, with the return type on the previous line, and the function 
name starting in the first column. The prototype should have the type on 
the same line, however. (I think the point is that you should be able to 
find a function definition with "grep '^name' *".)

Otherwise you have the parameter list correct now.

Patch 1 is OK with the formatting fixed.
Patch 2 is OK.

Thanks very much,

Andrew

  reply	other threads:[~2020-01-29 10:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 16:51 [PATCH, og8] Add OpenACC 2.6 `acc_get_property' support Maciej W. Rozycki
2018-12-05 10:12 ` Chung-Lin Tang
2018-12-05 18:17   ` Maciej W. Rozycki
2018-12-10  9:06     ` Chung-Lin Tang
2018-12-20 14:25       ` Maciej W. Rozycki
2019-01-08 17:42 ` Thomas Schwinge
2019-10-07 18:41 ` Thomas Schwinge
2019-11-05 15:09   ` Harwath, Frederik
2019-11-14 15:41   ` [PATCH] " Frederik Harwath
2019-12-16 23:06     ` Thomas Schwinge
2019-12-17  9:39       ` Martin Jambor
2019-12-17  9:47       ` Andrew Stubbs
2019-12-20 17:11       ` Harwath, Frederik
2019-12-21 23:01         ` Thomas Schwinge
2019-12-22 22:20           ` Harwath, Frederik
2020-01-10 23:44           ` Thomas Schwinge
2020-01-30 16:14             ` Make OpenACC 'acc_get_property' with 'acc_device_current' work (was: [PATCH] Add OpenACC 2.6 `acc_get_property' support) Thomas Schwinge
2020-02-03 12:16               ` Harwath, Frederik
2020-02-03 14:41               ` Make OpenACC 'acc_get_property' with 'acc_device_current' work Tobias Burnus
2020-01-16 16:03         ` [PATCH] Add OpenACC 2.6 `acc_get_property' support Thomas Schwinge
2020-01-20 14:20           ` Harwath, Frederik
2020-01-23 15:08             ` Thomas Schwinge
2020-01-24  9:36               ` Harwath, Frederik
2020-01-27 14:57         ` Fortran 'acc_get_property' return type (was: [PATCH] Add OpenACC 2.6 `acc_get_property' support) Thomas Schwinge
2020-01-28 15:31         ` [PATCH] Add OpenACC acc_get_property support for AMD GCN Harwath, Frederik
2020-01-28 16:14           ` Andrew Stubbs
2020-01-29 10:10             ` Harwath, Frederik
2020-01-29 11:07               ` Andrew Stubbs [this message]
2020-01-29 11:47                 ` Harwath, Frederik
2020-01-29 17:58               ` Thomas Schwinge
2020-01-29 18:12                 ` Andrew Stubbs
2020-01-30  8:04                 ` Harwath, Frederik
2020-01-30 16:28               ` Thomas Schwinge
2020-01-30 16:54                 ` Andrew Stubbs
2020-01-31  9:32                   ` Thomas Schwinge
2020-01-31 12:32                 ` Harwath, Frederik
2020-01-31 14:49                   ` Thomas Schwinge
2020-04-29  9:19       ` [PATCH] Add OpenACC 2.6 `acc_get_property' support Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8badb52-eb3a-5082-6140-04786ecb5195@codesourcery.com \
    --to=ams@codesourcery.com \
    --cc=frederik@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).