Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
minmingzhu committed Jul 26, 2024
1 parent bc1e35f commit 3849685
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions mllib-dal/src/main/native/CorrelationImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
#include "oneapi/dal/algo/covariance.hpp"
#endif

#ifndef ONEDAL_DATA_CONVERSION
#define ONEDAL_DATA_CONVERSION
#include "data_management/data_source/csv_feature_manager.h"
#include "data_management/data_source/file_data_source.h"
#undef ONEDAL_DATA_CONVERSION
#endif

#include "OneCCL.h"
#include "com_intel_oap_mllib_stat_CorrelationDALImpl.h"
#include "service.h"
Expand Down Expand Up @@ -148,6 +155,37 @@ static void doCorrelationDaalCompute(JNIEnv *env, jobject obj, size_t rankId,
}
}

std::vector<std::string> get_file_path(const std::string& path) {
std::vector<std::string> result;
for (auto& file : fs::directory_iterator(path)){
if(fs::is_empty(file.path())){
continue;
}else if(file.path().extension()==".crc" || file.path().extension()==""){
continue;
}else{
result.push_back(file.path());
}
}
return result;
}

inline bool check_file(const std::string& name) {
return std::ifstream{ name }.good();
}

inline std::string get_data_path(const std::string& name) {
const std::vector<std::string> paths = { "./data", "samples/oneapi/dpc/mpi/data" };

for (const auto& path : paths) {
const std::string try_path = path + "/" + name;
if (check_file(try_path)) {
return try_path;
}
}

return name;
}

#ifdef CPU_GPU_PROFILE
static void doCorrelationOneAPICompute(
JNIEnv *env, jlong pNumTabData, long numRows, long numClos,
Expand Down

0 comments on commit 3849685

Please sign in to comment.