close
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
518fd6a
Implement tensor.isin
ndgrigorian Jun 6, 2025
85106f4
factor common utilities for scalar arguments to a new file
ndgrigorian Jun 8, 2025
ce757c8
Make constexpr variables in `isin` static
ndgrigorian Jun 11, 2025
8425cdc
Update implementation of `isin`
ndgrigorian Jun 11, 2025
204025a
Update per review comments
ndgrigorian Jun 16, 2025
cfb5154
Allow x to be a scalar in isin and remove assume_unique
ndgrigorian Jun 16, 2025
a448725
Make comparator static constexpr
ndgrigorian Jun 16, 2025
882a431
add basic tests for isin functionality
ndgrigorian Jun 17, 2025
d11626c
Remove unused import of dpctl in _set_functions.py
ndgrigorian Jun 17, 2025
710a6d0
Add type hints to isin
ndgrigorian Jun 17, 2025
411b976
Add usm_type to test_buf in isin
ndgrigorian Jun 18, 2025
3077bd6
Address review comments for isin tests
ndgrigorian Jun 18, 2025
ed9f376
Add test covering nans and +/- 0 in isin
ndgrigorian Jun 18, 2025
72278b5
Add test for isin with Python scalar args
ndgrigorian Jun 23, 2025
5b877c8
Add test for combinations of dtypes as inputs to isin
ndgrigorian Jun 23, 2025
538176c
Add compute follows data test for isin
ndgrigorian Jun 23, 2025
0cd24f5
Add isin to rendered docs
ndgrigorian Jun 23, 2025
0070331
Test that isin output is C-contiguous when input is strided
ndgrigorian Jun 23, 2025
2ebb3a1
improve formatting of isin docstring
ndgrigorian Jun 26, 2025
26f68d2
move rich_comparisons.hpp into utils
ndgrigorian Sep 11, 2025
365c3b4
factor out compare template param in isin
ndgrigorian Sep 11, 2025
44661ba
add missing includes to rich_comparisons
ndgrigorian Sep 17, 2025
62a9fa4
drop unused includes in isin kernel implementation
ndgrigorian Sep 17, 2025
ff68bca
validate that `invert` kwarg is boolean
ndgrigorian Sep 17, 2025
e28e1aa
add a test for input validation of invert
ndgrigorian Sep 17, 2025
68bc84e
make invert bool type check stricter
ndgrigorian Sep 17, 2025
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
Prev Previous commit
Next Next commit
Make constexpr variables in isin static
  • Loading branch information
ndgrigorian committed Sep 17, 2025
commit ce757c8254a8eb1154e6001d90f3accf920eaa1d
6 changes: 3 additions & 3 deletions dpctl/tensor/libtensor/include/kernels/sorting/isin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ sycl::event isin_contig_impl(sycl::queue &exec_q,

using TrivialIndexerT = dpctl::tensor::offset_utils::NoOpIndexer;

constexpr TrivialIndexerT hay_indexer{};
constexpr TrivialIndexerT needles_indexer{};
constexpr TrivialIndexerT out_indexer{};
static constexpr TrivialIndexerT hay_indexer{};
static constexpr TrivialIndexerT needles_indexer{};
static constexpr TrivialIndexerT out_indexer{};

const auto fnctr =
IsinFunctor<T, TrivialIndexerT, TrivialIndexerT, TrivialIndexerT,
Expand Down
4 changes: 2 additions & 2 deletions dpctl/tensor/libtensor/source/sorting/isin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ py_isin(const dpctl::tensor::usm_ndarray &needles,
if (all_c_contig || all_f_contig) {
auto fn = detail::isin_contig_impl_dispatch_vector[hay_typeid];

constexpr py::ssize_t zero_offset(0);
static constexpr py::ssize_t zero_offset(0);

sycl::event comp_ev = fn(exec_q, invert, hay_nelems, needles_nelems,
hay_data, zero_offset, needles_data,
Expand Down Expand Up @@ -287,7 +287,7 @@ py_isin(const dpctl::tensor::usm_ndarray &needles,
"No implementation for data types of input arrays");
}

constexpr py::ssize_t zero_offset(0);
static constexpr py::ssize_t zero_offset(0);
py::ssize_t hay_step = hay.get_strides_vector()[0];

const sycl::event &comp_ev = strided_fn(
Expand Down