Skip to content

Commit

Permalink
Migrate pca daal to DPC++ (oap-project#223)
Browse files Browse the repository at this point in the history
* 1. add JNI wrapper
2. modify compiler config
3. add unit test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* add ci test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* java code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* cpp code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-test.sh

* Update ci-local-test.sh

* Update install-build-deps-ubuntu.sh

* Update install-build-deps-ubuntu.sh

* Update ci-local-test.sh

* Update ci-local-test.sh

* Update ci-local-test.sh

* Update install-build-deps-ubuntu.sh

* Update install-build-deps-ubuntu.sh

* Update install-build-deps-ubuntu.sh

* Update install-build-deps-ubuntu.sh

* Update install-build-deps-ubuntu.sh

* Update prepare-build-deps.sh

* add convert array, vector to homogentable

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. rollback ci config
2. remove CI test becaue homogentable only support GPU

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. update prepare-build-deps.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* remove ci GPU test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. remove GPU CI test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* fix comments

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update Makefile

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* fix comments

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. fix ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update header

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update header

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-cluster-test.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci conf

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update oneapi to 2022.1.2

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci conf

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* fix comment

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update build-jni.sh

* update Makefile

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update test.sh

* Update test.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update test.sh

* Update test.sh

* update test.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update test.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update test.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* fix link libze_loader.so.1

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci-local-dpc-test.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update oneapi to 2022.1.2

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update Makefile

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* Update prepare-build-deps-gpu.sh

* Update prepare-build-deps-gpu.sh

* Update prepare-build-deps.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update install-build-level-zero-deps-ubuntun.sh

* Update install-build-level-zero-deps-ubuntun.sh

* Update install-build-level-zero-deps-ubuntun.sh

* Update ci-local-dpc-test.sh

* Update GPU.cpp

* Update GPU.cpp

* Update ci-build-test.sh

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update HomogenTableImpl.cpp

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* Update ci-local-dpc-test.sh

* Update ci-local-dpc-test.sh

* update HomogenTable API

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update install-build-level-zero-deps-ubuntu.sh

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-local-dpc-test.sh

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update ci

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update run.sh

* Update build-jni.sh

* 1. Merge branch 'make_homogen_table' into convert_homogentable
2. update ci
3. add a new parameters for HomogenTable class

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update pom.xml

* Update test.sh

* Update Makefile

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ConvertHomogenTableSuite.scala

* Update install-level-zero-ubuntu.sh

* Update install-level-zero-ubuntu.sh

* Update build.sh

* Update test.sh

* Update test.sh

* Update HomogenTableImpl.cpp

* Update install-build-deps-ubuntu.sh

* Update HomogenTableImpl.cpp

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update install-build-deps-ubuntu.sh

* fix comments

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update list-compute-devices.cpp

* Convert homogentable to array/vector/matrix (#4)

* 1. convert homogenTable to array/vector/matrix
2. add unit test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Merge branch 'make_homogen_table' into convert_homogentable

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* fix comments

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Convert RDD[Vector]/RDD[LabeledPoint] to HomogenTable (#8)

* 1. convert rdd to HomogenTable
* 2. add unit test

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* add empty homogentable

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Mirgate kmeans daal to DPC++ (#7)

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. Mirgate kmeans daal to DPC++
* 2. add unit test

* 1. move local host to distributed host
2. add cluster test
3. code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update ci-cluster-test.sh

* Update ci-cluster-test.sh

* Update build.sh

* Update build.sh

* Update OneDAL.cpp

* Update OneDAL.cpp

* Update OneDAL.cpp

* Update com_intel_oap_mllib_OneDAL__.h

* update code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update NaiveBayesResult.java

* 1. update code style
2. When using the Host/CPU device throws a fail

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* rollback code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* rollback code style

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* rollback checkstyle.xml

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* rollback checkstyle.xml

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update OneDAL.scala

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* revert ALS.scala

* revert checkstyle.xml

* :Revert "revert checkstyle.xml"

This reverts commit 4f74bac.

* disable cluster test for gpu

* disable cluster test for gpu

* nit

* migrate cpa to DPC++

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* Update OutputHelpers.hpp

* update com_intel_oap_mllib_feature_PCADALImpl.h

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update PCADALImpl.scala

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* 1. update function name and variable name

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* update stayHomogenTablePtrToVector to saveHomogenTablePtrToVector

Signed-off-by: minmingzhu <minming.zhu@intel.com>

* change compute_device to ComputeDevice

Signed-off-by: minmingzhu <minming.zhu@intel.com>

Co-authored-by: minmingz <minming.zhu@inte.com>
Co-authored-by: Wu, Xiaochang <xiaochang.wu@intel.com>
  • Loading branch information
3 people committed Apr 8, 2023
1 parent d0401a7 commit fde5912
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mllib-dal/src/main/native/KMeansOneAPIImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Java_com_intel_oap_mllib_clustering_KMeansDALImpl_cKMeansOneapiComputeWithInitCe
JNIEnv *env, jobject obj, jlong pNumTabData, jlong pNumTabCenters,
jint clusterNum, jdouble tolerance, jint iterationNum, jint executorNum,
jint computeDeviceOrdinal, jint rankId, jstring ipPort, jobject resultObj) {
std::cout << "oneDAL (native): use DPC++ kernels " << std::endl;
std::cout << "oneDAL (native): use GPU DPC++ kernels " << std::endl;
const char *ipPortPtr = env->GetStringUTFChars(ipPort, 0);
std::string ipPortStr = std::string(ipPortPtr);
jlong ret = 0L;
Expand Down
1 change: 0 additions & 1 deletion mllib-dal/src/main/native/oneapi/dal/RowAccessorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
using namespace std;
using namespace oneapi::dal;


/*
* Class: com_intel_oneapi_dal_table_RowAccessor
* Method: cPull
Expand Down
4 changes: 4 additions & 0 deletions mllib-dal/src/main/scala/com/intel/oap/mllib/OneDAL.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ object OneDAL {

val accessor = new RowAccessor(table.getcObejct(), device)
val arrayDouble: Array[Double] = accessor.pullDouble(0, numRows)
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
// Transpose as DAL numeric table is row-major and DenseMatrix is column major
val OldMatrix = new OldDenseMatrix(numRows, numCols, arrayDouble, isTransposed = true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,15 @@ class KMeansDALImpl(

def train(data: RDD[Vector]): MLlibKMeansModel = {
val sparkContext = data.sparkContext
<<<<<<< HEAD
val useDevice = sparkContext.getConf.get("spark.oap.mllib.device", "GPU")
val computeDevice = Common.ComputeDevice.getDeviceByName(useDevice)
val coalescedTables = OneDAL.coalesceToHomogenTables(data, executorNum, computeDevice)
=======
val useDevice = sparkContext.getConf.get("spark.oap.mllib.device", Utils.DefaultComputeDevice)
val computeDevice = Common.ComputeDevice.getDeviceByName(useDevice)
val coalescedTables = OneDAL.rddVectorToMergedHomogenTables(data, executorNum, computeDevice)
>>>>>>> Migrate pca daal to DPC++ (#223)
val kvsIPPort = getOneCCLIPPort(coalescedTables)
val results = coalescedTables
.mapPartitionsWithIndex { (rank, table) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class PCADALImpl(val k: Int, val executorNum: Int, val executorCores: Int)
val sparkContext = normalizedData.sparkContext
val useDevice = sparkContext.getConf.get("spark.oap.mllib.device", Utils.DefaultComputeDevice)
val computeDevice = Common.ComputeDevice.getDeviceByName(useDevice)
<<<<<<< HEAD
val coalescedTables = OneDAL.coalesceToHomogenTables(normalizedData, executorNum,
=======
val coalescedTables = OneDAL.rddVectorToMergedHomogenTables(normalizedData, executorNum,
>>>>>>> Migrate pca daal to DPC++ (#223)
computeDevice)
val kvsIPPort = getOneCCLIPPort(coalescedTables)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class HomogenTableTest {
@Test
public void createEmptyTable() {
HomogenTable table = new HomogenTable(CommonTest.getComputeDevice());
<<<<<<< HEAD
assertEquals(false, table.hasData());
assertEquals(new Long(0), table.getColumnCount());
assertEquals(new Long(0), table.getRowCount());
Expand All @@ -19,6 +20,8 @@ public void createEmptyTable() {
@Test
public void createEmptyTable() {
HomogenTable table = new HomogenTable(CommonTest.getDevice());
=======
>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(false, table.hasData());
assertEquals(new Long(0), table.getColumnCount());
assertEquals(new Long(0), table.getRowCount());
Expand Down Expand Up @@ -50,6 +53,11 @@ public void createRowmajorDoubleTable() throws Exception {
53.620204d, 33.219769d, 85.208661d, 15.966239d};
HomogenTable table = new HomogenTable(5, 2,
data, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======


>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -70,6 +78,10 @@ public void createRowmajorLongTable() throws Exception {
long[] data = {1L, 2L, 3L, 4L, 5L, 6L, 10L, 80L, 10L, 11L};
HomogenTable table = new HomogenTable(5, 2,
data, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -90,6 +102,10 @@ public void createRowmajorFloatTable() throws Exception {
53.620204f, 33.219769f, 85.208661f, 15.966239f};
HomogenTable table = new HomogenTable(5, 2,
data, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -111,6 +127,10 @@ public void createColmajorIntTable() throws Exception {
int[] data = {1, 2, 3, 4, 5, 6, 10, 80, 10, 11};
HomogenTable table = new HomogenTable(5, 2,
data, COLUMN_MAJOR, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -131,6 +151,10 @@ public void createColmajorFloatTable() throws Exception {
53.620204f, 33.219769f, 85.208661f, 15.966239f};
HomogenTable table = new HomogenTable(5, 2,
data, COLUMN_MAJOR, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -150,6 +174,10 @@ public void createColmajorLongTable() throws Exception {
long[] data = {1L, 2L, 3L, 4L, 5L, 6L, 10L, 80L, 10L, 11L};
HomogenTable table = new HomogenTable(5, 2,
data, COLUMN_MAJOR, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand All @@ -170,6 +198,10 @@ public void createColmajorDoubleTable() throws Exception {
53.620204d, 33.219769d, 85.208661d, 15.966239d};
HomogenTable table = new HomogenTable(5, 2,
data, COLUMN_MAJOR, CommonTest.getComputeDevice());
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertEquals(true, table.hasData());
assertEquals(new Long(2), table.getColumnCount());
assertEquals(new Long(5), table.getRowCount());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ class ConvertHomogenTableSuite extends FunctionsSuite with Logging {
val arrayData = TestCommon.convertArray(data)
val table = new HomogenTable(10, 10, arrayData, TestCommon.getComputeDevice)
val array = OneDAL.homogenTableToVectors(table, TestCommon.getComputeDevice)
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)
assertArrayEquals(TestCommon.convertArray(data), TestCommon.convertArray(array))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import org.apache.spark.internal.Logging
import org.apache.spark.ml.FunctionsSuite
import org.apache.spark.ml.linalg.Vectors
import org.junit.jupiter.api.Assertions.assertArrayEquals
<<<<<<< HEAD
=======

>>>>>>> Migrate pca daal to DPC++ (#223)

class KmeansHomogenTableSuite extends FunctionsSuite with Logging {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ class PCAHomogenTableSuite extends FunctionsSuite with Logging {
Vectors.dense(-0.340048,-0.585059, -0.167712, 0.296446, 0.607235, 0.064941, 0.000978, 0.186870, -0.010096, -0.134500)
)
val expectExplainedVariance = Array(3.492693, 1.677875, 1.529460, 1.147213, 0.769543, 0.731955, 0.507616, 0.075259, 0.047056, 0.021329)
<<<<<<< HEAD
val sourceData = TestCommon.readCSV("src/test/resources/data/pca_normalized.csv")
=======
val sourceData = TestCommon.readCSV("src/test/scala/data/pca_normalized.csv")
>>>>>>> Migrate pca daal to DPC++ (#223)

val dataTable = new HomogenTable(sourceData.length, sourceData(0).length, TestCommon.convertArray(sourceData), TestCommon.getComputeDevice);

Expand Down Expand Up @@ -55,7 +59,11 @@ class PCAHomogenTableSuite extends FunctionsSuite with Logging {
Vectors.dense(0.256176,0.169571,-0.257595,-0.330404,-0.220727,-0.564058,0.339305,0.215309,0.415052,0.171641)
)
val expectExplainedVariance = Array(1.304369, 1.252785, 1.120113, 1.114487, 1.083063, 0.942371, 0.909094, 0.825540, 0.746623, 0.701554)
<<<<<<< HEAD
val sourceData = TestCommon.readCSV("src/test/resources/data/pca_no_normalized.csv")
=======
val sourceData = TestCommon.readCSV("src/test/scala/data/pca_no_normalized.csv")
>>>>>>> Migrate pca daal to DPC++ (#223)

val dataTable = new HomogenTable(sourceData.length, sourceData(0).length, TestCommon.convertArray(sourceData), TestCommon.getComputeDevice);

Expand Down
13 changes: 13 additions & 0 deletions mllib-dal/src/test/scala/com/intel/oap/mllib/TestCommon.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.intel.oap.mllib

<<<<<<< HEAD
import com.intel.oneapi.dal.table.{Common, HomogenTable, RowAccessor}
import org.apache.spark.ml.linalg.{DenseMatrix, Vector}
=======
import org.apache.spark.ml.linalg.Vector
>>>>>>> Migrate pca daal to DPC++ (#223)
import org.apache.spark.mllib.linalg.{Vector => OldVector}
import com.intel.oneapi.dal.table.{Common, HomogenTable}

Expand Down Expand Up @@ -67,6 +71,7 @@ object TestCommon {
}
arrayDouble
}
<<<<<<< HEAD
def getMatrixFromTable(table: HomogenTable,
device: Common.ComputeDevice): DenseMatrix = {
val numRows = table.getRowCount.toInt
Expand All @@ -80,16 +85,24 @@ object TestCommon {

matrix
}
=======
>>>>>>> Migrate pca daal to DPC++ (#223)

def getComputeDevice: Common.ComputeDevice = {
val device = System.getProperty("computeDevice")
var computeDevice: Common.ComputeDevice = Common.ComputeDevice.HOST
if(device != null) {
device.toUpperCase match {
case "HOST" => computeDevice = Common.ComputeDevice.HOST
<<<<<<< HEAD
case "CPU" => computeDevice = Common.ComputeDevice.CPU
case "GPU" => computeDevice = Common.ComputeDevice.GPU
case _ => "Invalid Device"
=======
case "CPU" => computeDevice = Common.ComputeDevice.CPU
case "GPU" => computeDevice = Common.ComputeDevice.GPU
case _ => "Invalid Device"
>>>>>>> Migrate pca daal to DPC++ (#223)
}
}
System.out.println("getDevice : " + computeDevice)
Expand Down

0 comments on commit fde5912

Please sign in to comment.