[gomp] remove tid/ntid fns from libgcc

Nathan Sidwell nathan@acm.org
Fri Jul 10 22:16:00 GMT 2015


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
-------------- next part --------------
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:


More information about the Gcc-patches mailing list