Path: blob/master/jcl/src/openj9.gpu/share/classes/com/ibm/gpu/CUDADevice.java
12565 views
/*[INCLUDE-IF Sidecar17]*/1/*******************************************************************************2* Copyright (c) 2014, 2016 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* 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-exception21*******************************************************************************/22package com.ibm.gpu;2324/**25* Representation of a real, connected CUDA device.26*/27public final class CUDADevice {2829private final int deviceID;3031private final int doubleThresholdValue;3233private final int floatThresholdValue;3435private final int intThresholdValue;3637private final int longThresholdValue;3839private final String model;4041CUDADevice(int deviceID, String modelName, int doubleThresholdValue,42int floatThresholdValue, int intThresholdValue,43int longThresholdValue) {44super();45this.deviceID = deviceID;46this.doubleThresholdValue = doubleThresholdValue;47this.floatThresholdValue = floatThresholdValue;48this.intThresholdValue = intThresholdValue;49this.longThresholdValue = longThresholdValue;50this.model = modelName;51}5253/**54* Returns the device ID of this CUDA device.55*56* @return the device ID of the device57*/58public int getDeviceID() {59return deviceID;60}6162/**63* Returns the minimum size of a double array that will be sorted using64* this CUDA device if enabled.65*66* @return the minimum size of a double array that will be sorted using67* this CUDA device68*/69public int getDoubleThreshold() {70return doubleThresholdValue;71}7273/**74* Returns the minimum size of a float array that will be sorted using75* this CUDA device if enabled.76*77* @return the minimum size of a float array that will be sorted using78* this CUDA device79*/80public int getFloatThreshold() {81return floatThresholdValue;82}8384/**85* Returns the minimum size of an int array that will be sorted using86* this CUDA device if enabled.87*88* @return the minimum size of an int array that will be sorted using89* this CUDA device90*/91public int getIntThreshold() {92return intThresholdValue;93}9495/**96* Returns the minimum size of a long array that will be sorted using97* this CUDA device if enabled.98*99* @return the minimum size of a long array that will be sorted using100* this CUDA device101*/102public int getLongThreshold() {103return longThresholdValue;104}105106/** {@inheritDoc} */107@Override108public String toString() {109return deviceID + ": " + model; //$NON-NLS-1$110}111112}113114115