Skip to content

Commit f34578d

Browse files
create_property_list has a gap in logic.
When property has DPCTL_ENABLE_PROFILING bit set, but does not have DPCTL_IN_ORDER bit, the test (property & (DPCTL_ENABLE_PROFILING | DPCTL_IN_ORDER)) is true, and the propertly list includes both properties, but should only have one.
1 parent e7befdf commit f34578d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

dpctl-capi/source/dpctl_sycl_queue_interface.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ bool set_kernel_arg(handler &cgh,
119119
std::unique_ptr<property_list> create_property_list(int properties)
120120
{
121121
std::unique_ptr<property_list> propList;
122-
if (properties & (DPCTL_ENABLE_PROFILING | DPCTL_IN_ORDER)) {
123-
propList = std::make_unique<property_list>(
124-
sycl::property::queue::enable_profiling(),
125-
sycl::property::queue::in_order());
126-
}
127-
else if (properties & DPCTL_ENABLE_PROFILING) {
128-
propList = std::make_unique<property_list>(
129-
sycl::property::queue::enable_profiling());
122+
if (properties & DPCTL_ENABLE_PROFILING) {
123+
if (properties & DPCTL_IN_ORDER) {
124+
propList = std::make_unique<property_list>(
125+
sycl::property::queue::enable_profiling(),
126+
sycl::property::queue::in_order());
127+
}
128+
else {
129+
propList = std::make_unique<property_list>(
130+
sycl::property::queue::enable_profiling());
131+
}
130132
}
131133
else if (properties & DPCTL_IN_ORDER) {
132134
propList =

0 commit comments

Comments
 (0)