OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

Help me!,compile opencl error for mic

hu_m_
Beginner
549 Views

Help me!

compile my opencl code for cpu  is ok.

icpc -o  ArrayAdd -L/opt/intel/opencl-1.2-4.5.0.8/lib64 -L/opt/intel/opencl-1.2-4.5.0.8/libmic -I/opt/intel/opencl-1.2-4.5.0.8/include/  -I/opt/intel/opencl-1.2-sdk-4.4.0.134/include/  -lOpenCL -lrt  ArrayAdd.cpp

 

but  i compile it for mic,some errors:

icpc -mmic -o  ArrayAddmic -L/opt/intel/opencl-1.2-4.5.0.8/lib64 -L/opt/intel/opencl-1.2-4.5.0.8/libmic -I/opt/intel/opencl-1.2-4.5.0.8/include/  -I/opt/intel/opencl-1.2-sdk-4.4.0.134/include/  -lOpenCL -lrt  ArrayAdd.cpp

error:
x86_64-k1om-linux-ld: skipping incompatible /opt/intel/opencl-1.2-4.5.0.8/lib64/libOpenCL.so when searching for -lOpenCL
x86_64-k1om-linux-ld: cannot find -lOpenCL

why???

thanks

 

 

my mic info

 

micinfo
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

 Version
  Flash Version    : 2.1.02.0390
  SMC Firmware Version  : 1.16.5078
  SMC Boot Loader Version  : 1.8.4326
  uOS Version    : 2.6.38.8+mpss3.3
  Device Serial Number   : ADKC24801867

 Board
  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

 

 

 

 

0 Kudos
1 Solution
Yuri_K_Intel
Employee
549 Views
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

View solution in original post

0 Kudos
6 Replies
Jeffrey_M_Intel1
Employee
549 Views

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

0 Kudos
Alexey_B_Intel1
Employee
549 Views

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/compilervars.sh intel64

0 Kudos
Yuri_K_Intel
Employee
549 Views
Hi, 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, Yuri
0 Kudos
hu_m_
Beginner
549 Views

   

   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?

 

0 Kudos
Yuri_K_Intel
Employee
550 Views
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
0 Kudos
hu_m_
Beginner
549 Views

 

   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.

0 Kudos
Reply