public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp] remove tid/ntid fns from libgcc
@ 2015-07-10 22:16 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2015-07-10 22:16 UTC (permalink / raw)
  To: GCC Patches, Bernd Schmidt

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

I've committed this patch to remove library versions of the num threads and 
thread id.  This has been busted since my reorg of the tid and ntid builtins, 
but wasn't noticed because they're not used anyway.

nathan

[-- Attachment #2: tid.diff --]
[-- Type: text/plain, Size: 2902 bytes --]

2015-07-10  Nathan Sidwell  <nathan@codesourcery.com>

	* config/nvptx/gomp-tids.c: Delete.
	* config/nvptx/t-nvptx: Remove gomp-tids.o

Index: config/nvptx/gomp-tids.c
===================================================================
--- config/nvptx/gomp-tids.c	(revision 225695)
+++ config/nvptx/gomp-tids.c	(working copy)
@@ -1,66 +0,0 @@
-/* Each gang consists of 'worker' threads.  Each worker has 'vector'
-   threads.
-
-   gang, worker and vector mapping functions:
-
-   *tid (0) => vector dimension
-   *tid (1) => worker dimension
-   *ctaid (0) = gang dimension
-
-   FIXME: these functions assume that the gang, worker and vector parameters
-   are 0 or 1.  To generalize these functions, we should use -1 to indicate,
-   say, that a gang clause was used without its optional argument.  In this
-   case, gang should correspond to ctaid(0), i.e., the num_gangs parameter
-   passed to cuLaunchKernel.
-
-   tid = [0, ntid-1]
-   ntid = [1...threads_per_dimension]
-*/
-
-int __attribute__ ((used))
-GOACC_get_num_threads (int gang, int worker, int vector)
-{
-  int vsize = vector * __builtin_GOACC_ntid (0);
-  int wsize = worker * __builtin_GOACC_ntid (1);
-  int gsize = gang * __builtin_GOACC_nctaid (0);
-  int size = 1;
-
-  if (vector)
-    size *= __builtin_GOACC_ntid (0);
-
-  if (worker)
-    size *= __builtin_GOACC_ntid (1);
-
-  if (gang)
-    size *= __builtin_GOACC_nctaid (0);
-
-  return size;
-}
-
-int __attribute__ ((used))
-GOACC_get_thread_num (int gang, int worker, int vector)
-{
-  int tid = 0;
-  int ws = __builtin_GOACC_ntid (1);
-  int vs = __builtin_GOACC_ntid (0);
-  int gid = __builtin_GOACC_ctaid (0);
-  int wid = __builtin_GOACC_tid (1);
-  int vid = __builtin_GOACC_tid (0);
-
-  if (gang && worker && vector)
-    tid = gid * ws * vs + vs * wid + vid;
-  else if (gang && !worker && vector)
-    tid = vs * gid + vid;
-  else if (gang && worker && !vector)
-    tid = ws * gid + wid;
-  else if (!gang && worker && vector)
-    tid = vs * wid + vid;
-  else if (!gang && !worker && vector)
-    tid = vid;
-  else if (!gang && worker && !vector)
-    tid = wid;
-  else if (gang && !worker && !vector)
-    tid = gid;
-
-  return tid;
-}
Index: config/nvptx/t-nvptx
===================================================================
--- config/nvptx/t-nvptx	(revision 225695)
+++ config/nvptx/t-nvptx	(working copy)
@@ -16,12 +16,10 @@ INHIBIT_LIBC_CFLAGS = -Dinhibit_libc
 
 gomp-acc_on_device.o: $(srcdir)/config/nvptx/gomp-acc_on_device.c
 	$(gcc_compile) -c -fno-builtin-acc_on_device $<
-gomp-tids.o: $(srcdir)/config/nvptx/gomp-tids.c
-	$(gcc_compile) -c -fopenacc -O $<
 gomp-atomic.o: $(srcdir)/config/nvptx/gomp-atomic.asm
 	cp $< $@
 
-OBJS_libgomp= gomp-acc_on_device.o gomp-tids.o gomp-atomic.o
+OBJS_libgomp= gomp-acc_on_device.o gomp-atomic.o
 libgomp.a: $(OBJS_libgomp)
 	$(AR_CREATE_FOR_TARGET) $@ $(OBJS_libgomp)
 libgomp.spec:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-10 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-10 22:16 [gomp] remove tid/ntid fns from libgcc Nathan Sidwell

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).