Skip to content

Fix utils functions #185

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

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions backends/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ add_library(
source/dppl_sycl_queue_manager.cpp
source/dppl_sycl_usm_interface.cpp
source/dppl_utils.cpp
details/source/dppl_utils_details.cpp
helper/source/dppl_utils_helper.cpp
)

# Install DPPLSyclInterface
target_include_directories(
DPPLSyclInterface
PRIVATE
${CMAKE_SOURCE_DIR}/include/
${CMAKE_SOURCE_DIR}/details/include/
${CMAKE_SOURCE_DIR}/helper/include/
)

if(WIN32)
Expand Down Expand Up @@ -125,10 +125,10 @@ foreach(HEADER ${HEADERS})
install(FILES "${HEADER}" DESTINATION include/Support)
endforeach()

# Install all headers in details/include
file(GLOB HEADERS "${CMAKE_SOURCE_DIR}/details/include/*.h*")
# Install all headers in helper/include
file(GLOB HEADERS "${CMAKE_SOURCE_DIR}/helper/include/*.h*")
foreach(HEADER ${HEADERS})
install(FILES "${HEADER}" DESTINATION details/include)
install(FILES "${HEADER}" DESTINATION helper/include)
endforeach()

option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
#include <CL/sycl.hpp>
using namespace cl::sycl;

std::string DDPL_StrToDeviceType(info::device_type devTy);
info::device_type DPPL_DeviceTypeToStr(std::string devTyStr);
std::string DPPL_DeviceTypeToStr(info::device_type devTy);
info::device_type DPPL_StrToDeviceType(std::string devTyStr);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===------ dppl_utils_details.cpp - dpctl-C_API ----*---- C++ -----*-----===//
//===------ dppl_utils_helper.cpp - dpctl-C_API ----*---- C++ -----*-----===//
//
// Data Parallel Control Library (dpCtl)
//
Expand All @@ -19,11 +19,11 @@
//===----------------------------------------------------------------------===//
///
/// \file
/// This file implements the helper functions defined in dppl_utils_details.h.
/// This file implements the helper functions defined in dppl_utils_helper.h.
///
//===----------------------------------------------------------------------===//

#include "dppl_utils_details.h"
#include "dppl_utils_helper.h"
#include <string>
#include <sstream>

Expand All @@ -32,7 +32,7 @@ using namespace cl::sycl;
/*!
* Transforms enum info::device_type to string.
*/
std::string DDPL_StrToDeviceType(info::device_type devTy)
std::string DPPL_DeviceTypeToStr(info::device_type devTy)
{
std::stringstream ss;
switch (devTy)
Expand Down Expand Up @@ -61,7 +61,7 @@ std::string DDPL_StrToDeviceType(info::device_type devTy)
/*!
* Transforms string to enum info::device_type.
*/
info::device_type DPPL_DeviceTypeToStr(std::string devTyStr)
info::device_type DPPL_StrToDeviceType(std::string devTyStr)
{
info::device_type devTy;
if (devTyStr == "cpu") {
Expand Down
4 changes: 2 additions & 2 deletions backends/source/dppl_sycl_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <iostream>
#include <cstring>
#include <CL/sycl.hpp> /* SYCL headers */
#include "../details/include/dppl_utils_details.h"
#include "../helper/include/dppl_utils_helper.h"

using namespace cl::sycl;

Expand Down Expand Up @@ -59,7 +59,7 @@ void dump_device_info (const device & Device)
ss << std::setw(4) << " " << std::left << std::setw(16) << "Device type";

auto devTy = Device.get_info<info::device::device_type>();
ss << DDPL_StrToDeviceType(devTy);
ss << DPPL_DeviceTypeToStr(devTy);

std::cout << ss.str();
}
Expand Down
4 changes: 2 additions & 2 deletions backends/source/dppl_sycl_platform_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <iostream>
#include <set>
#include <sstream>
#include "../details/include/dppl_utils_details.h"
#include "../helper/include/dppl_utils_helper.h"

#include <CL/sycl.hpp>

Expand Down Expand Up @@ -125,7 +125,7 @@ void DPPLPlatform_DumpInfo ()
<< "Device type";

auto devTy = devices[dn].get_info<info::device::device_type>();
ss << DDPL_StrToDeviceType(devTy);
ss << DPPL_DeviceTypeToStr(devTy);
}
std::cout << ss.str();
++i;
Expand Down