public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: Thomas Schwinge <thomas@codesourcery.com>,
	       Cesar Philippidis <cesar@codesourcery.com>,
	       Chung-Lin Tang <chunglin_tang@mentor.com>,
	Jeff Law <law@redhat.com>,
	       gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Allow building GCC with PTX offloading even without CUDA being installed (gcc and nvptx-tools patches)
Date: Thu, 19 Jan 2017 15:55:00 -0000	[thread overview]
Message-ID: <20170119155437.GP1867@tucnak> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1701191800380.28155@monopod.intra.ispras.ru>

On Thu, Jan 19, 2017 at 06:09:35PM +0300, Alexander Monakov wrote:
> > -#ifdef __LP64__
> > +#if defined(__LP64__) || defined(_WIN64)
> > 
> > (is that the right define for 64-bit MingW, right?).
> 
> Yes, _WIN64; libsanitizer has a similar test.  Alternatively, I guess,
> 
>   #if __SIZEOF_POINTER__ == 8
> 
> > Otherwise, I think using uintptr_t is a problem, because we'd need to
> > #include <stdint.h> (the header only includes <stdlib.h>).
> 
> Note that plugin-nvptx.c already includes <stdint.h>.  But, anyway, I agree that
> there's value in defining the exact type via the #if.

I've committed then.

2017-01-19  Jakub Jelinek  <jakub@redhat.com>

	* plugin/cuda/cuda.h (CUdeviceptr): Typedef to unsigned long long even
	for _WIN64.

--- libgomp/plugin/cuda/cuda.h	(revision 244570)
+++ libgomp/plugin/cuda/cuda.h	(working copy)
@@ -35,7 +35,7 @@ libcuda.so.1 are not available.  */
 
 typedef void *CUcontext;
 typedef int CUdevice;
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
 typedef unsigned long long CUdeviceptr;
 #else
 typedef unsigned CUdeviceptr;


	Jakub

  reply	other threads:[~2017-01-19 15:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13 18:11 Jakub Jelinek
2017-01-13 18:19 ` Joseph Myers
2017-01-13 18:28   ` Jakub Jelinek
2017-01-16 19:23     ` Jeff Law
2017-01-18 20:27 ` Alexander Monakov
2017-01-18 22:18   ` Jakub Jelinek
2017-01-19 15:10     ` Alexander Monakov
2017-01-19 15:55       ` Jakub Jelinek [this message]
2017-01-21 15:28 ` Thomas Schwinge
2017-01-21 19:13   ` Jakub Jelinek
2017-05-03  9:08   ` Jakub Jelinek
2017-05-04 17:26     ` Thomas Schwinge
2022-04-06 12:39 ` Move 'libgomp/plugin/cuda/cuda.h' to 'include/cuda/cuda.h' (was: [PATCH] Allow building GCC with PTX offloading even without CUDA being installed (gcc and nvptx-tools patches)) Thomas Schwinge
2022-04-06 12:41   ` Jakub Jelinek
2022-04-07 22:27 ` libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA' " Thomas Schwinge
2022-04-08  7:35   ` Tom de Vries
2022-04-28 13:45     ` libgomp nvptx plugin: Split 'PLUGIN_NVPTX_DYNAMIC' into 'PLUGIN_NVPTX_INCLUDE_SYSTEM_CUDA_H' and 'PLUGIN_NVPTX_LINK_LIBCUDA' Thomas Schwinge
2022-05-05 19:18       ` [PING] " Thomas Schwinge
2022-05-12 11:57         ` [PING^2] " Thomas Schwinge
2022-05-12 12:09       ` Tom de Vries
2022-05-18 10:08 ` 'include/cuda/cuda.h': For C++, wrap in 'extern "C"' (was: [PATCH] Allow building GCC with PTX offloading even without CUDA being installed (gcc and nvptx-tools patches)) Thomas Schwinge
2022-05-18 10:11 ` 'include/cuda/cuda.h': Add parts necessary for nvptx-tools 'nvptx-run' " Thomas Schwinge
2024-03-07 11:53 ` GCN, nvptx: Fatal error for missing symbols in 'libhsa-runtime64.so.1', 'libcuda.so.1' " Thomas Schwinge
2024-03-07 11:55   ` Jakub Jelinek

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=20170119155437.GP1867@tucnak \
    --to=jakub@redhat.com \
    --cc=amonakov@ispras.ru \
    --cc=cesar@codesourcery.com \
    --cc=chunglin_tang@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@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).