OpenCL build error: fixing a bug of lib/gpu/geryon/ocl_device.h

Dear all

I'm building lammps with OpenCL (except CUDA) on Mac OS X 10.7.3.
I employ xcode 4.3 as SDK.
I'm working on lammps-5Mar12.

I got an error when building GPU library at lib/gpu:
mpic++ -O3 -DMPI_GERYON -DUCL_NO_EXIT -D_SINGLE_SINGLE -DUSE_OPENCL -o lal_device.o -c lal_device.cpp -I./
lal_device.cpp: In member function ‘int LAMMPS_AL::Device<numtyp, acctyp>::init_device(ompi_communicator_t*, ompi_communicator_t*, int, int, int, double, int, int)’:
lal_device.cpp:136: error: ‘class ucl_opencl::UCL_Device’ has no member named ‘set_command_queue’
make: *** [lal_device.o] Error 1
make: *** Waiting for unfinished jobs….

Then I inserted the following lines into the line 225 of lib/gpu/geryon/ocl_device.h:
// ------ 04 march 2012
  // Set the default command queue (by default this is the null stream)
  /** \param i index of the command queue (as added by push_command_queue())
      If i is 0, the default command queue is set to the null stream **/
  inline void set_command_queue(const int i) {
    if (i==0) _cq[0]=0;
    else _cq[0]=_cq[i];
// ------ 04 march 2012

These lines were copied from the lines (from 120 to 126) of lib/gpu/geryon/nvd_device.h.

This modify seemed to make the error fixed.

I attach ocl_device.h applied with this modify.
Please check this fix.

Fumihiro CHIBA (chibaf)

ocl_device.h (17.3 KB)

Maybe Mike wants to comment on this issue.


I must have messed up when I synced LAMMPS with the new Geryon version.

The attached file should be replaced in lib/gpu/geryon/.

I think I saw another diff besides the one mentioned below. Thanks for alerting us to the issue and sorry it gave you a problem.

- Mike

ocl_device.h (17.3 KB)

Thank you, Mike. I applied your file.
I think it works well.

- chibaf