Skip to content
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: 6 additions & 1 deletion sycl/include/sycl/info/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ using context_traits =
using context_runtime_traits =
sycl::detail::rt_traits_base<sycl::detail::info_class::context>;

struct reference_count : context_traits<UR_CONTEXT_INFO_REFERENCE_COUNT> {
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#include <sycl/detail/defines_elementary.hpp>
struct __SYCL_DEPRECATED("info::context::reference_count is not part of "
"SYCL 2020") reference_count
: context_traits<UR_CONTEXT_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
struct platform : context_runtime_traits {
using return_type = sycl::platform;
};
Expand Down
6 changes: 5 additions & 1 deletion sycl/include/sycl/info/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,13 @@ struct __SYCL_DEPRECATED("use sycl::aspect::atomic64 instead") atomic64
};
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

struct reference_count : device_traits<UR_DEVICE_INFO_REFERENCE_COUNT> {
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
struct __SYCL_DEPRECATED("info::device::reference_count is not part of "
"SYCL 2020") reference_count
: device_traits<UR_DEVICE_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
// To be dropped (has alternatives/not needed)
struct usm_device_allocations
: device_traits<UR_DEVICE_INFO_USM_DEVICE_SUPPORT> {
Expand Down
7 changes: 6 additions & 1 deletion sycl/include/sycl/info/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ struct command_execution_status
: event_traits<UR_EVENT_INFO_COMMAND_EXECUTION_STATUS> {
using return_type = info::event_command_status;
};
struct reference_count : event_traits<UR_EVENT_INFO_REFERENCE_COUNT> {
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#include <sycl/detail/defines_elementary.hpp>
struct __SYCL_DEPRECATED("info::event::reference_count is not part of "
"SYCL 2020") reference_count
: event_traits<UR_EVENT_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
Comment on lines +41 to 45
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
} // namespace event
namespace event_profiling {
template <ur_profiling_info_t UrCode>
Expand Down
7 changes: 6 additions & 1 deletion sycl/include/sycl/info/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ struct attributes : kernel_traits<UR_KERNEL_INFO_ATTRIBUTES> {
struct function_name : kernel_traits<UR_KERNEL_INFO_FUNCTION_NAME> {
using return_type = std::string;
};
struct reference_count : kernel_traits<UR_KERNEL_INFO_REFERENCE_COUNT> {
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#include <sycl/detail/defines_elementary.hpp>
struct __SYCL_DEPRECATED("info::kernel::reference_count is not part of "
"SYCL 2020") reference_count
: kernel_traits<UR_KERNEL_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
Comment on lines +43 to 47
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
struct context : kernel_traits<UR_KERNEL_INFO_CONTEXT> {
using return_type = sycl::context;
};
Expand Down
7 changes: 6 additions & 1 deletion sycl/include/sycl/info/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ struct context : queue_traits<UR_QUEUE_INFO_CONTEXT> {
struct device : queue_traits<UR_QUEUE_INFO_DEVICE> {
using return_type = sycl::device;
};
struct reference_count : queue_traits<UR_QUEUE_INFO_REFERENCE_COUNT> {
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#include <sycl/detail/defines_elementary.hpp>
struct __SYCL_DEPRECATED("info::queue::reference_count is not part of "
"SYCL 2020") reference_count
: queue_traits<UR_QUEUE_INFO_REFERENCE_COUNT> {
using return_type = uint32_t;
};
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
} // namespace queue
} // namespace info

Expand Down
2 changes: 2 additions & 0 deletions sycl/source/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ context::get_info() const {
#define __SYCL_CONTEXT_INFO_INST(NAME, RETURN_T) \
template __SYCL_EXPORT RETURN_T context::get_info<info::context::NAME>() \
const;
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_CONTEXT_INFO_INST(reference_count, uint32_t)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_CONTEXT_INFO_INST(platform, sycl::platform)
__SYCL_CONTEXT_INFO_INST(devices, std::vector<sycl::device>)
__SYCL_CONTEXT_INFO_INST(atomic_memory_order_capabilities,
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ const async_handler &context_impl::get_async_handler() const {
return MAsyncHandler;
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
template <>
uint32_t context_impl::get_info<info::context::reference_count>() const {
return get_context_info<info::context::reference_count>(this->getHandleRef(),
this->getAdapter());
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
template <> platform context_impl::get_info<info::context::platform>() const {
return createSyclObjFromImpl<platform>(MPlatform);
}
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/event_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ uint64_t event_impl::get_profiling_info<info::event_profiling::command_end>() {
return MHostProfilingInfo->getEndTime();
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
template <> uint32_t event_impl::get_info<info::event::reference_count>() {
auto Handle = this->getHandle();
if (!MIsHostEvent && Handle) {
Expand All @@ -410,6 +411,7 @@ template <> uint32_t event_impl::get_info<info::event::reference_count>() {
}
return 0;
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

template <>
info::event_command_status
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ getUrEvents(const std::vector<sycl::event> &DepEvents) {
return RetUrEvents;
}

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
template <>
uint32_t queue_impl::get_info<info::queue::reference_count>() const {
ur_result_t result = UR_RESULT_SUCCESS;
getAdapter().call<UrApiKind::urQueueGetInfo>(
MQueue, UR_QUEUE_INFO_REFERENCE_COUNT, sizeof(result), &result, nullptr);
return result;
Comment on lines 68 to 71
}
#endif // __INTEL_PREVIEW_BREAKING_CHANGES

template <> context queue_impl::get_info<info::queue::context>() const {
return get_context();
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ __SYCL_DEVICE_INFO_INST(partition_type_affinity_domain,
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_DEVICE_INFO_INST(atomic64, bool)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_DEVICE_INFO_INST(reference_count, uint32_t)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_DEVICE_INFO_INST(usm_device_allocations, bool)
__SYCL_DEVICE_INFO_INST(usm_host_allocations, bool)
__SYCL_DEVICE_INFO_INST(usm_shared_allocations, bool)
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ event::get_profiling_info() const {
#define __SYCL_EVENT_INFO_INST(NAME, RETURN_T) \
template __SYCL_EXPORT RETURN_T event::get_info<info::event::NAME>() const;
__SYCL_EVENT_INFO_INST(command_execution_status, info::event_command_status)
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_EVENT_INFO_INST(reference_count, uint32_t)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
#undef __SYCL_EVENT_INFO_INST

#define __SYCL_EVENT_PROFILING_INFO_INST(NAME, RETURN_T) \
Expand Down
2 changes: 2 additions & 0 deletions sycl/source/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ kernel::get_info_impl() const {
__SYCL_KERNEL_INFO_INST(num_args, uint32_t)
__SYCL_KERNEL_INFO_INST(attributes, std::string)
__SYCL_KERNEL_INFO_INST(function_name, std::string)
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_KERNEL_INFO_INST(reference_count, uint32_t)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_KERNEL_INFO_INST(context, sycl::context)
#undef __SYCL_KERNEL_INFO_INST

Expand Down
2 changes: 2 additions & 0 deletions sycl/source/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ queue::get_info() const {
template __SYCL_EXPORT RETURN_T queue::get_info<info::queue::NAME>() const;
__SYCL_QUEUE_INFO_INST(context, sycl::context)
__SYCL_QUEUE_INFO_INST(device, sycl::device)
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_QUEUE_INFO_INST(reference_count, uint32_t)
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
#undef __SYCL_QUEUE_INFO_INST

template <typename Param>
Expand Down
2 changes: 0 additions & 2 deletions sycl/test-e2e/Basic/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,6 @@ int main() {
print_info<info::device::partition_type_affinity_domain,
info::partition_affinity_domain>(dev,
"Partition type affinity domain");
print_info<info::device::reference_count, sycl::opencl::cl_uint>(
Comment thread
KornevNikita marked this conversation as resolved.
dev, "Reference count");

std::cout << separator << "Platform information\n" << separator;
platform plt(dev.get_platform());
Expand Down
7 changes: 0 additions & 7 deletions sycl/test-e2e/Basic/kernel_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,11 @@ int main() {

const context krnCtx = krn.get_info<info::kernel::context>();
assert(krnCtx == q.get_context());
const cl_uint krnRefCount = krn.get_info<info::kernel::reference_count>();
assert(krnRefCount > 0);

// Use ext_oneapi_get_kernel_info extension and check that answers match.
const context krnCtxExt =
syclex::get_kernel_info<SingleTask, info::kernel::context>(ctx);
assert(krnCtxExt == krnCtx);
// Reference count might be different because we have to retain the kernel
// handle first to fetch the info. So just check that it is not 0.
const cl_uint krnRefCountExt =
syclex::get_kernel_info<SingleTask, info::kernel::reference_count>(ctx);
assert(krnRefCountExt > 0);

device dev = q.get_device();
const size_t wgSize =
Expand Down
1 change: 0 additions & 1 deletion sycl/test-e2e/Regression/dummy_event_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ int main() {

assert(e.get_info<info::event::command_execution_status>() ==
info::event_command_status::complete);
assert(e.get_info<info::event::reference_count>() == 0);
auto submit_time =
e.get_profiling_info<sycl::info::event_profiling::command_submit>();
auto start_time =
Expand Down
11 changes: 11 additions & 0 deletions sycl/test/warnings/sycl_2020_deprecations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,17 @@ int main() {
// expected-warning@+1{{'extensions' is deprecated: deprecated in SYCL 2020, use device::get_info() with info::device::aspects instead}}
using PE = sycl::info::platform::extensions;

// expected-warning@+1{{'reference_count' is deprecated: info::context::reference_count is not part of SYCL 2020}}
using CRC = sycl::info::context::reference_count;
// expected-warning@+1{{'reference_count' is deprecated: info::device::reference_count is not part of SYCL 2020}}
using DRC = sycl::info::device::reference_count;
// expected-warning@+1{{'reference_count' is deprecated: info::event::reference_count is not part of SYCL 2020}}
using ERC = sycl::info::event::reference_count;
// expected-warning@+1{{'reference_count' is deprecated: info::kernel::reference_count is not part of SYCL 2020}}
using KRC = sycl::info::kernel::reference_count;
// expected-warning@+1{{'reference_count' is deprecated: info::queue::reference_count is not part of SYCL 2020}}
using QRC = sycl::info::queue::reference_count;

// expected-error@+1{{no member named 'INTEL' in namespace 'sycl'}}
auto SL = sycl::INTEL::source_language::opencl_c;
(void)SL;
Expand Down
Loading