开发者

Sys::Info - Question

From Sys::开发者_高级运维Info::Device:

If DEVICE_ID has the value of available, then the names of the available devices will be returned.

Why does $info->device('available'); return no devices when there is at least the cpu-device?

#!/usr/local/bin/perl
use warnings;
use 5.014;
use Sys::Info;

my $info = Sys::Info->new;

my @available = $info->device('available');
say 'Available devices: ', scalar @available;

my $cpu = $info->device( 'CPU' );
say 'Number of cores: ', $cpu->count;

Output:

Available devices: 0

Number of cores: 2


I get the same output running this on a Mac OS X box. You might contact the developer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜