Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/openj9.gpu/share/classes/com/ibm/gpu/CUDADevice.java
12565 views
1
/*[INCLUDE-IF Sidecar17]*/
2
/*******************************************************************************
3
* Copyright (c) 2014, 2016 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
*******************************************************************************/
23
package com.ibm.gpu;
24
25
/**
26
* Representation of a real, connected CUDA device.
27
*/
28
public final class CUDADevice {
29
30
private final int deviceID;
31
32
private final int doubleThresholdValue;
33
34
private final int floatThresholdValue;
35
36
private final int intThresholdValue;
37
38
private final int longThresholdValue;
39
40
private final String model;
41
42
CUDADevice(int deviceID, String modelName, int doubleThresholdValue,
43
int floatThresholdValue, int intThresholdValue,
44
int longThresholdValue) {
45
super();
46
this.deviceID = deviceID;
47
this.doubleThresholdValue = doubleThresholdValue;
48
this.floatThresholdValue = floatThresholdValue;
49
this.intThresholdValue = intThresholdValue;
50
this.longThresholdValue = longThresholdValue;
51
this.model = modelName;
52
}
53
54
/**
55
* Returns the device ID of this CUDA device.
56
*
57
* @return the device ID of the device
58
*/
59
public int getDeviceID() {
60
return deviceID;
61
}
62
63
/**
64
* Returns the minimum size of a double array that will be sorted using
65
* this CUDA device if enabled.
66
*
67
* @return the minimum size of a double array that will be sorted using
68
* this CUDA device
69
*/
70
public int getDoubleThreshold() {
71
return doubleThresholdValue;
72
}
73
74
/**
75
* Returns the minimum size of a float array that will be sorted using
76
* this CUDA device if enabled.
77
*
78
* @return the minimum size of a float array that will be sorted using
79
* this CUDA device
80
*/
81
public int getFloatThreshold() {
82
return floatThresholdValue;
83
}
84
85
/**
86
* Returns the minimum size of an int array that will be sorted using
87
* this CUDA device if enabled.
88
*
89
* @return the minimum size of an int array that will be sorted using
90
* this CUDA device
91
*/
92
public int getIntThreshold() {
93
return intThresholdValue;
94
}
95
96
/**
97
* Returns the minimum size of a long array that will be sorted using
98
* this CUDA device if enabled.
99
*
100
* @return the minimum size of a long array that will be sorted using
101
* this CUDA device
102
*/
103
public int getLongThreshold() {
104
return longThresholdValue;
105
}
106
107
/** {@inheritDoc} */
108
@Override
109
public String toString() {
110
return deviceID + ": " + model; //$NON-NLS-1$
111
}
112
113
}
114
115