"[#{k}]=#{v.inspect} must be a positive integer")
end
end
+ if runtime_constraints['cuda']
+ ['device_count'].each do |k|
+ v = runtime_constraints['cuda'][k]
+ if !v.is_a?(Integer) || v < 0
+ errors.add(:runtime_constraints,
+ "[cuda.#{k}]=#{v.inspect} must be a positive or zero integer")
+ end
+ end
+ ['driver_version', 'hardware_capability'].each do |k|
+ v = runtime_constraints['cuda'][k]
+ if !v.is_a?(String)
+ errors.add(:runtime_constraints,
+ "[cuda.#{k}]=#{v.inspect} must be a string")
+ end
+ end
+ end
end
end