-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDevice.cs
More file actions
31 lines (29 loc) · 915 Bytes
/
Device.cs
File metadata and controls
31 lines (29 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) TensorStack. All rights reserved.
// Licensed under the Apache 2.0 License.
using System;
namespace TensorStack.Common
{
public record Device
{
private int _memory;
public int Id { get; init; }
public int DeviceId { get; init; }
public string Name { get; init; }
public DeviceType Type { get; init; }
public VendorType Vendor { get; init; }
public int HardwareID { get; init; }
public int HardwareLUID { get; init; }
public int HardwareVendorId { get; init; }
public string HardwareVendor { get; init; }
public int Memory
{
get { return _memory; }
init
{
_memory = value;
MemoryGB = (int)Math.Round(_memory / 1024.0, 0, MidpointRounding.ToEven);
}
}
public int MemoryGB { get; init; }
}
}