Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] Cannot use OpenCL on CPU

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] Cannot use OpenCL on CPU


Chronologique Discussions 
  • From: Samuel Thibault <samuel.thibault@inria.fr>
  • To: Berenger Bramas <berenger.bramas@inria.fr>
  • Cc: starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] Cannot use OpenCL on CPU
  • Date: Thu, 14 Jan 2016 14:32:32 +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,

Berenger Bramas, on Thu 14 Jan 2016 14:16:16 +0100, wrote:
> I am using OpenCL on CPU (mainly for development purpose)
> StarPU was able to detect my CPU (Intel® Core™ i7-4610M CPU @ 3.00GHz × 4)
> as
> an OpenCL device until lately.

I don't have such issue, I do get a CPU OpenCL worker with your
program. Did you check that the underlying opencl platforms are
found? (I usually use the attached program). Which version of StarPU are
you trying with?

Samuel
#include <CL/cl.h>
#include <stdio.h>
#include <assert.h>

int main(void) {
cl_device_id did[16];
cl_int err;
cl_platform_id pid, pids[16];
cl_uint nbplat, nb;
cl_uint uint;
char buf[128];
size_t size;
int i, j;

err = clGetPlatformIDs(sizeof(pids)/sizeof(pids[0]), pids, &nbplat);
assert(err == CL_SUCCESS);
printf("%u platforms\n", nbplat);
for (j = 0; j < nbplat; j++) {
pid = pids[j];
printf("platform %d id %p\n", j, pid);
err = clGetPlatformInfo(pid, CL_PLATFORM_VERSION,
sizeof(buf)-1, buf, &size);
assert(err == CL_SUCCESS);
buf[size] = 0;
printf("platform version %s\n", buf);

err = clGetDeviceIDs(pid, CL_DEVICE_TYPE_ALL,
sizeof(did)/sizeof(did[0]), did, &nb);
assert(err == CL_SUCCESS);
printf("%d devices\n", nb);
for (i = 0; i < nb; i++) {
err = clGetDeviceInfo(did[i], CL_DEVICE_VERSION,
sizeof(buf)-1, buf, &size);
buf[size] = 0;
err = clGetDeviceInfo(did[i],
CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(uint), &uint, &size);
err = clGetDeviceInfo(did[i],
CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(uint), &uint, &size);
printf(" device %d version %s align
%u\n", i, buf, uint);
}
}

return 0;
}



Archives gérées par MHonArc 2.6.19+.

Haut de le page