Accéder au contenu.
Menu Sympa

starpu-devel - [Starpu-devel] CUDA task and GCC plugin

Objet : Developers list for StarPU

Archives de la liste

[Starpu-devel] CUDA task and GCC plugin


Chronologique Discussions 
  • From: Mehdi AMINI <mehdi.amini@silkan.com>
  • To: starpu-devel@lists.gforge.inria.fr
  • Subject: [Starpu-devel] CUDA task and GCC plugin
  • Date: Mon, 11 Jun 2012 15:17:02 +0200
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

Hello,

I'm trying to play with mixing CUDA task and the GCC plugin, using the StarPU 1.0.1 tar.gz online.

First I wonder if I can declare a task with only a CUDA implementation and no CPU implementation ? Currently I always end up with a linker error.

I also wonder if there is a more verbose mode for StarPU ? Using --enable-debug and --enable-verbose juste give some initialization informations but I would also expect an output each time a task or a data transfer is scheduled.

I also have an issue related to implicit cpu implementations and -O3 gcc flag which seems to be broken. I'm testing a simple task call with a CPU and a CUDA implementation. Using -O3 the CPU task is always executed while without the -O3 flag the CUDA task is correctly executed. Is it a known issue ?
The issue doesn't occur with explicit tasks.

See attached to reproduce the issue (it took me a loooooong time to spot the origin of this issue...):

$ OPT_FLAG=-O2 ./compile-test.sh
[....]
Run with implicit CPU task, compiled and link at the same time
GPU !
Run with implicit CPU task, compiled and link separately
GPU !
Run with explicit CPU task, compiled and link at the same time
GPU !
Run with explicit CPU task, compiled and link separately
GPU !

$ OPT_FLAG=-O3 ./compile-test.sh
[...]
Run with implicit CPU task, compiled and link at the same time
*CPU*
Run with implicit CPU task, compiled and link separately
*CPU*
Run with explicit CPU task, compiled and link at the same time
GPU !
Run with explicit CPU task, compiled and link separately
GPU !


Best,

Mehdi



PS: I use a fedora core 16,

# StarPU configuration
$ ./config.status --config
'--disable-cpu' '--prefix=/home/amini/StarPU/starpu-install/' '--with-cuda-dir=/opt/cuda/' '--with-cuda-lib-dir=/usr/lib64/nvidia' 'LDFLAGS=-L/usr/lib64/nvidia/'

# GCC Version
$ gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.6.3/lto-wrapper
Target: x86_64-redhat-linux
Configuré avec: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Modèle de thread: posix
gcc version 4.6.3 20120306 (Red Hat 4.6.3-2) (GCC)

#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>


#define NX 512
double A[NX];
double B[NX];
double E[NX];


static void launcher(const double A[NX], const double B[NX], double E[NX], 
                  int nx)
  __attribute__ ((task));

#ifndef IMPLICIT
static void launcher_cpu(const double A[NX], const double B[NX], double E[NX], 
                  int nx)
  __attribute__ ((task_implementation ("cpu", launcher)));
static void launcher_cpu(const double A[NX], const double B[NX], double E[NX], 
                  int nx)
#else
static void launcher(const double A[NX], const double B[NX], double E[NX], 
                  int nx)
#endif
{
 printf("CPU\n");
}


extern void launcher_cuda(const double A[NX], const double B[NX], double E[NX], 
                  int nx)
  __attribute__ ((task_implementation ("cuda", launcher)));


int main(int argc, char **argv)
{
   int nx = NX;
   
      
#pragma starpu initialize

#pragma starpu register A
#pragma starpu register B
#pragma starpu register E
   

   launcher((double *)A, (double *)B, (double *)E, nx);
   
#pragma starpu wait

#pragma starpu unregister E

   return 0;
}

Attachment: kernel.cu
Description: application/cu-seeme

Attachment: compile-test.sh
Description: application/shellscript




Archives gérées par MHonArc 2.6.19+.

Haut de le page