Skip to content

[SYCL] Remove dependency on event_impl from cg.hpp #1103

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
Feb 10, 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
1 change: 0 additions & 1 deletion sycl/include/CL/sycl/detail/accessor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#pragma once

#include <CL/sycl/access/access.hpp>
#include <CL/sycl/detail/event_impl.hpp>
#include <CL/sycl/detail/sycl_mem_obj_i.hpp>
#include <CL/sycl/id.hpp>
#include <CL/sycl/range.hpp>
Expand Down
1 change: 1 addition & 0 deletions sycl/include/CL/sycl/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <CL/sycl/detail/accessor_impl.hpp>
#include <CL/sycl/detail/common.hpp>
#include <CL/sycl/detail/helpers.hpp>
#include <CL/sycl/detail/host_profiling_info.hpp>
#include <CL/sycl/detail/kernel_desc.hpp>
#include <CL/sycl/detail/type_traits.hpp>
#include <CL/sycl/group.hpp>
Expand Down
22 changes: 1 addition & 21 deletions sycl/include/CL/sycl/detail/event_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <CL/sycl/detail/event_info.hpp>
#include <CL/sycl/detail/pi.hpp>
#include <CL/sycl/stl.hpp>
#include <CL/sycl/detail/host_profiling_info.hpp>

#include <cassert>

Expand All @@ -24,27 +25,6 @@ using ContextImplPtr = std::shared_ptr<cl::sycl::detail::context_impl>;
class queue_impl;
using QueueImplPtr = std::shared_ptr<cl::sycl::detail::queue_impl>;

/// Profiling info for the host execution.
class HostProfilingInfo {
cl_ulong StartTime = 0;
cl_ulong EndTime = 0;

public:
/// Returns event's start time.
///
/// @return event's start time in nanoseconds.
cl_ulong getStartTime() const { return StartTime; }
/// Returns event's end time.
///
/// @return event's end time in nanoseconds.
cl_ulong getEndTime() const { return EndTime; }

/// Measures event's start time.
void start();
/// Measures event's end time.
void end();
};

class event_impl {
public:
/// Constructs a ready SYCL event.
Expand Down
39 changes: 39 additions & 0 deletions sycl/include/CL/sycl/detail/host_profiling_info.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//==---------- host_profiling_info.hpp - SYCL host profiling ---------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#pragma once

#include <CL/sycl/detail/common.hpp>

__SYCL_INLINE namespace cl {
namespace sycl {
namespace detail {

/// Profiling info for the host execution.
class HostProfilingInfo {
cl_ulong StartTime = 0;
cl_ulong EndTime = 0;

public:
/// Returns event's start time.
///
/// @return event's start time in nanoseconds.
cl_ulong getStartTime() const { return StartTime; }
/// Returns event's end time.
///
/// @return event's end time in nanoseconds.
cl_ulong getEndTime() const { return EndTime; }

/// Measures event's start time.
void start();
/// Measures event's end time.
void end();
};
} // namespace detail
} // namespace sycl
} // namespace cl
1 change: 1 addition & 0 deletions sycl/source/detail/sycl_mem_obj_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <CL/sycl/detail/scheduler/scheduler.hpp>
#include <CL/sycl/detail/sycl_mem_obj_t.hpp>
#include <CL/sycl/detail/context_impl.hpp>
#include <CL/sycl/detail/event_impl.hpp>

__SYCL_INLINE namespace cl {
namespace sycl {
Expand Down