开发者

Sys::Info - Question

开发者 https://www.devze.com 2023-03-20 09:17 出处:网络
From Sys::开发者_高级运维Info::Device: If DEVICE_ID has the value of available, then the names of the available devices will be returned.

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

精彩评论

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