Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
minmingzhu committed Aug 21, 2024
1 parent 036b825 commit 68cfb42
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions mllib-dal/src/main/native/CorrelationImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,22 @@ static jlong doCorrelationOneAPICompute(
logger::println(logger::INFO, "numClos was %d", numClos);
auto t1 = std::chrono::high_resolution_clock::now();

auto data = sycl::malloc_shared<float>(numRows * numClos, queue);
std::cout << "table size : " << numRows * numClos << std::endl;
logger::Logger::getInstance(breakdown_name).printLogToFile("rankID was %d, table size %ld.", comm.get_rank(), numRows * numClos );
queue.memcpy(data, htableArray, sizeof(float) * numRows * numClos).wait();
// auto data = sycl::malloc_shared<float>(numRows * numClos, queue);
// std::cout << "table size : " << numRows * numClos << std::endl;
// logger::Logger::getInstance(breakdown_name).printLogToFile("rankID was %d, table size %ld.", comm.get_rank(), numRows * numClos );
// queue.memcpy(data, htableArray, sizeof(float) * numRows * numClos).wait();
auto data =
oneapi::dal::array<float>::empty(queue, numRows * numClos, sycl::usm::alloc::device);

detail::memcpy_host2usm(queue,
data.get_mutable_data(),
htableArray,
sizeof(float) * numRows * numClos);

homogen_table htable = homogen_table::wrap(data, numRows, numClos);
freeArrayPtr<float>(htableArray);
homogen_table htable{queue, data, numRows, numClos,
detail::make_default_delete<const float>(queue)};
// homogen_table htable{queue, data, numRows, numClos,
// detail::make_default_delete<const float>(queue)};
auto t2 = std::chrono::high_resolution_clock::now();
auto duration =
(float)std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1)
Expand Down

0 comments on commit 68cfb42

Please sign in to comment.