Skip to content

[SYCL] create PI (Plugin Interface) layer and redirect there platform/device stuff. #222

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 3 commits into from
Jul 1, 2019
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
7 changes: 4 additions & 3 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ set(LLVM_TOOLS_DIR "${LLVM_BINARY_DIR}/bin/")
add_library("${SYCLLibrary}" SHARED
"${includeRootPath}/CL/sycl.hpp"
"${sourceRootPath}/detail/builtins.cpp"
"${sourceRootPath}/detail/cnri.cpp"
"${sourceRootPath}/detail/pi.cpp"
"${sourceRootPath}/detail/pi_opencl.cpp"
"${sourceRootPath}/detail/common.cpp"
"${sourceRootPath}/detail/context_impl.cpp"
"${sourceRootPath}/detail/device_impl.cpp"
"${sourceRootPath}/detail/device_info.cpp"
"${sourceRootPath}/detail/event_impl.cpp"
"${sourceRootPath}/detail/force_device.cpp"
Expand All @@ -134,8 +136,7 @@ add_library("${SYCLLibrary}" SHARED
"${sourceRootPath}/detail/kernel_impl.cpp"
"${sourceRootPath}/detail/kernel_info.cpp"
"${sourceRootPath}/detail/memory_manager.cpp"
"${sourceRootPath}/detail/platform_host.cpp"
"${sourceRootPath}/detail/platform_opencl.cpp"
"${sourceRootPath}/detail/platform_impl.cpp"
"${sourceRootPath}/detail/platform_info.cpp"
"${sourceRootPath}/detail/program_impl.cpp"
"${sourceRootPath}/detail/program_manager/program_manager.cpp"
Expand Down
2 changes: 1 addition & 1 deletion sycl/include/CL/sycl/detail/aligned_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once

#include <CL/cl.h>
#include <CL/sycl/detail/cnri.h>
#include <CL/sycl/detail/common.hpp>
#include <CL/sycl/detail/os_util.hpp>
#include <CL/sycl/range.hpp>

Expand Down
120 changes: 0 additions & 120 deletions sycl/include/CL/sycl/detail/cnri.h

This file was deleted.

25 changes: 24 additions & 1 deletion sycl/include/CL/sycl/detail/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,22 @@
#include <CL/cl_ext.h>
#include <CL/cl_ext_intel.h>
#include <string>

#include <type_traits>

// Select underlying runtime interface in compile-time (OpenCL or PI).
// Comment the define of the FORCE_SYCL_BE_OPENCL below to switch to PI.
// As such only one path (OpenCL today) is being regularily tested.
//
// TODO: we can just remove this when switch to PI completely.
//
#define FORCE_SYCL_BE_OPENCL

#ifdef FORCE_SYCL_BE_OPENCL
#include <CL/sycl/detail/pi_opencl.hpp>
#else
#include <CL/sycl/detail/pi.hpp>
#endif

const char *stringifyErrorCode(cl_int error);

#define OCL_CODE_TO_STR(code) \
Expand Down Expand Up @@ -78,6 +91,16 @@ const char *stringifyErrorCode(cl_int error);
namespace cl {
namespace sycl {
namespace detail {

// Select underlying runtime interface (RT) in compile-time (OpenCL or PI).
// As such only one path (OpenCL today) is being regularily tested.
//
#ifdef FORCE_SYCL_BE_OPENCL
using RT = cl::sycl::detail::opencl;
#else
using RT = cl::sycl::detail::pi;
#endif

// Helper function for extracting implementation from SYCL's interface objects.
// Note! This function relies on the fact that all SYCL interface classes
// contain "impl" field that points to implementation object. "impl" field
Expand Down
68 changes: 0 additions & 68 deletions sycl/include/CL/sycl/detail/device_host.hpp

This file was deleted.

Loading