Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 9a4832b

Browse files
Pass sycl::queue by reference to avoid needless copy
The copy operation would involved atomics and might get expensive.
1 parent 6a2760d commit 9a4832b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

common_ext/cy_kde.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ from dpctl.sycl cimport unwrap_queue
2424

2525
cdef extern from "kde.hpp" namespace "example":
2626
void kernel_density_estimate[T](
27-
dpcpp_queue, # execution queue
27+
dpcpp_queue &, # execution queue
2828
uint16_t, # datadimensionality
2929
const T *, # evaluation points
3030
T *, # output for kde values

common_ext/py_kde.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace py = pybind11;
2828
template <typename T>
2929
py::array_t<T>
3030
py_kde_eval_t(
31-
sycl::queue q,
31+
sycl::queue &q,
3232
py::array_t<T, py::array::c_style|py::array::forcecast> x,
3333
py::array_t<T, py::array::c_style|py::array::forcecast> data,
3434
T h)
@@ -72,7 +72,7 @@ py_kde_eval_t(
7272

7373
py::array
7474
py_kde_eval(
75-
sycl::queue exec_q,
75+
sycl::queue &exec_q,
7676
py::array x,
7777
py::array data,
7878
py::object h)

common_src/kde.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#pragma once
1616

17-
#include <CL/sycl.hpp>
17+
#include <sycl/sycl.hpp>
1818
#include <cstdint>
1919
#include <iostream>
2020

@@ -51,7 +51,7 @@ T1 upper_quotient_of(T1 n, T2 wg) {
5151
template <typename T>
5252
void
5353
kernel_density_estimate(
54-
sycl::queue q,
54+
sycl::queue &q,
5555
std::uint16_t dim, // dimensionality of the data
5656
const T* x, // points at which KDE is evaluated
5757
T *f, // where values of kde(x, h) are written to

0 commit comments

Comments
 (0)