| 104 | } |
| 105 | |
| 106 | static string platformMap(string& platStr) { |
| 107 | using strmap_t = map<string, string>; |
| 108 | static const strmap_t platMap = { |
| 109 | make_pair("NVIDIA CUDA", "NVIDIA"), |
| 110 | make_pair("Intel(R) OpenCL", "INTEL"), |
| 111 | make_pair("AMD Accelerated Parallel Processing", "AMD"), |
| 112 | make_pair("Intel Gen OCL Driver", "BEIGNET"), |
| 113 | make_pair("Intel(R) OpenCL HD Graphics", "INTEL"), |
| 114 | make_pair("Apple", "APPLE"), |
| 115 | make_pair("Portable Computing Language", "POCL"), |
| 116 | }; |
| 117 | |
| 118 | auto idx = platMap.find(platStr); |
| 119 | |
| 120 | if (idx == platMap.end()) { |
| 121 | return platStr; |
| 122 | } else { |
| 123 | return idx->second; |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | afcl::platform getPlatformEnum(Device dev) { |
| 128 | string pname = getPlatformName(dev); |