Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert homogentable to array/vector/matrix #4

Merged
merged 47 commits into from
May 17, 2022
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
08352ab
1. convert homogenTable to array/vector/matrix
minmingzhu Apr 17, 2022
a88614f
update ConvertHomogenTableSuite.scala
minmingzhu Apr 17, 2022
aaca1ea
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 17, 2022
5aa8430
update test.sh
minmingzhu Apr 17, 2022
44e00c5
Update build-jni.sh
minmingzhu Apr 17, 2022
244d33d
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 22, 2022
711ba0c
update
minmingzhu Apr 22, 2022
1dfc511
update ColumnAccessorImpl.cpp RowAccessorImpl.cpp
minmingzhu Apr 24, 2022
77a46a9
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 25, 2022
08c70e2
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 25, 2022
ba99cb6
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 28, 2022
7843ca3
Merge remote-tracking branch 'origin/convert_homogentable' into conve…
minmingzhu Apr 28, 2022
e0b782f
Update ci-local-dpc-test.sh
minmingzhu Apr 28, 2022
6c32fca
merge make_homogen_table
minmingzhu May 9, 2022
f3a72e5
rollback to edb9f3d
minmingzhu May 9, 2022
cc5352c
update
minmingzhu May 9, 2022
884c0b4
Merge remote-tracking branch 'origin/convert_homogentable' into conve…
minmingzhu May 9, 2022
c3b214e
1. convert homogenTable to array/vector/matrix
minmingzhu Apr 17, 2022
47a7171
update ConvertHomogenTableSuite.scala
minmingzhu Apr 17, 2022
4556a5d
update ColumnAccessorImpl.cpp RowAccessorImpl.cpp
minmingzhu Apr 24, 2022
7f9a768
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 25, 2022
0ea2448
update
minmingzhu May 9, 2022
35af201
update
minmingzhu May 9, 2022
065d0d3
Merge remote-tracking branch 'origin/convert_homogentable' into conve…
minmingzhu May 9, 2022
8ab660d
update
minmingzhu May 9, 2022
0cb1f19
1. convert homogenTable to array/vector/matrix
minmingzhu Apr 17, 2022
354d4a9
update ConvertHomogenTableSuite.scala
minmingzhu Apr 17, 2022
f6c228b
update ColumnAccessorImpl.cpp RowAccessorImpl.cpp
minmingzhu Apr 24, 2022
e1cba0d
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 25, 2022
fcf8314
rollback to edb9f3d
minmingzhu May 9, 2022
0c4bd73
update
minmingzhu May 9, 2022
2226da9
1. convert homogenTable to array/vector/matrix
minmingzhu Apr 17, 2022
73f99fa
update ColumnAccessorImpl.cpp RowAccessorImpl.cpp
minmingzhu Apr 24, 2022
800845b
Merge branch 'make_homogen_table' into convert_homogentable
minmingzhu Apr 25, 2022
e13e27a
update
minmingzhu May 9, 2022
177e486
update
minmingzhu May 9, 2022
e4778fe
Merge remote-tracking branch 'origin/convert_homogentable' into conve…
minmingzhu May 9, 2022
7114c7c
update
minmingzhu May 9, 2022
ef2a7d7
update cpp style
minmingzhu May 9, 2022
45bf666
Update build.sh
minmingzhu May 10, 2022
5b86e6c
fix comments
minmingzhu May 10, 2022
8f31387
Merge remote-tracking branch 'origin/convert_homogentable' into conve…
minmingzhu May 10, 2022
f060188
update code style
minmingzhu May 10, 2022
d853874
fix comments
minmingzhu May 16, 2022
d84ab04
update
minmingzhu May 16, 2022
961f55f
update
minmingzhu May 16, 2022
9e694f2
update
minmingzhu May 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update ColumnAccessorImpl.cpp RowAccessorImpl.cpp
Signed-off-by: minmingzhu <minming.zhu@intel.com>
minmingzhu committed May 9, 2022
commit f6c228b1b54ecb84b4c50ea9a3e58d4a11730fe0
30 changes: 22 additions & 8 deletions mllib-dal/src/main/native/oneapi/dal/ColumnAccessorImpl.cpp
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@
#include <typeinfo>
#include <vector>

#ifdef CPU_GPU_PROFILE
#include "GPU.h"
#endif
#ifndef ONEDAL_DATA_PARALLEL
#define ONEDAL_DATA_PARALLEL
#endif
@@ -43,12 +46,23 @@ JNIEXPORT jdoubleArray JNICALL Java_com_intel_oneapi_dal_table_ColumnAccessor_cP
homogen_table *htable =
((std::shared_ptr<homogen_table> *)cTableAddr)->get();
column_accessor<const double> *acc = new column_accessor<const double>(*htable);
const auto col_values = acc->pull(cColumnIndex, {cRowStartIndex, cRowEndIndex});
double* col_doubles = new double[col_values.get_count()];
for (std::int64_t i = 0; i < col_values.get_count(); i++) {
col_doubles[i] = col_values[i];
}
jdoubleArray newDoubleArray = env->NewDoubleArray(col_values.get_count());
env->SetDoubleArrayRegion(newDoubleArray, 0, col_values.get_count(), col_doubles);
return newDoubleArray;
#ifdef CPU_GPU_PROFILE
sycl::queue queue = getQueue();
const auto sycl_col_values = acc->pull(cColumnIndex, {cRowStartIndex, cRowEndIndex});
double* sycl_col_doubles = new double[sycl_col_values.get_count()];
for (std::int64_t i = 0; i < sycl_col_values.get_count(); i++) {
sycl_col_doubles[i] = sycl_col_values[i];
}
jdoubleArray sycl_newDoubleArray = env->NewDoubleArray(sycl_col_values.get_count());
env->SetDoubleArrayRegion(sycl_newDoubleArray, 0, sycl_col_values.get_count(), sycl_col_doubles);
return sycl_newDoubleArray;
#endif
const auto col_values = acc->pull(cColumnIndex, {cRowStartIndex, cRowEndIndex});
double* col_doubles = new double[col_values.get_count()];
for (std::int64_t i = 0; i < col_values.get_count(); i++) {
col_doubles[i] = col_values[i];
}
jdoubleArray newDoubleArray = env->NewDoubleArray(col_values.get_count());
env->SetDoubleArrayRegion(newDoubleArray, 0, col_values.get_count(), col_doubles);
return newDoubleArray;
}
30 changes: 22 additions & 8 deletions mllib-dal/src/main/native/oneapi/dal/RowAccessorImpl.cpp
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@
#include <typeinfo>
#include <vector>

#ifdef CPU_GPU_PROFILE
#include "GPU.h"
#endif
#ifndef ONEDAL_DATA_PARALLEL
#define ONEDAL_DATA_PARALLEL
#endif
@@ -44,12 +47,23 @@ JNIEXPORT jdoubleArray JNICALL Java_com_intel_oneapi_dal_table_RowAccessor_cPull
homogen_table *htable =
((std::shared_ptr<homogen_table> *)cTableAddr)->get();
row_accessor<const double> *acc = new row_accessor<const double>(*htable);
const auto row_values = acc->pull({cRowStartIndex, cRowEndIndex});
double* row_doubles = new double[row_values.get_count()];
for (std::int64_t i = 0; i < row_values.get_count(); i++) {
row_doubles[i] = row_values[i];
}
jdoubleArray newDoubleArray = env->NewDoubleArray(row_values.get_count());
env->SetDoubleArrayRegion(newDoubleArray, 0, row_values.get_count(), row_doubles);
return newDoubleArray;
#ifdef CPU_GPU_PROFILE
sycl::queue queue = getQueue();
const auto sycl_row_values = acc->pull(queue,{cRowStartIndex, cRowEndIndex});
double* sycl_row_doubles = new double[sycl_row_values.get_count()];
for (std::int64_t i = 0; i < sycl_row_values.get_count(); i++) {
sycl_row_doubles[i] = sycl_row_values[i];
}
jdoubleArray sycl_newDoubleArray = env->NewDoubleArray(sycl_row_values.get_count());
env->SetDoubleArrayRegion(sycl_newDoubleArray, 0, sycl_row_values.get_count(), sycl_row_doubles);
return sycl_newDoubleArray;
#endif
const auto row_values = acc->pull({cRowStartIndex, cRowEndIndex});
double* row_doubles = new double[row_values.get_count()];
for (std::int64_t i = 0; i < row_values.get_count(); i++) {
row_doubles[i] = row_values[i];
}
jdoubleArray newDoubleArray = env->NewDoubleArray(row_values.get_count());
env->SetDoubleArrayRegion(newDoubleArray, 0, row_values.get_count(), row_doubles);
return newDoubleArray;
}