Skip to content

Commit

Permalink
Merge pull request #50 from oneapi-src/jgt/easywave
Browse files Browse the repository at this point in the history
Updating CMakeLists.txt for easywave CUDA
  • Loading branch information
jgtong authored Mar 4, 2024
2 parents c10829e + 2ad2e18 commit d54df8b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion easywave/CUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()
add_compile_options(-DUSE_CUDA)
add_compile_options(-DENABLE_CUDA_LOGGING)

set(CUDA_NVCC_FLAGS -std=c++17)
#set(CUDA_NVCC_FLAGS -std=c++17)
if(ENABLE_GPU_TIMINGS)
message(STATUS "GPU Timings will be displayed")
add_compile_options(-DENABLE_GPU_TIMINGS)
Expand Down
12 changes: 6 additions & 6 deletions easywave/SYCL/src/EasyWave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ int main(int argc, char **argv)
{
Timer tWallClock("WallClock");
tWallClock.Start();
LOG("Starting SYCL main program. Process ID: " << Utility::GetProcessID());
LOG("Starting SYCL main program"); ///. Process ID: " << Utility::GetProcessID());

std::vector<std::string> eWaveFiles(Utility::FileHandler::GetFilesFromDirectory(Utility::FileHandler::GetCurrentDirectory()));
if (!eWaveFiles.empty()) {
LOG("Attempting to clean up previous eWave tsunami files in " << Utility::FileHandler::GetCurrentDirectory());
LOG("Attempting to clean up previous eWave tsunami files"); ///in " << Utility::FileHandler::GetCurrentDirectory());
eWaveFiles.erase(std::remove_if(eWaveFiles.begin(), eWaveFiles.end(), [](std::string const &sPath) { return sPath.rfind("eWave") == std::string::npos; }), eWaveFiles.end());
size_t const uNumberOfeWaveFiles(eWaveFiles.size());
size_t const uNumberOfDeletedFiles(Utility::FileHandler::RemoveFiles(eWaveFiles));
Expand Down Expand Up @@ -181,7 +181,7 @@ int main(int argc, char **argv)

if (Par.outProgress) {
if (lastProgress >= Par.outProgress) {
LOG("Model time: " << utlTimeSplitString(Par.time)); //// << " Elapsed: " << tCumulatedComputeTime.GetTimeAsString(Timer::Units::SECONDS));
/////LOG("Model time: " << utlTimeSplitString(Par.time)); //// << " Elapsed: " << tCumulatedComputeTime.GetTimeAsString(Timer::Units::SECONDS));
/////printf( "Model time = %s, elapsed: %ld msec\n", utlTimeSplitString(Par.time), elapsed );
//
#ifdef SHOW_GRID
Expand Down Expand Up @@ -216,7 +216,7 @@ int main(int argc, char **argv)
}

} // main loop
LOG("Compute loop completed");
////LOG("Compute loop completed");

// clock_gettime(CLOCK_MONOTONIC, &end);
Log.print("Finishing main loop");
Expand All @@ -238,8 +238,8 @@ int main(int argc, char **argv)

LOG("Program successfully completed");
tWallClock.Stop();
LOG("I/O Time : " << dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
LOG("Total Execution Time: " << tWallClock.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
/////LOG("I/O Time : " << dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
/////LOG("Total Execution Time: " << tWallClock.GetTime() - dAccumulatedIOWriteTime - dAccumulateIOReadTime << " s");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion easywave/SYCL/src/ewGpuNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void CGpuNode::PrintTimingStats()
int CGpuNode::mallocMem()
{
try {
LOG("Allocating GPU memory");
////LOG("Allocating GPU memory");

CArrayNode::mallocMem();

Expand Down
20 changes: 10 additions & 10 deletions infrastructure/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,25 @@ void SYCL::DisplayProperties() //sycl::device const &Device)
{
LOG("\t Using SYCL device : " << m_syclQueue.get_device().get_info<sycl::info::device::name>() << " (Driver version " << m_syclQueue.get_device().get_info<sycl::info::device::driver_version>() << ")");
LOG("\t Platform : " << m_syclQueue.get_device().get_platform().get_info<sycl::info::platform::name>());
LOG("\t Vendor : " << m_syclQueue.get_device().get_info<sycl::info::device::vendor>());
LOG("\t Max compute units : " << m_syclQueue.get_device().get_info<sycl::info::device::max_compute_units>());
LOG("\t Queue type : " << (m_syclQueue.is_in_order() ? "In order" : "Out of order"));
////LOG("\t Vendor : " << m_syclQueue.get_device().get_info<sycl::info::device::vendor>());
////LOG("\t Max compute units : " << m_syclQueue.get_device().get_info<sycl::info::device::max_compute_units>());
////LOG("\t Queue type : " << (m_syclQueue.is_in_order() ? "In order" : "Out of order"));

std::vector<std::string> const vLDDPaths(Utility::ExtractLDDPathNameFromProcess({"libOpenCL", "libsycl", "libComputeCpp", "libze"})); //[0] OCL, [1] Intel's SYCL, [2] ComputeCpp SYCL
if (vLDDPaths.empty()) {
LOG_WARNING("Unable to print OpenCL and SYCL dependent libraries! The LD_LIBRARY_PATH may be incorrectly set"); // Should not reach to this case
return;
}

LOG("\t Using OpenCL library : " << (!vLDDPaths[0].empty() ? vLDDPaths[0] : "WARNING! OpenCL library not found!"));
////LOG("\t Using OpenCL library : " << (!vLDDPaths[0].empty() ? vLDDPaths[0] : "WARNING! OpenCL library not found!"));

if (!vLDDPaths[1].empty()) { // Implies we are using Intel's DPC++ compiler
LOG("\t Using OneAPI SYCL library : " << vLDDPaths[1]);
LOG("\t Using Level Zero library : " << (!vLDDPaths[3].empty() ? vLDDPaths[3] : "WARNING! Level zero library not found! L0 backend may not be available!"));
}
////if (!vLDDPaths[1].empty()) { // Implies we are using Intel's DPC++ compiler
//// LOG("\t Using OneAPI SYCL library : " << vLDDPaths[1]);
//// LOG("\t Using Level Zero library : " << (!vLDDPaths[3].empty() ? vLDDPaths[3] : "WARNING! Level zero library not found! L0 backend may not be available!"));
////}

if (!vLDDPaths[2].empty())
LOG("\t Using ComputeCPP library : " << vLDDPaths[2]);
////if (!vLDDPaths[2].empty())
//// LOG("\t Using ComputeCPP library : " << vLDDPaths[2]);
}

std::chrono::steady_clock::duration SYCL::ConvertKernelTimeToDuration(sycl::event const &Event)
Expand Down

0 comments on commit d54df8b

Please sign in to comment.