Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] Performance with SOCL on multiple devices

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] Performance with SOCL on multiple devices


Chronologique Discussions 
  • From: Samuel Thibault <samuel.thibault@inria.fr>
  • To: Malcolm Roberts <malcolm.i.w.roberts@gmail.com>
  • Cc: starpu-devel@lists.gforge.inria.fr, "helluy@math.unistra.fr" <helluy@math.unistra.fr>, Bruno Weber <bruno.weber@axessim.fr>
  • Subject: Re: [Starpu-devel] Performance with SOCL on multiple devices
  • Date: Wed, 6 Jan 2016 17:03:42 +0100
  • 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,

Malcolm Roberts, on Wed 06 Jan 2016 15:10:34 +0100, wrote:
> Thanks for taking a look at this. The relevant branch is socl2 (or devel);
> the master branch doesn't include these optimisations.

Ok.

I also see that the context is created with only one device
(ndevices=1), and the command queue is associated with that specific
device. That is why all computations go to that device. I'm wondering:
was the SOCL OpenCL Extensions chapter not clear about this?

Actually, the code didn't build, so I had to drop the ifndef by hand
too.

With these changes, I do see kernels running on various GPUs. It does
not seem faster, but that is probably due to data transfers. You will
probably want to use FxT to dump traces and read them with Vite.

Samuel
diff --git a/src/clinfo.c b/src/clinfo.c
index ece0c09..8aa17c4 100644
--- a/src/clinfo.c
+++ b/src/clinfo.c
@@ -547,7 +547,7 @@ void InitCLInfo(CLInfo *cli, int platform_num, int
device_num)
set_clinfo_data(cli);
PrintCLInfo(cli);

-#ifndef SOCL
+#if 0 //ndef SOCL
cli->context = clCreateContext(NULL, // no context properties
1, // only one device in the list
&cli->device, // device list
@@ -558,12 +558,13 @@ void InitCLInfo(CLInfo *cli, int platform_num, int
device_num)
cl_context_properties properties[]
= {CL_CONTEXT_PLATFORM,
(cl_context_properties)platforms[platform_num], 0};
- device_id *devicelist = calloc(ndevices, sizeof(cl_device_id));
- ndevices = 1;
+ cl_device_id *devicelist = calloc(ndevices, sizeof(cl_device_id));
+ //ndevices = 1;
+ printf("\n\n***\nUsing %d devices\n***\n\n", ndevices);
for(int i = 0; i < ndevices; ++i) {
devicelist[i] = get_device_id(cli->platform, i);
}
- cli->context = clCreateContext(properties, ndevices, devices,
+ cli->context = clCreateContext(properties, ndevices, devicelist,
NULL, NULL, &status);
#endif

@@ -572,7 +573,7 @@ void InitCLInfo(CLInfo *cli, int platform_num, int
device_num)

cli->commandqueue
= clCreateCommandQueue(cli->context,
- cli->device,
+ NULL,//cli->device,
CL_QUEUE_PROFILING_ENABLE
| CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
,



Archives gérées par MHonArc 2.6.19+.

Haut de le page