This repository was archived by the owner on Sep 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 15 files changed +201
-4
lines changed
Expand file tree Collapse file tree 15 files changed +201
-4
lines changed Original file line number Diff line number Diff line change 1+
2+ Common files implementing Python native extension reused via symbolic links
3+ by ` kde_setuptools ` and ` kde_skbuild ` examples of build data-parallel Python native
4+ extensions with oneAPI DPC++.
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Intel Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115# distutils: language = c++
216# cython: language_level=3
317
Original file line number Diff line number Diff line change 1+ // Copyright 2022 Intel Corporation
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ // File implementing pybind11-driven native Python extension exposing
16+ // data-parallel function to compute Kernel Density Estimation using oneAPI
17+
118#include < CL/sycl.hpp>
219#include < cstdint>
320#include < limits>
@@ -24,10 +41,13 @@ py_kde_eval_t(
2441 }
2542
2643 auto dim = x_pybuf.shape [1 ];
27- constexpr auto dim_max = static_cast <decltype (dim)>(std::numeric_limits<std::uint16_t >::max ());
44+ constexpr auto dim_max = static_cast <decltype (dim)>(
45+ std::numeric_limits<std::uint16_t >::max ());
2846
2947 if (dim != data_pybuf.shape [1 ] || dim > dim_max) {
30- throw py::value_error (" Inputs have inconsistent functionality or too large a width" );
48+ throw py::value_error (
49+ " Inputs have inconsistent functionality or too large a width"
50+ );
3151 }
3252
3353 auto n = x_pybuf.shape [0 ];
Original file line number Diff line number Diff line change 1+ // Copyright 2022 Intel Corporation
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ #pragma once
16+
117#include < CL/sycl.hpp>
218#include < cstdint>
319
Original file line number Diff line number Diff line change 1+ // Copyright 2022 Intel Corporation
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ // WARNING:
16+ // This file is a work in progress, it is currently unused
17+
118#include < CL/sycl.hpp>
219#include < limits>
320#include " kmeans.hpp"
Original file line number Diff line number Diff line change 1+ // Copyright 2022 Intel Corporation
2+ //
3+ // Licensed under the Apache License, Version 2.0 (the "License");
4+ // you may not use this file except in compliance with the License.
5+ // You may obtain a copy of the License at
6+ //
7+ // http://www.apache.org/licenses/LICENSE-2.0
8+ //
9+ // Unless required by applicable law or agreed to in writing, software
10+ // distributed under the License is distributed on an "AS IS" BASIS,
11+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ // See the License for the specific language governing permissions and
13+ // limitations under the License.
14+
15+ // This is auxiliary file used to test kde.hpp
16+
117#include < CL/sycl.hpp>
218#include < random>
319#include " kde.hpp"
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Intel Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115from ._cython_kde import kde_eval as cython_kde_eval
216from ._pybind11_kde import kde_eval as pybind11_kde_eval
317
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Intel Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115from setuptools import setup , Extension
216from pybind11 .setup_helpers import Pybind11Extension
317import dpctl
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Intel Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115import numpy as np
216import dpctl
317
Original file line number Diff line number Diff line change 1+ # Copyright 2022 Intel Corporation
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
115import numpy as np
216import dpctl
317
You can’t perform that action at this time.
0 commit comments