Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos #2012年Macbook pro上的OpenCL设备数量_Macos_Opencl_Gpu_Cpu_Intel - Fatal编程技术网

Macos #2012年Macbook pro上的OpenCL设备数量

Macos #2012年Macbook pro上的OpenCL设备数量,macos,opencl,gpu,cpu,intel,Macos,Opencl,Gpu,Cpu,Intel,我正在2012年年中13英寸macbook pro上编写一个openCL程序,规格如下: 处理器:2.9 GHz Intel Core i7 图形:英特尔高清图形4000 在我的程序中,我执行以下操作以检查我可以访问多少设备: // get first platform cl_platform_id platform; err = clGetPlatformIDs(1, &platform, NULL); // get device count cl_uint gpuCount; er

我正在2012年年中13英寸macbook pro上编写一个openCL程序,规格如下:

处理器:2.9 GHz Intel Core i7

图形:英特尔高清图形4000

在我的程序中,我执行以下操作以检查我可以访问多少设备:

// 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;
//获取第一个平台
cl_平台\u id平台;
err=clGetPlatformIDs(1,&platform,NULL);
//获取设备计数
cl_uint gpu账户;
err=CLGetDeviceID(平台、CL\U设备类型\U GPU、0、NULL和gpuCount);
cl_uint cpuCount;
err |=CLGetDeviceID(平台、CL设备类型、CPU、0、NULL和cpuCount);

std::cout这并没有回答您的问题,(也不需要向下投票),但希望能帮助您确定实际安装了什么。我会将其作为评论发布,但格式将毫无用处

如果您想要一个清晰的已安装CPU和图形设备列表,下面的命令可以很好地实现这一点:

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

另外,如果有更好的方法提供更多有用的信息(这不是一个正确的答案),请告诉我。

您的处理器有多个内核,它们被识别为计算单元。运行以下代码段并检查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);

您可以使用GPU caps viewer应用程序验证您的结果。可以在上找到,根据您的计算机应该运行OpenCL 1.2。CPU是什么,即使是双核,它仍然是一个计算单元。因此1个CPU是正确的。否则,每次安装一个GPU时,您都会看到数百个GPU。@bl0z0那么,为什么它仍然显示0 GPU?使用compute我指的是OpenCL设备。我对Mac一无所知,如果是linux或windows,我会说你的驱动程序工作不正常。也许你需要手动为英特尔安装cl驱动程序