Help me!,compile opencl error for mic

Help me!,compile opencl error for mic

Help me!

compile my opencl code for cpu  is ok.

icpc -o  ArrayAdd -L/opt/intel/opencl-1.2- -L/opt/intel/opencl-1.2- -I/opt/intel/opencl-1.2-  -I/opt/intel/opencl-1.2-sdk-  -lOpenCL -lrt  ArrayAdd.cpp


but  i compile it for mic,some errors:

icpc -mmic -o  ArrayAddmic -L/opt/intel/opencl-1.2- -L/opt/intel/opencl-1.2- -I/opt/intel/opencl-1.2-  -I/opt/intel/opencl-1.2-sdk-  -lOpenCL -lrt  ArrayAdd.cpp

x86_64-k1om-linux-ld: skipping incompatible /opt/intel/opencl-1.2- when searching for -lOpenCL
x86_64-k1om-linux-ld: cannot find -lOpenCL





my mic info


MicInfo Utility Log
Copyright 2011-2013 Intel Corporation All Rights Reserved.

Created Sat Aug 30 11:15:17 2014

 System Info
  HOST OS   : Linux
  OS Version  : 2.6.32-358.el6.x86_64
  Driver Version  : 3.3-1
  MPSS Version  : 3.3
  Host Physical Memory : 65909 MB

Device No: 0, Device Name: mic0

  Flash Version    :
  SMC Firmware Version  : 1.16.5078
  SMC Boot Loader Version  : 1.8.4326
  uOS Version    :
  Device Serial Number   : ADKC24801867

  Vendor ID    : 0x8086
  Device ID    : 0x225c
  Subsystem ID    : 0x2500
  Coprocessor Stepping ID  : 3
  PCIe Width    : Insufficient Privileges
  PCIe Speed    : Insufficient Privileges
  PCIe Max payload size  : Insufficient Privileges
  PCIe Max read req size  : Insufficient Privileges
  Coprocessor Model  : 0x01
  Coprocessor Model Ext  : 0x00
  Coprocessor Type  : 0x00
  Coprocessor Family  : 0x0b
  Coprocessor Family Ext  : 0x00
  Coprocessor Stepping   : B1
  Board SKU    : B1PRQ-7110 P/X
  ECC Mode    : Enabled
  SMC HW Revision   : Product 300W Passive CS





7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thank you for reporting this issue.  We're investigating and will reply soon.

I suppose you configured your Intel Compiler to generate 'native MIC' executable and you should configure it for host.

It should be something like: source /opt/intel/composerxe/bin/ intel64


To run your OpenCL code on MIC you DON'T need to compile it differently/specifically for MIC. You should compile it as usual (as in your first example) and you should query available devices with clGetDeviceIDs and select the one with CL_DEVICE_TYPE_ACCELERATOR type inside your host program.

In your second example you use '-mmic' flag which means - compile a native program (just a regular C/C++, not an OpenCL) for running on MIC.



   thanks Jeffrey ,    thanks  Aleksey 

thanks   Yuri,I know your solution.

You think openCL  has a similar method as openMP for MIC,offload  and naive? or OpenCL has not naive method for mic?


Best Reply

I'm not sure I understand the question. And I guess you mean native (not naive).

From OpenCL point of view MIC is an accelerator device (of CL_DEVICE_TYPE_ACCELERATOR type). And any OpenCL program consists of:
- host part (platform/device selection, context/queue creation, program creation/build, data preparation and exchange with device, etc);
- kernel part (OpenCL C program which performs calculations on device).
When clBuildProgram is called on the host it builds the kernel part and creates an executable for specific device. In this case it will create an executable for MIC. This executable will be native (in some sense) for MIC, but there is no such concept in OpenCL and you have to create this executable by means of OpenCL API as I described.



   thanks Yuri  again,I tried according to what you said ,it works. 

   another different question, can we think MIC is a multicore CPU,in this way ,maybe we can run a opencl parallel Program in MIC,just

as  openCL for CPU? because mic has its OS.

Leave a Comment

Please sign in to add a comment. Not a member? Join today