# OpenCL devices on 2012 Macbook pro

I am writing an openCL program in mid-2012 13 "macbook pro with the following features:

Processor: 2.9 GHz Intel Core i7

Graphics: Intel HD Graphics 4000

In my program, I do the following to check how many devices I have:

// get first platform
cl_platform_id platform;
err = clGetPlatformIDs(1, &platform, NULL);

// get device count
cl_uint gpuCount;
err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, NULL, &gpuCount);

cl_uint cpuCount;
err |= clGetDeviceIDs(platform, CL_DEVICE_TYPE_CPU, 0, NULL, &cpuCount);

std::cout<<"NUM CPUS: "<<cpuCount<<" NUM GPUS: "<<gpuCount<<std::endl;

After execution, my program states that I have only one CPU and zero GPUs .

How can it be? OpenCL not compatible with Intel HD Graphics 4000? And I thought my computer has a dual core processor. So there should not be 2 processors and 1 GPU?

Or am I just getting the data wrong?

EDIT. . Mavericks ( Mountain Lion), openCL .

+4
2

( ), , , , . , .

CPU Graphics, :

system_profiler | awk '/^Hardware/ || /^Graphics/{p=1;print;next} /^[A-Za-z]/{p=0} p'

Graphics/Displays:

    AMD Radeon HD 6970M:

      Chipset Model: AMD Radeon HD 6970M
      Type: GPU
      Bus: PCIe
      PCIe Lane Width: x16
      VRAM (Total): 1024 MB
      Vendor: ATI (0x1002)
      Device ID: 0x6720
      Revision ID: 0x0000
      ROM Revision: 113-C2960H-203
      EFI Driver Version: 01.00.560
      Displays:
        iMac:
          Display Type: LCD
          Resolution: 2560 x 1440
          Pixel Depth: 32-Bit Color (ARGB8888)
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Built-In: Yes

Hardware:

    Hardware Overview:

      Model Name: iMac
      Model Identifier: iMac12,2
      Processor Name: Intel Core i7
      Processor Speed: 3.4 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 256 KB
      L3 Cache: 8 MB
      Memory: 16 GB
      Boot ROM Version: IM121.0047.B1F
      SMC Version (system): 1.72f2
      Serial Number (system): DGKH90PWDHJW
      Hardware UUID: 1025AC04-9F8E-5342-9EF4-XXXXXXXXXXXXX

CPU:

sysctl -a | grep "brand_string"
machdep.cpu.brand_string: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz

OpenCL:

system_profiler | grep -A 11 OpenCL:
OpenCL:

  Version: 2.3.59
  Obtained from: Apple
  Last Modified: 19/09/2014 10:28
  Kind: Intel
  64-Bit (Intel): Yes
  Signed by: Software Signing, Apple Code Signing Certification Authority, Apple Root CA
  Get Info String: 2.3.59, Copyright 2008-2013 Apple Inc.
  Location: /System/Library/Frameworks/OpenCL.framework
  Private: No

P.S. , ( ) SO, , .

+3

, . , CU :

cl_device_id device;
cl_uint max_compute_units;
cl_int ret = clGetDeviceInfo(device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(cl_uint), &max_compute_units, NULL);
printf("Number of computing units: %u\n", max_compute_units);
+3

All Articles