我正在使用此处给出的建议为我的算法选择最佳GPU。https://stackoverflow.com/a/33488953/5371117
我使用boost::compute::system::devices();
查询MacBook Pro上的设备,这将向我返回以下设备列表。>
=Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Intel(R) UHD Graphics 630 AMD Radeon Pro 560X Compute Engine
我想使用
AMD Radeon Pro 560X Compute Engine
来实现我的目的,但是当我迭代查找最大rating
CL_DEVICE_MAX_CLOCK_FREQUENCY * CL_DEVICE_MAX_COMPUTE_UNITS
的设备时。我得到以下结果:Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz, freq: 2600, compute units: 12, rating:31200 Intel(R) UHD Graphics 630, freq: 1150, units: 24, rating:27600 AMD Radeon Pro 560X Compute Engine, freq: 300, units: 16, rating:4800
AMD GPU的评分最低。我也查看了规格,在我看来
CL_DEVICE_MAX_CLOCK_FREQUENCY
没有返回正确的值。
根据AMD芯片规格https://www.amd.com/en/products/graphics/radeon-rx-560x,我的AMD GPU的基本频率为1175 MHz,不是300MHz
。根据英特尔芯片规格https://en.wikichip.org/wiki/intel/uhd_graphics/630,我的英特尔GPU的基本频率为300 MHz,不是1150MHz
,但确实具有1150MHz的提升频率] >>std::vector<boost::compute::device> devices = boost::compute::system::devices(); std::pair<boost::compute::device, ai::int64> suitableDevice{}; for(auto& device: devices) { auto rating = device.clock_frequency() * device.compute_units(); std::cout << device.name() << ", freq: " << device.clock_frequency() << ", units: " << device.compute_units() << ", rating:" << rating << std::endl; if(suitableDevice.second < benchmark) { suitableDevice.first = device; suitableDevice.second = benchmark; } }
我做错什么了吗?
我正在使用此处给出的建议为我的算法选择最佳GPU。 https://stackoverflow.com/a/33488953/5371117我在Macbook Pro上使用boost :: compute :: system :: devices()...
不幸的是,这些属性实际上只能在实现中直接比较(相同的硬件制造商,相同的操作系统)。
我的建议是: