Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/assign_value.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/extrema.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/inner_product.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/memory.inl +60 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/mismatch.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/par.h +62 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/reduce_by_key.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/remove.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/replace.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan_by_key.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scatter.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/sort.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_reduce.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_scan.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/pointer.h +119 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/detail/sequential/find.h +68 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/adjacent_difference.h +54 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/assign_value.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/binary_search.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.h +50 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.inl +118 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy_if.h +47 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/count.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/equal.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/execution_policy.h +92 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/extrema.h +66 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/fill.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.h +51 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.inl +91 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/gather.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/generate.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/get_value.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/inner_product.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/logical.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/malloc_and_free.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/memory.inl +94 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.h +77 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.inl +323 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/mismatch.h +30 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/par.h +62 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.h +84 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.inl +98 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/per_device_resource.h +29 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.h +54 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.inl +137 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_by_key.h +61 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_intervals.h +140 -0
- vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.h +76 -0
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/assign_value.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits assign_value
|
| 30 |
+
#include <thrust/system/detail/sequential/assign_value.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/extrema.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits extrema algorithms
|
| 30 |
+
#include <thrust/system/detail/sequential/extrema.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/inner_product.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/memory.inl
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/cpp/detail/malloc_and_free.h>
|
| 29 |
+
#include <thrust/system/cpp/memory.h>
|
| 30 |
+
|
| 31 |
+
#include <limits>
|
| 32 |
+
|
| 33 |
+
THRUST_NAMESPACE_BEGIN
|
| 34 |
+
namespace system
|
| 35 |
+
{
|
| 36 |
+
namespace cpp
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
pointer<void> malloc(std::size_t n)
|
| 40 |
+
{
|
| 41 |
+
tag t;
|
| 42 |
+
return pointer<void>(thrust::system::detail::sequential::malloc(t, n));
|
| 43 |
+
} // end malloc()
|
| 44 |
+
|
| 45 |
+
template <typename T>
|
| 46 |
+
pointer<T> malloc(std::size_t n)
|
| 47 |
+
{
|
| 48 |
+
pointer<void> raw_ptr = thrust::system::cpp::malloc(sizeof(T) * n);
|
| 49 |
+
return pointer<T>(reinterpret_cast<T*>(raw_ptr.get()));
|
| 50 |
+
} // end malloc()
|
| 51 |
+
|
| 52 |
+
void free(pointer<void> ptr)
|
| 53 |
+
{
|
| 54 |
+
tag t;
|
| 55 |
+
return thrust::system::detail::sequential::free(t, ptr);
|
| 56 |
+
} // end free()
|
| 57 |
+
|
| 58 |
+
} // namespace cpp
|
| 59 |
+
} // namespace system
|
| 60 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/mismatch.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/par.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator_aware_execution_policy.h>
|
| 29 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace cpp
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
struct par_t
|
| 40 |
+
: thrust::system::cpp::detail::execution_policy<par_t>
|
| 41 |
+
, thrust::detail::allocator_aware_execution_policy<thrust::system::cpp::detail::execution_policy>
|
| 42 |
+
{
|
| 43 |
+
_CCCL_HOST_DEVICE constexpr par_t()
|
| 44 |
+
: thrust::system::cpp::detail::execution_policy<par_t>()
|
| 45 |
+
{}
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
} // namespace detail
|
| 49 |
+
|
| 50 |
+
_CCCL_GLOBAL_CONSTANT detail::par_t par;
|
| 51 |
+
|
| 52 |
+
} // namespace cpp
|
| 53 |
+
} // namespace system
|
| 54 |
+
|
| 55 |
+
// alias par here
|
| 56 |
+
namespace cpp
|
| 57 |
+
{
|
| 58 |
+
|
| 59 |
+
using thrust::system::cpp::par;
|
| 60 |
+
|
| 61 |
+
} // namespace cpp
|
| 62 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/reduce_by_key.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits reduce_by_key
|
| 30 |
+
#include <thrust/system/detail/sequential/reduce_by_key.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/remove.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits remove
|
| 30 |
+
#include <thrust/system/detail/sequential/remove.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/replace.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits scan
|
| 30 |
+
#include <thrust/system/detail/sequential/scan.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan_by_key.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits the scan_by_key algorithms
|
| 30 |
+
#include <thrust/system/detail/sequential/scan_by_key.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scatter.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/sort.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits sort
|
| 30 |
+
#include <thrust/system/detail/sequential/sort.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// cpp has no special transform
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_reduce.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_scan.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special version of this algorithm
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/pointer.h
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2020 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
//! \file
|
| 18 |
+
//! Managing memory associated with Thrust's TBB system.
|
| 19 |
+
|
| 20 |
+
#pragma once
|
| 21 |
+
|
| 22 |
+
#include <thrust/detail/config.h>
|
| 23 |
+
|
| 24 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 25 |
+
# pragma GCC system_header
|
| 26 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 27 |
+
# pragma clang system_header
|
| 28 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 29 |
+
# pragma system_header
|
| 30 |
+
#endif // no system header
|
| 31 |
+
#include <thrust/detail/pointer.h>
|
| 32 |
+
#include <thrust/detail/reference.h>
|
| 33 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 34 |
+
|
| 35 |
+
#include <type_traits>
|
| 36 |
+
|
| 37 |
+
THRUST_NAMESPACE_BEGIN
|
| 38 |
+
namespace system
|
| 39 |
+
{
|
| 40 |
+
namespace cpp
|
| 41 |
+
{
|
| 42 |
+
|
| 43 |
+
/*! \p cpp::pointer stores a pointer to an object allocated in memory accessible
|
| 44 |
+
* by the \p cpp system. This type provides type safety when dispatching
|
| 45 |
+
* algorithms on ranges resident in \p cpp memory.
|
| 46 |
+
*
|
| 47 |
+
* \p cpp::pointer has pointer semantics: it may be dereferenced and
|
| 48 |
+
* manipulated with pointer arithmetic.
|
| 49 |
+
*
|
| 50 |
+
* \p cpp::pointer can be created with the function \p cpp::malloc, or by
|
| 51 |
+
* explicitly calling its constructor with a raw pointer.
|
| 52 |
+
*
|
| 53 |
+
* The raw pointer encapsulated by a \p cpp::pointer may be obtained by either its
|
| 54 |
+
* <tt>get</tt> member function or the \p raw_pointer_cast function.
|
| 55 |
+
*
|
| 56 |
+
* \note \p cpp::pointer is not a "smart" pointer; it is the programmer's
|
| 57 |
+
* responsibility to deallocate memory pointed to by \p cpp::pointer.
|
| 58 |
+
*
|
| 59 |
+
* \tparam T specifies the type of the pointee.
|
| 60 |
+
*
|
| 61 |
+
* \see cpp::malloc
|
| 62 |
+
* \see cpp::free
|
| 63 |
+
* \see raw_pointer_cast
|
| 64 |
+
*/
|
| 65 |
+
template <typename T>
|
| 66 |
+
using pointer = thrust::pointer<T, thrust::system::cpp::tag, thrust::tagged_reference<T, thrust::system::cpp::tag>>;
|
| 67 |
+
|
| 68 |
+
/*! \p cpp::universal_pointer stores a pointer to an object allocated in memory
|
| 69 |
+
* accessible by the \p cpp system and host systems.
|
| 70 |
+
*
|
| 71 |
+
* \p cpp::universal_pointer has pointer semantics: it may be dereferenced and
|
| 72 |
+
* manipulated with pointer arithmetic.
|
| 73 |
+
*
|
| 74 |
+
* \p cpp::universal_pointer can be created with \p cpp::universal_allocator
|
| 75 |
+
* or by explicitly calling its constructor with a raw pointer.
|
| 76 |
+
*
|
| 77 |
+
* The raw pointer encapsulated by a \p cpp::universal_pointer may be obtained
|
| 78 |
+
* by either its <tt>get</tt> member function or the \p raw_pointer_cast
|
| 79 |
+
* function.
|
| 80 |
+
*
|
| 81 |
+
* \note \p cpp::universal_pointer is not a "smart" pointer; it is the
|
| 82 |
+
* programmer's responsibility to deallocate memory pointed to by
|
| 83 |
+
* \p cpp::universal_pointer.
|
| 84 |
+
*
|
| 85 |
+
* \tparam T specifies the type of the pointee.
|
| 86 |
+
*
|
| 87 |
+
* \see cpp::universal_allocator
|
| 88 |
+
* \see raw_pointer_cast
|
| 89 |
+
*/
|
| 90 |
+
template <typename T>
|
| 91 |
+
using universal_pointer = thrust::pointer<T, thrust::system::cpp::tag, typename std::add_lvalue_reference<T>::type>;
|
| 92 |
+
|
| 93 |
+
/*! \p reference is a wrapped reference to an object stored in memory available
|
| 94 |
+
* to the \p cpp system. \p reference is the type of the result of
|
| 95 |
+
* dereferencing a \p cpp::pointer.
|
| 96 |
+
*
|
| 97 |
+
* \tparam T Specifies the type of the referenced object.
|
| 98 |
+
*/
|
| 99 |
+
template <typename T>
|
| 100 |
+
using reference = thrust::reference<T, thrust::system::cpp::tag>;
|
| 101 |
+
|
| 102 |
+
} // namespace cpp
|
| 103 |
+
} // namespace system
|
| 104 |
+
|
| 105 |
+
/*! \addtogroup system_backends Systems
|
| 106 |
+
* \ingroup system
|
| 107 |
+
* \{
|
| 108 |
+
*/
|
| 109 |
+
|
| 110 |
+
/*! \namespace thrust::cpp
|
| 111 |
+
* \brief \p thrust::cpp is a top-level alias for \p thrust::system::cpp. */
|
| 112 |
+
namespace cpp
|
| 113 |
+
{
|
| 114 |
+
using thrust::system::cpp::pointer;
|
| 115 |
+
using thrust::system::cpp::reference;
|
| 116 |
+
using thrust::system::cpp::universal_pointer;
|
| 117 |
+
} // namespace cpp
|
| 118 |
+
|
| 119 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/detail/sequential/find.h
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file find.h
|
| 18 |
+
* \brief Sequential implementation of find_if.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
#include <thrust/detail/config.h>
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
#include <thrust/detail/function.h>
|
| 33 |
+
#include <thrust/system/detail/sequential/execution_policy.h>
|
| 34 |
+
|
| 35 |
+
THRUST_NAMESPACE_BEGIN
|
| 36 |
+
namespace system
|
| 37 |
+
{
|
| 38 |
+
namespace detail
|
| 39 |
+
{
|
| 40 |
+
namespace sequential
|
| 41 |
+
{
|
| 42 |
+
|
| 43 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 44 |
+
template <typename DerivedPolicy, typename InputIterator, typename Predicate>
|
| 45 |
+
_CCCL_HOST_DEVICE InputIterator
|
| 46 |
+
find_if(execution_policy<DerivedPolicy>&, InputIterator first, InputIterator last, Predicate pred)
|
| 47 |
+
{
|
| 48 |
+
// wrap pred
|
| 49 |
+
thrust::detail::wrapped_function<Predicate, bool> wrapped_pred{pred};
|
| 50 |
+
|
| 51 |
+
while (first != last)
|
| 52 |
+
{
|
| 53 |
+
if (wrapped_pred(*first))
|
| 54 |
+
{
|
| 55 |
+
return first;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
++first;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
// return first so zip_iterator works correctly
|
| 62 |
+
return first;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
} // end namespace sequential
|
| 66 |
+
} // end namespace detail
|
| 67 |
+
} // end namespace system
|
| 68 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/adjacent_difference.h
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/detail/generic/adjacent_difference.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputIterator, typename BinaryFunction>
|
| 40 |
+
OutputIterator adjacent_difference(
|
| 41 |
+
execution_policy<DerivedPolicy>& exec,
|
| 42 |
+
InputIterator first,
|
| 43 |
+
InputIterator last,
|
| 44 |
+
OutputIterator result,
|
| 45 |
+
BinaryFunction binary_op)
|
| 46 |
+
{
|
| 47 |
+
// tbb prefers generic::adjacent_difference to cpp::adjacent_difference
|
| 48 |
+
return thrust::system::detail::generic::adjacent_difference(exec, first, last, result, binary_op);
|
| 49 |
+
} // end adjacent_difference()
|
| 50 |
+
|
| 51 |
+
} // namespace detail
|
| 52 |
+
} // namespace tbb
|
| 53 |
+
} // namespace system
|
| 54 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/assign_value.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits assign_value
|
| 30 |
+
#include <thrust/system/cpp/detail/assign_value.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/binary_search.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits binary_search
|
| 30 |
+
#include <thrust/system/cpp/detail/binary_search.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace tbb
|
| 34 |
+
{
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputIterator>
|
| 39 |
+
OutputIterator
|
| 40 |
+
copy(execution_policy<DerivedPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result);
|
| 41 |
+
|
| 42 |
+
template <typename DerivedPolicy, typename InputIterator, typename Size, typename OutputIterator>
|
| 43 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy>& exec, InputIterator first, Size n, OutputIterator result);
|
| 44 |
+
|
| 45 |
+
} // end namespace detail
|
| 46 |
+
} // end namespace tbb
|
| 47 |
+
} // end namespace system
|
| 48 |
+
THRUST_NAMESPACE_END
|
| 49 |
+
|
| 50 |
+
#include <thrust/system/tbb/detail/copy.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.inl
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/copy.h>
|
| 29 |
+
#include <thrust/detail/type_traits/minimum_type.h>
|
| 30 |
+
#include <thrust/system/detail/generic/copy.h>
|
| 31 |
+
#include <thrust/system/detail/sequential/copy.h>
|
| 32 |
+
#include <thrust/system/tbb/detail/copy.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace system
|
| 36 |
+
{
|
| 37 |
+
namespace tbb
|
| 38 |
+
{
|
| 39 |
+
namespace detail
|
| 40 |
+
{
|
| 41 |
+
namespace dispatch
|
| 42 |
+
{
|
| 43 |
+
|
| 44 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputIterator>
|
| 45 |
+
OutputIterator
|
| 46 |
+
copy(execution_policy<DerivedPolicy>& exec,
|
| 47 |
+
InputIterator first,
|
| 48 |
+
InputIterator last,
|
| 49 |
+
OutputIterator result,
|
| 50 |
+
thrust::incrementable_traversal_tag)
|
| 51 |
+
{
|
| 52 |
+
return thrust::system::detail::sequential::copy(exec, first, last, result);
|
| 53 |
+
} // end copy()
|
| 54 |
+
|
| 55 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputIterator>
|
| 56 |
+
OutputIterator
|
| 57 |
+
copy(execution_policy<DerivedPolicy>& exec,
|
| 58 |
+
InputIterator first,
|
| 59 |
+
InputIterator last,
|
| 60 |
+
OutputIterator result,
|
| 61 |
+
thrust::random_access_traversal_tag)
|
| 62 |
+
{
|
| 63 |
+
return thrust::system::detail::generic::copy(exec, first, last, result);
|
| 64 |
+
} // end copy()
|
| 65 |
+
|
| 66 |
+
template <typename DerivedPolicy, typename InputIterator, typename Size, typename OutputIterator>
|
| 67 |
+
OutputIterator
|
| 68 |
+
copy_n(execution_policy<DerivedPolicy>& exec,
|
| 69 |
+
InputIterator first,
|
| 70 |
+
Size n,
|
| 71 |
+
OutputIterator result,
|
| 72 |
+
thrust::incrementable_traversal_tag)
|
| 73 |
+
{
|
| 74 |
+
return thrust::system::detail::sequential::copy_n(exec, first, n, result);
|
| 75 |
+
} // end copy_n()
|
| 76 |
+
|
| 77 |
+
template <typename DerivedPolicy, typename InputIterator, typename Size, typename OutputIterator>
|
| 78 |
+
OutputIterator
|
| 79 |
+
copy_n(execution_policy<DerivedPolicy>& exec,
|
| 80 |
+
InputIterator first,
|
| 81 |
+
Size n,
|
| 82 |
+
OutputIterator result,
|
| 83 |
+
thrust::random_access_traversal_tag)
|
| 84 |
+
{
|
| 85 |
+
return thrust::system::detail::generic::copy_n(exec, first, n, result);
|
| 86 |
+
} // end copy_n()
|
| 87 |
+
|
| 88 |
+
} // namespace dispatch
|
| 89 |
+
|
| 90 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputIterator>
|
| 91 |
+
OutputIterator
|
| 92 |
+
copy(execution_policy<DerivedPolicy>& exec, InputIterator first, InputIterator last, OutputIterator result)
|
| 93 |
+
{
|
| 94 |
+
using traversal1 = typename thrust::iterator_traversal<InputIterator>::type;
|
| 95 |
+
using traversal2 = typename thrust::iterator_traversal<OutputIterator>::type;
|
| 96 |
+
|
| 97 |
+
using traversal = typename thrust::detail::minimum_type<traversal1, traversal2>::type;
|
| 98 |
+
|
| 99 |
+
// dispatch on minimum traversal
|
| 100 |
+
return thrust::system::tbb::detail::dispatch::copy(exec, first, last, result, traversal());
|
| 101 |
+
} // end copy()
|
| 102 |
+
|
| 103 |
+
template <typename DerivedPolicy, typename InputIterator, typename Size, typename OutputIterator>
|
| 104 |
+
OutputIterator copy_n(execution_policy<DerivedPolicy>& exec, InputIterator first, Size n, OutputIterator result)
|
| 105 |
+
{
|
| 106 |
+
using traversal1 = typename thrust::iterator_traversal<InputIterator>::type;
|
| 107 |
+
using traversal2 = typename thrust::iterator_traversal<OutputIterator>::type;
|
| 108 |
+
|
| 109 |
+
using traversal = typename thrust::detail::minimum_type<traversal1, traversal2>::type;
|
| 110 |
+
|
| 111 |
+
// dispatch on minimum traversal
|
| 112 |
+
return thrust::system::tbb::detail::dispatch::copy_n(exec, first, n, result, traversal());
|
| 113 |
+
} // end copy_n()
|
| 114 |
+
|
| 115 |
+
} // end namespace detail
|
| 116 |
+
} // end namespace tbb
|
| 117 |
+
} // end namespace system
|
| 118 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy_if.h
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace tbb
|
| 34 |
+
{
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename InputIterator1, typename InputIterator2, typename OutputIterator, typename Predicate>
|
| 39 |
+
OutputIterator
|
| 40 |
+
copy_if(tag, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred);
|
| 41 |
+
|
| 42 |
+
} // namespace detail
|
| 43 |
+
} // namespace tbb
|
| 44 |
+
} // namespace system
|
| 45 |
+
THRUST_NAMESPACE_END
|
| 46 |
+
|
| 47 |
+
#include <thrust/system/tbb/detail/copy_if.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/count.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits count
|
| 30 |
+
#include <thrust/system/cpp/detail/count.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/equal.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits equal
|
| 30 |
+
#include <thrust/system/cpp/detail/equal.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/execution_policy.h
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/type_traits.h>
|
| 29 |
+
#include <thrust/iterator/detail/any_system_tag.h>
|
| 30 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 31 |
+
|
| 32 |
+
THRUST_NAMESPACE_BEGIN
|
| 33 |
+
namespace system
|
| 34 |
+
{
|
| 35 |
+
// put the canonical tag in the same ns as the backend's entry points
|
| 36 |
+
namespace tbb
|
| 37 |
+
{
|
| 38 |
+
namespace detail
|
| 39 |
+
{
|
| 40 |
+
|
| 41 |
+
// this awkward sequence of definitions arise
|
| 42 |
+
// from the desire both for tag to derive
|
| 43 |
+
// from execution_policy and for execution_policy
|
| 44 |
+
// to convert to tag (when execution_policy is not
|
| 45 |
+
// an ancestor of tag)
|
| 46 |
+
|
| 47 |
+
// forward declaration of tag
|
| 48 |
+
struct tag;
|
| 49 |
+
|
| 50 |
+
// forward declaration of execution_policy
|
| 51 |
+
template <typename>
|
| 52 |
+
struct execution_policy;
|
| 53 |
+
|
| 54 |
+
// specialize execution_policy for tag
|
| 55 |
+
template <>
|
| 56 |
+
struct execution_policy<tag> : thrust::system::cpp::detail::execution_policy<tag>
|
| 57 |
+
{};
|
| 58 |
+
|
| 59 |
+
// tag's definition comes before the
|
| 60 |
+
// generic definition of execution_policy
|
| 61 |
+
struct tag : execution_policy<tag>
|
| 62 |
+
{};
|
| 63 |
+
|
| 64 |
+
// allow conversion to tag when it is not a successor
|
| 65 |
+
template <typename Derived>
|
| 66 |
+
struct execution_policy : thrust::system::cpp::detail::execution_policy<Derived>
|
| 67 |
+
{
|
| 68 |
+
using tag_type = tag;
|
| 69 |
+
operator tag() const
|
| 70 |
+
{
|
| 71 |
+
return tag();
|
| 72 |
+
}
|
| 73 |
+
};
|
| 74 |
+
|
| 75 |
+
} // namespace detail
|
| 76 |
+
|
| 77 |
+
// alias execution_policy and tag here
|
| 78 |
+
using thrust::system::tbb::detail::execution_policy;
|
| 79 |
+
using thrust::system::tbb::detail::tag;
|
| 80 |
+
|
| 81 |
+
} // namespace tbb
|
| 82 |
+
} // namespace system
|
| 83 |
+
|
| 84 |
+
// alias items at top-level
|
| 85 |
+
namespace tbb
|
| 86 |
+
{
|
| 87 |
+
|
| 88 |
+
using thrust::system::tbb::execution_policy;
|
| 89 |
+
using thrust::system::tbb::tag;
|
| 90 |
+
|
| 91 |
+
} // namespace tbb
|
| 92 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/extrema.h
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/detail/generic/extrema.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 40 |
+
ForwardIterator
|
| 41 |
+
max_element(execution_policy<DerivedPolicy>& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp)
|
| 42 |
+
{
|
| 43 |
+
// tbb prefers generic::max_element to cpp::max_element
|
| 44 |
+
return thrust::system::detail::generic::max_element(exec, first, last, comp);
|
| 45 |
+
} // end max_element()
|
| 46 |
+
|
| 47 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 48 |
+
ForwardIterator
|
| 49 |
+
min_element(execution_policy<DerivedPolicy>& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp)
|
| 50 |
+
{
|
| 51 |
+
// tbb prefers generic::min_element to cpp::min_element
|
| 52 |
+
return thrust::system::detail::generic::min_element(exec, first, last, comp);
|
| 53 |
+
} // end min_element()
|
| 54 |
+
|
| 55 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename BinaryPredicate>
|
| 56 |
+
thrust::pair<ForwardIterator, ForwardIterator>
|
| 57 |
+
minmax_element(execution_policy<DerivedPolicy>& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp)
|
| 58 |
+
{
|
| 59 |
+
// tbb prefers generic::minmax_element to cpp::minmax_element
|
| 60 |
+
return thrust::system::detail::generic::minmax_element(exec, first, last, comp);
|
| 61 |
+
} // end minmax_element()
|
| 62 |
+
|
| 63 |
+
} // namespace detail
|
| 64 |
+
} // namespace tbb
|
| 65 |
+
} // namespace system
|
| 66 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/fill.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits fill
|
| 30 |
+
#include <thrust/system/cpp/detail/fill.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.h
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace tbb
|
| 34 |
+
{
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename DerivedPolicy, typename RandomAccessIterator, typename UnaryFunction>
|
| 39 |
+
RandomAccessIterator
|
| 40 |
+
for_each(execution_policy<DerivedPolicy>& exec, RandomAccessIterator first, RandomAccessIterator last, UnaryFunction f);
|
| 41 |
+
|
| 42 |
+
template <typename DerivedPolicy, typename RandomAccessIterator, typename Size, typename UnaryFunction>
|
| 43 |
+
RandomAccessIterator
|
| 44 |
+
for_each_n(execution_policy<DerivedPolicy>& exec, RandomAccessIterator first, Size n, UnaryFunction f);
|
| 45 |
+
|
| 46 |
+
} // end namespace detail
|
| 47 |
+
} // end namespace tbb
|
| 48 |
+
} // end namespace system
|
| 49 |
+
THRUST_NAMESPACE_END
|
| 50 |
+
|
| 51 |
+
#include <thrust/system/tbb/detail/for_each.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.inl
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/static_assert.h>
|
| 29 |
+
#include <thrust/distance.h>
|
| 30 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 31 |
+
#include <thrust/system/detail/sequential/execution_policy.h>
|
| 32 |
+
|
| 33 |
+
#include <tbb/blocked_range.h>
|
| 34 |
+
#include <tbb/parallel_for.h>
|
| 35 |
+
|
| 36 |
+
THRUST_NAMESPACE_BEGIN
|
| 37 |
+
namespace system
|
| 38 |
+
{
|
| 39 |
+
namespace tbb
|
| 40 |
+
{
|
| 41 |
+
namespace detail
|
| 42 |
+
{
|
| 43 |
+
namespace for_each_detail
|
| 44 |
+
{
|
| 45 |
+
|
| 46 |
+
template <typename RandomAccessIterator, typename Size, typename UnaryFunction>
|
| 47 |
+
struct body
|
| 48 |
+
{
|
| 49 |
+
RandomAccessIterator m_first;
|
| 50 |
+
UnaryFunction m_f;
|
| 51 |
+
|
| 52 |
+
body(RandomAccessIterator first, UnaryFunction f)
|
| 53 |
+
: m_first(first)
|
| 54 |
+
, m_f(f)
|
| 55 |
+
{}
|
| 56 |
+
|
| 57 |
+
void operator()(const ::tbb::blocked_range<Size>& r) const
|
| 58 |
+
{
|
| 59 |
+
// we assume that blocked_range specifies a contiguous range of integers
|
| 60 |
+
thrust::for_each_n(thrust::system::detail::sequential::seq, m_first + r.begin(), r.size(), m_f);
|
| 61 |
+
} // end operator()()
|
| 62 |
+
}; // end body
|
| 63 |
+
|
| 64 |
+
template <typename Size, typename RandomAccessIterator, typename UnaryFunction>
|
| 65 |
+
body<RandomAccessIterator, Size, UnaryFunction> make_body(RandomAccessIterator first, UnaryFunction f)
|
| 66 |
+
{
|
| 67 |
+
return body<RandomAccessIterator, Size, UnaryFunction>(first, f);
|
| 68 |
+
} // end make_body()
|
| 69 |
+
|
| 70 |
+
} // namespace for_each_detail
|
| 71 |
+
|
| 72 |
+
template <typename DerivedPolicy, typename RandomAccessIterator, typename Size, typename UnaryFunction>
|
| 73 |
+
RandomAccessIterator for_each_n(execution_policy<DerivedPolicy>&, RandomAccessIterator first, Size n, UnaryFunction f)
|
| 74 |
+
{
|
| 75 |
+
::tbb::parallel_for(::tbb::blocked_range<Size>(0, n), for_each_detail::make_body<Size>(first, f));
|
| 76 |
+
|
| 77 |
+
// return the end of the range
|
| 78 |
+
return first + n;
|
| 79 |
+
} // end for_each_n
|
| 80 |
+
|
| 81 |
+
template <typename DerivedPolicy, typename RandomAccessIterator, typename UnaryFunction>
|
| 82 |
+
RandomAccessIterator
|
| 83 |
+
for_each(execution_policy<DerivedPolicy>& s, RandomAccessIterator first, RandomAccessIterator last, UnaryFunction f)
|
| 84 |
+
{
|
| 85 |
+
return tbb::detail::for_each_n(s, first, thrust::distance(first, last), f);
|
| 86 |
+
} // end for_each()
|
| 87 |
+
|
| 88 |
+
} // end namespace detail
|
| 89 |
+
} // end namespace tbb
|
| 90 |
+
} // end namespace system
|
| 91 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/gather.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits gather
|
| 30 |
+
#include <thrust/system/cpp/detail/gather.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/generate.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits generate
|
| 30 |
+
#include <thrust/system/cpp/detail/generate.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/get_value.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits get_value
|
| 30 |
+
#include <thrust/system/cpp/detail/get_value.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/inner_product.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits inner_product
|
| 30 |
+
#include <thrust/system/cpp/detail/inner_product.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/logical.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits logical
|
| 30 |
+
#include <thrust/system/cpp/detail/logical.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/malloc_and_free.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits malloc and free
|
| 30 |
+
#include <thrust/system/cpp/detail/malloc_and_free.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/memory.inl
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/cpp/detail/execution_policy.h>
|
| 29 |
+
#include <thrust/system/cpp/memory.h>
|
| 30 |
+
#include <thrust/system/tbb/memory.h>
|
| 31 |
+
|
| 32 |
+
#include <limits>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace system
|
| 36 |
+
{
|
| 37 |
+
namespace tbb
|
| 38 |
+
{
|
| 39 |
+
|
| 40 |
+
namespace detail
|
| 41 |
+
{
|
| 42 |
+
|
| 43 |
+
// XXX circular #inclusion problems cause the compiler to believe that cpp::malloc
|
| 44 |
+
// is not defined
|
| 45 |
+
// WAR the problem by using adl to call cpp::malloc, which requires it to depend
|
| 46 |
+
// on a template parameter
|
| 47 |
+
template <typename Tag>
|
| 48 |
+
pointer<void> malloc_workaround(Tag t, std::size_t n)
|
| 49 |
+
{
|
| 50 |
+
return pointer<void>(malloc(t, n));
|
| 51 |
+
} // end malloc_workaround()
|
| 52 |
+
|
| 53 |
+
// XXX circular #inclusion problems cause the compiler to believe that cpp::free
|
| 54 |
+
// is not defined
|
| 55 |
+
// WAR the problem by using adl to call cpp::free, which requires it to depend
|
| 56 |
+
// on a template parameter
|
| 57 |
+
template <typename Tag>
|
| 58 |
+
void free_workaround(Tag t, pointer<void> ptr)
|
| 59 |
+
{
|
| 60 |
+
free(t, ptr.get());
|
| 61 |
+
} // end free_workaround()
|
| 62 |
+
|
| 63 |
+
} // namespace detail
|
| 64 |
+
|
| 65 |
+
inline pointer<void> malloc(std::size_t n)
|
| 66 |
+
{
|
| 67 |
+
// XXX this is how we'd like to implement this function,
|
| 68 |
+
// if not for circular #inclusion problems:
|
| 69 |
+
//
|
| 70 |
+
// return pointer<void>(thrust::system::cpp::malloc(n))
|
| 71 |
+
//
|
| 72 |
+
return detail::malloc_workaround(cpp::tag(), n);
|
| 73 |
+
} // end malloc()
|
| 74 |
+
|
| 75 |
+
template <typename T>
|
| 76 |
+
pointer<T> malloc(std::size_t n)
|
| 77 |
+
{
|
| 78 |
+
pointer<void> raw_ptr = thrust::system::tbb::malloc(sizeof(T) * n);
|
| 79 |
+
return pointer<T>(reinterpret_cast<T*>(raw_ptr.get()));
|
| 80 |
+
} // end malloc()
|
| 81 |
+
|
| 82 |
+
inline void free(pointer<void> ptr)
|
| 83 |
+
{
|
| 84 |
+
// XXX this is how we'd like to implement this function,
|
| 85 |
+
// if not for circular #inclusion problems:
|
| 86 |
+
//
|
| 87 |
+
// thrust::system::cpp::free(ptr)
|
| 88 |
+
//
|
| 89 |
+
detail::free_workaround(cpp::tag(), ptr);
|
| 90 |
+
} // end free()
|
| 91 |
+
|
| 92 |
+
} // namespace tbb
|
| 93 |
+
} // namespace system
|
| 94 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.h
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace tbb
|
| 34 |
+
{
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename ExecutionPolicy,
|
| 39 |
+
typename InputIterator1,
|
| 40 |
+
typename InputIterator2,
|
| 41 |
+
typename OutputIterator,
|
| 42 |
+
typename StrictWeakOrdering>
|
| 43 |
+
OutputIterator
|
| 44 |
+
merge(execution_policy<ExecutionPolicy>& exec,
|
| 45 |
+
InputIterator1 first1,
|
| 46 |
+
InputIterator1 last1,
|
| 47 |
+
InputIterator2 first2,
|
| 48 |
+
InputIterator2 last2,
|
| 49 |
+
OutputIterator result,
|
| 50 |
+
StrictWeakOrdering comp);
|
| 51 |
+
|
| 52 |
+
template <typename ExecutionPolicy,
|
| 53 |
+
typename InputIterator1,
|
| 54 |
+
typename InputIterator2,
|
| 55 |
+
typename InputIterator3,
|
| 56 |
+
typename InputIterator4,
|
| 57 |
+
typename OutputIterator1,
|
| 58 |
+
typename OutputIterator2,
|
| 59 |
+
typename StrictWeakOrdering>
|
| 60 |
+
thrust::pair<OutputIterator1, OutputIterator2> merge_by_key(
|
| 61 |
+
execution_policy<ExecutionPolicy>& exec,
|
| 62 |
+
InputIterator1 keys_first1,
|
| 63 |
+
InputIterator1 keys_last1,
|
| 64 |
+
InputIterator2 keys_first2,
|
| 65 |
+
InputIterator2 keys_last2,
|
| 66 |
+
InputIterator3 values_first3,
|
| 67 |
+
InputIterator4 values_first4,
|
| 68 |
+
OutputIterator1 keys_result,
|
| 69 |
+
OutputIterator2 values_result,
|
| 70 |
+
StrictWeakOrdering comp);
|
| 71 |
+
|
| 72 |
+
} // namespace detail
|
| 73 |
+
} // namespace tbb
|
| 74 |
+
} // namespace system
|
| 75 |
+
THRUST_NAMESPACE_END
|
| 76 |
+
|
| 77 |
+
#include <thrust/system/tbb/detail/merge.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.inl
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#include <thrust/binary_search.h>
|
| 30 |
+
#include <thrust/detail/seq.h>
|
| 31 |
+
#include <thrust/detail/temporary_array.h>
|
| 32 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 33 |
+
#include <thrust/merge.h>
|
| 34 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 35 |
+
|
| 36 |
+
#include <tbb/parallel_for.h>
|
| 37 |
+
|
| 38 |
+
THRUST_NAMESPACE_BEGIN
|
| 39 |
+
namespace system
|
| 40 |
+
{
|
| 41 |
+
namespace tbb
|
| 42 |
+
{
|
| 43 |
+
namespace detail
|
| 44 |
+
{
|
| 45 |
+
namespace merge_detail
|
| 46 |
+
{
|
| 47 |
+
|
| 48 |
+
template <typename InputIterator1, typename InputIterator2, typename OutputIterator, typename StrictWeakOrdering>
|
| 49 |
+
struct range
|
| 50 |
+
{
|
| 51 |
+
InputIterator1 first1, last1;
|
| 52 |
+
InputIterator2 first2, last2;
|
| 53 |
+
OutputIterator result;
|
| 54 |
+
StrictWeakOrdering comp;
|
| 55 |
+
size_t grain_size;
|
| 56 |
+
|
| 57 |
+
range(InputIterator1 first1,
|
| 58 |
+
InputIterator1 last1,
|
| 59 |
+
InputIterator2 first2,
|
| 60 |
+
InputIterator2 last2,
|
| 61 |
+
OutputIterator result,
|
| 62 |
+
StrictWeakOrdering comp,
|
| 63 |
+
size_t grain_size = 1024)
|
| 64 |
+
: first1(first1)
|
| 65 |
+
, last1(last1)
|
| 66 |
+
, first2(first2)
|
| 67 |
+
, last2(last2)
|
| 68 |
+
, result(result)
|
| 69 |
+
, comp(comp)
|
| 70 |
+
, grain_size(grain_size)
|
| 71 |
+
{}
|
| 72 |
+
|
| 73 |
+
range(range& r, ::tbb::split)
|
| 74 |
+
: first1(r.first1)
|
| 75 |
+
, last1(r.last1)
|
| 76 |
+
, first2(r.first2)
|
| 77 |
+
, last2(r.last2)
|
| 78 |
+
, result(r.result)
|
| 79 |
+
, comp(r.comp)
|
| 80 |
+
, grain_size(r.grain_size)
|
| 81 |
+
{
|
| 82 |
+
// we can assume n1 and n2 are not both 0
|
| 83 |
+
size_t n1 = thrust::distance(first1, last1);
|
| 84 |
+
size_t n2 = thrust::distance(first2, last2);
|
| 85 |
+
|
| 86 |
+
InputIterator1 mid1 = first1;
|
| 87 |
+
InputIterator2 mid2 = first2;
|
| 88 |
+
|
| 89 |
+
if (n1 > n2)
|
| 90 |
+
{
|
| 91 |
+
mid1 += n1 / 2;
|
| 92 |
+
mid2 = thrust::lower_bound(thrust::seq, first2, last2, raw_reference_cast(*mid1), comp);
|
| 93 |
+
}
|
| 94 |
+
else
|
| 95 |
+
{
|
| 96 |
+
mid2 += n2 / 2;
|
| 97 |
+
mid1 = thrust::upper_bound(thrust::seq, first1, last1, raw_reference_cast(*mid2), comp);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
// set first range to [first1, mid1), [first2, mid2), result
|
| 101 |
+
r.last1 = mid1;
|
| 102 |
+
r.last2 = mid2;
|
| 103 |
+
|
| 104 |
+
// set second range to [mid1, last1), [mid2, last2), result + (mid1 - first1) + (mid2 - first2)
|
| 105 |
+
first1 = mid1;
|
| 106 |
+
first2 = mid2;
|
| 107 |
+
result += thrust::distance(r.first1, mid1) + thrust::distance(r.first2, mid2);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
bool empty() const
|
| 111 |
+
{
|
| 112 |
+
return (first1 == last1) && (first2 == last2);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
bool is_divisible() const
|
| 116 |
+
{
|
| 117 |
+
return static_cast<size_t>(thrust::distance(first1, last1) + thrust::distance(first2, last2)) > grain_size;
|
| 118 |
+
}
|
| 119 |
+
};
|
| 120 |
+
|
| 121 |
+
struct body
|
| 122 |
+
{
|
| 123 |
+
template <typename Range>
|
| 124 |
+
void operator()(Range& r) const
|
| 125 |
+
{
|
| 126 |
+
thrust::merge(thrust::seq, r.first1, r.last1, r.first2, r.last2, r.result, r.comp);
|
| 127 |
+
}
|
| 128 |
+
};
|
| 129 |
+
|
| 130 |
+
} // end namespace merge_detail
|
| 131 |
+
|
| 132 |
+
namespace merge_by_key_detail
|
| 133 |
+
{
|
| 134 |
+
|
| 135 |
+
template <typename InputIterator1,
|
| 136 |
+
typename InputIterator2,
|
| 137 |
+
typename InputIterator3,
|
| 138 |
+
typename InputIterator4,
|
| 139 |
+
typename OutputIterator1,
|
| 140 |
+
typename OutputIterator2,
|
| 141 |
+
typename StrictWeakOrdering>
|
| 142 |
+
struct range
|
| 143 |
+
{
|
| 144 |
+
InputIterator1 keys_first1, keys_last1;
|
| 145 |
+
InputIterator2 keys_first2, keys_last2;
|
| 146 |
+
InputIterator3 values_first1;
|
| 147 |
+
InputIterator4 values_first2;
|
| 148 |
+
OutputIterator1 keys_result;
|
| 149 |
+
OutputIterator2 values_result;
|
| 150 |
+
StrictWeakOrdering comp;
|
| 151 |
+
size_t grain_size;
|
| 152 |
+
|
| 153 |
+
range(InputIterator1 keys_first1,
|
| 154 |
+
InputIterator1 keys_last1,
|
| 155 |
+
InputIterator2 keys_first2,
|
| 156 |
+
InputIterator2 keys_last2,
|
| 157 |
+
InputIterator3 values_first1,
|
| 158 |
+
InputIterator4 values_first2,
|
| 159 |
+
OutputIterator1 keys_result,
|
| 160 |
+
OutputIterator2 values_result,
|
| 161 |
+
StrictWeakOrdering comp,
|
| 162 |
+
size_t grain_size = 1024)
|
| 163 |
+
: keys_first1(keys_first1)
|
| 164 |
+
, keys_last1(keys_last1)
|
| 165 |
+
, keys_first2(keys_first2)
|
| 166 |
+
, keys_last2(keys_last2)
|
| 167 |
+
, values_first1(values_first1)
|
| 168 |
+
, values_first2(values_first2)
|
| 169 |
+
, keys_result(keys_result)
|
| 170 |
+
, values_result(values_result)
|
| 171 |
+
, comp(comp)
|
| 172 |
+
, grain_size(grain_size)
|
| 173 |
+
{}
|
| 174 |
+
|
| 175 |
+
range(range& r, ::tbb::split)
|
| 176 |
+
: keys_first1(r.keys_first1)
|
| 177 |
+
, keys_last1(r.keys_last1)
|
| 178 |
+
, keys_first2(r.keys_first2)
|
| 179 |
+
, keys_last2(r.keys_last2)
|
| 180 |
+
, values_first1(r.values_first1)
|
| 181 |
+
, values_first2(r.values_first2)
|
| 182 |
+
, keys_result(r.keys_result)
|
| 183 |
+
, values_result(r.values_result)
|
| 184 |
+
, comp(r.comp)
|
| 185 |
+
, grain_size(r.grain_size)
|
| 186 |
+
{
|
| 187 |
+
// we can assume n1 and n2 are not both 0
|
| 188 |
+
size_t n1 = thrust::distance(keys_first1, keys_last1);
|
| 189 |
+
size_t n2 = thrust::distance(keys_first2, keys_last2);
|
| 190 |
+
|
| 191 |
+
InputIterator1 mid1 = keys_first1;
|
| 192 |
+
InputIterator2 mid2 = keys_first2;
|
| 193 |
+
|
| 194 |
+
if (n1 > n2)
|
| 195 |
+
{
|
| 196 |
+
mid1 += n1 / 2;
|
| 197 |
+
mid2 = thrust::lower_bound(thrust::seq, keys_first2, keys_last2, raw_reference_cast(*mid1), comp);
|
| 198 |
+
}
|
| 199 |
+
else
|
| 200 |
+
{
|
| 201 |
+
mid2 += n2 / 2;
|
| 202 |
+
mid1 = thrust::upper_bound(thrust::seq, keys_first1, keys_last1, raw_reference_cast(*mid2), comp);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
// set first range to [keys_first1, mid1), [keys_first2, mid2), keys_result, values_result
|
| 206 |
+
r.keys_last1 = mid1;
|
| 207 |
+
r.keys_last2 = mid2;
|
| 208 |
+
|
| 209 |
+
// set second range to [mid1, keys_last1), [mid2, keys_last2), keys_result + (mid1 - keys_first1) + (mid2 -
|
| 210 |
+
// keys_first2), values_result + (mid1 - keys_first1) + (mid2 - keys_first2)
|
| 211 |
+
keys_first1 = mid1;
|
| 212 |
+
keys_first2 = mid2;
|
| 213 |
+
values_first1 += thrust::distance(r.keys_first1, mid1);
|
| 214 |
+
values_first2 += thrust::distance(r.keys_first2, mid2);
|
| 215 |
+
keys_result += thrust::distance(r.keys_first1, mid1) + thrust::distance(r.keys_first2, mid2);
|
| 216 |
+
values_result += thrust::distance(r.keys_first1, mid1) + thrust::distance(r.keys_first2, mid2);
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
bool empty() const
|
| 220 |
+
{
|
| 221 |
+
return (keys_first1 == keys_last1) && (keys_first2 == keys_last2);
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
bool is_divisible() const
|
| 225 |
+
{
|
| 226 |
+
return static_cast<size_t>(thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2))
|
| 227 |
+
> grain_size;
|
| 228 |
+
}
|
| 229 |
+
};
|
| 230 |
+
|
| 231 |
+
struct body
|
| 232 |
+
{
|
| 233 |
+
template <typename Range>
|
| 234 |
+
void operator()(Range& r) const
|
| 235 |
+
{
|
| 236 |
+
thrust::merge_by_key(
|
| 237 |
+
thrust::seq,
|
| 238 |
+
r.keys_first1,
|
| 239 |
+
r.keys_last1,
|
| 240 |
+
r.keys_first2,
|
| 241 |
+
r.keys_last2,
|
| 242 |
+
r.values_first1,
|
| 243 |
+
r.values_first2,
|
| 244 |
+
r.keys_result,
|
| 245 |
+
r.values_result,
|
| 246 |
+
r.comp);
|
| 247 |
+
}
|
| 248 |
+
};
|
| 249 |
+
|
| 250 |
+
} // end namespace merge_by_key_detail
|
| 251 |
+
|
| 252 |
+
template <typename DerivedPolicy,
|
| 253 |
+
typename InputIterator1,
|
| 254 |
+
typename InputIterator2,
|
| 255 |
+
typename OutputIterator,
|
| 256 |
+
typename StrictWeakOrdering>
|
| 257 |
+
OutputIterator
|
| 258 |
+
merge(execution_policy<DerivedPolicy>&,
|
| 259 |
+
InputIterator1 first1,
|
| 260 |
+
InputIterator1 last1,
|
| 261 |
+
InputIterator2 first2,
|
| 262 |
+
InputIterator2 last2,
|
| 263 |
+
OutputIterator result,
|
| 264 |
+
StrictWeakOrdering comp)
|
| 265 |
+
{
|
| 266 |
+
using Range = typename merge_detail::range<InputIterator1, InputIterator2, OutputIterator, StrictWeakOrdering>;
|
| 267 |
+
using Body = merge_detail::body;
|
| 268 |
+
Range range(first1, last1, first2, last2, result, comp);
|
| 269 |
+
Body body;
|
| 270 |
+
|
| 271 |
+
::tbb::parallel_for(range, body);
|
| 272 |
+
|
| 273 |
+
thrust::advance(result, thrust::distance(first1, last1) + thrust::distance(first2, last2));
|
| 274 |
+
|
| 275 |
+
return result;
|
| 276 |
+
} // end merge()
|
| 277 |
+
|
| 278 |
+
template <typename DerivedPolicy,
|
| 279 |
+
typename InputIterator1,
|
| 280 |
+
typename InputIterator2,
|
| 281 |
+
typename InputIterator3,
|
| 282 |
+
typename InputIterator4,
|
| 283 |
+
typename OutputIterator1,
|
| 284 |
+
typename OutputIterator2,
|
| 285 |
+
typename StrictWeakOrdering>
|
| 286 |
+
thrust::pair<OutputIterator1, OutputIterator2> merge_by_key(
|
| 287 |
+
execution_policy<DerivedPolicy>&,
|
| 288 |
+
InputIterator1 keys_first1,
|
| 289 |
+
InputIterator1 keys_last1,
|
| 290 |
+
InputIterator2 keys_first2,
|
| 291 |
+
InputIterator2 keys_last2,
|
| 292 |
+
InputIterator3 values_first3,
|
| 293 |
+
InputIterator4 values_first4,
|
| 294 |
+
OutputIterator1 keys_result,
|
| 295 |
+
OutputIterator2 values_result,
|
| 296 |
+
StrictWeakOrdering comp)
|
| 297 |
+
{
|
| 298 |
+
using Range = typename merge_by_key_detail::range<
|
| 299 |
+
InputIterator1,
|
| 300 |
+
InputIterator2,
|
| 301 |
+
InputIterator3,
|
| 302 |
+
InputIterator4,
|
| 303 |
+
OutputIterator1,
|
| 304 |
+
OutputIterator2,
|
| 305 |
+
StrictWeakOrdering>;
|
| 306 |
+
using Body = merge_by_key_detail::body;
|
| 307 |
+
|
| 308 |
+
Range range(
|
| 309 |
+
keys_first1, keys_last1, keys_first2, keys_last2, values_first3, values_first4, keys_result, values_result, comp);
|
| 310 |
+
Body body;
|
| 311 |
+
|
| 312 |
+
::tbb::parallel_for(range, body);
|
| 313 |
+
|
| 314 |
+
thrust::advance(keys_result, thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2));
|
| 315 |
+
thrust::advance(values_result, thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2));
|
| 316 |
+
|
| 317 |
+
return thrust::make_pair(keys_result, values_result);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
} // end namespace detail
|
| 321 |
+
} // end namespace tbb
|
| 322 |
+
} // end namespace system
|
| 323 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/mismatch.h
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system inherits mismatch
|
| 30 |
+
#include <thrust/system/cpp/detail/mismatch.h>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/par.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator_aware_execution_policy.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
struct par_t
|
| 40 |
+
: thrust::system::tbb::detail::execution_policy<par_t>
|
| 41 |
+
, thrust::detail::allocator_aware_execution_policy<thrust::system::tbb::detail::execution_policy>
|
| 42 |
+
{
|
| 43 |
+
_CCCL_HOST_DEVICE constexpr par_t()
|
| 44 |
+
: thrust::system::tbb::detail::execution_policy<par_t>()
|
| 45 |
+
{}
|
| 46 |
+
};
|
| 47 |
+
|
| 48 |
+
} // namespace detail
|
| 49 |
+
|
| 50 |
+
static const detail::par_t par;
|
| 51 |
+
|
| 52 |
+
} // namespace tbb
|
| 53 |
+
} // namespace system
|
| 54 |
+
|
| 55 |
+
// alias par here
|
| 56 |
+
namespace tbb
|
| 57 |
+
{
|
| 58 |
+
|
| 59 |
+
using thrust::system::tbb::par;
|
| 60 |
+
|
| 61 |
+
} // namespace tbb
|
| 62 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.h
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/pair.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename Predicate>
|
| 40 |
+
ForwardIterator
|
| 41 |
+
stable_partition(execution_policy<DerivedPolicy>& exec, ForwardIterator first, ForwardIterator last, Predicate pred);
|
| 42 |
+
|
| 43 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename InputIterator, typename Predicate>
|
| 44 |
+
ForwardIterator stable_partition(
|
| 45 |
+
execution_policy<DerivedPolicy>& exec,
|
| 46 |
+
ForwardIterator first,
|
| 47 |
+
ForwardIterator last,
|
| 48 |
+
InputIterator stencil,
|
| 49 |
+
Predicate pred);
|
| 50 |
+
|
| 51 |
+
template <typename DerivedPolicy,
|
| 52 |
+
typename InputIterator,
|
| 53 |
+
typename OutputIterator1,
|
| 54 |
+
typename OutputIterator2,
|
| 55 |
+
typename Predicate>
|
| 56 |
+
thrust::pair<OutputIterator1, OutputIterator2> stable_partition_copy(
|
| 57 |
+
execution_policy<DerivedPolicy>& exec,
|
| 58 |
+
InputIterator first,
|
| 59 |
+
InputIterator last,
|
| 60 |
+
OutputIterator1 out_true,
|
| 61 |
+
OutputIterator2 out_false,
|
| 62 |
+
Predicate pred);
|
| 63 |
+
|
| 64 |
+
template <typename DerivedPolicy,
|
| 65 |
+
typename InputIterator1,
|
| 66 |
+
typename InputIterator2,
|
| 67 |
+
typename OutputIterator1,
|
| 68 |
+
typename OutputIterator2,
|
| 69 |
+
typename Predicate>
|
| 70 |
+
thrust::pair<OutputIterator1, OutputIterator2> stable_partition_copy(
|
| 71 |
+
execution_policy<DerivedPolicy>& exec,
|
| 72 |
+
InputIterator1 first,
|
| 73 |
+
InputIterator1 last,
|
| 74 |
+
InputIterator2 stencil,
|
| 75 |
+
OutputIterator1 out_true,
|
| 76 |
+
OutputIterator2 out_false,
|
| 77 |
+
Predicate pred);
|
| 78 |
+
|
| 79 |
+
} // end namespace detail
|
| 80 |
+
} // end namespace tbb
|
| 81 |
+
} // end namespace system
|
| 82 |
+
THRUST_NAMESPACE_END
|
| 83 |
+
|
| 84 |
+
#include <thrust/system/tbb/detail/partition.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.inl
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/detail/generic/partition.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/partition.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename Predicate>
|
| 40 |
+
ForwardIterator
|
| 41 |
+
stable_partition(execution_policy<DerivedPolicy>& exec, ForwardIterator first, ForwardIterator last, Predicate pred)
|
| 42 |
+
{
|
| 43 |
+
// tbb prefers generic::stable_partition to cpp::stable_partition
|
| 44 |
+
return thrust::system::detail::generic::stable_partition(exec, first, last, pred);
|
| 45 |
+
} // end stable_partition()
|
| 46 |
+
|
| 47 |
+
template <typename DerivedPolicy, typename ForwardIterator, typename InputIterator, typename Predicate>
|
| 48 |
+
ForwardIterator stable_partition(
|
| 49 |
+
execution_policy<DerivedPolicy>& exec,
|
| 50 |
+
ForwardIterator first,
|
| 51 |
+
ForwardIterator last,
|
| 52 |
+
InputIterator stencil,
|
| 53 |
+
Predicate pred)
|
| 54 |
+
{
|
| 55 |
+
// tbb prefers generic::stable_partition to cpp::stable_partition
|
| 56 |
+
return thrust::system::detail::generic::stable_partition(exec, first, last, stencil, pred);
|
| 57 |
+
} // end stable_partition()
|
| 58 |
+
|
| 59 |
+
template <typename DerivedPolicy,
|
| 60 |
+
typename InputIterator,
|
| 61 |
+
typename OutputIterator1,
|
| 62 |
+
typename OutputIterator2,
|
| 63 |
+
typename Predicate>
|
| 64 |
+
thrust::pair<OutputIterator1, OutputIterator2> stable_partition_copy(
|
| 65 |
+
execution_policy<DerivedPolicy>& exec,
|
| 66 |
+
InputIterator first,
|
| 67 |
+
InputIterator last,
|
| 68 |
+
OutputIterator1 out_true,
|
| 69 |
+
OutputIterator2 out_false,
|
| 70 |
+
Predicate pred)
|
| 71 |
+
{
|
| 72 |
+
// tbb prefers generic::stable_partition_copy to cpp::stable_partition_copy
|
| 73 |
+
return thrust::system::detail::generic::stable_partition_copy(exec, first, last, out_true, out_false, pred);
|
| 74 |
+
} // end stable_partition_copy()
|
| 75 |
+
|
| 76 |
+
template <typename DerivedPolicy,
|
| 77 |
+
typename InputIterator1,
|
| 78 |
+
typename InputIterator2,
|
| 79 |
+
typename OutputIterator1,
|
| 80 |
+
typename OutputIterator2,
|
| 81 |
+
typename Predicate>
|
| 82 |
+
thrust::pair<OutputIterator1, OutputIterator2> stable_partition_copy(
|
| 83 |
+
execution_policy<DerivedPolicy>& exec,
|
| 84 |
+
InputIterator1 first,
|
| 85 |
+
InputIterator1 last,
|
| 86 |
+
InputIterator2 stencil,
|
| 87 |
+
OutputIterator1 out_true,
|
| 88 |
+
OutputIterator2 out_false,
|
| 89 |
+
Predicate pred)
|
| 90 |
+
{
|
| 91 |
+
// tbb prefers generic::stable_partition_copy to cpp::stable_partition_copy
|
| 92 |
+
return thrust::system::detail::generic::stable_partition_copy(exec, first, last, stencil, out_true, out_false, pred);
|
| 93 |
+
} // end stable_partition_copy()
|
| 94 |
+
|
| 95 |
+
} // end namespace detail
|
| 96 |
+
} // end namespace tbb
|
| 97 |
+
} // end namespace system
|
| 98 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/per_device_resource.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// this system has no special per device resource functions
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.h
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file reduce.h
|
| 18 |
+
* \brief TBB implementation of reduce.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
#include <thrust/detail/config.h>
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace system
|
| 36 |
+
{
|
| 37 |
+
namespace tbb
|
| 38 |
+
{
|
| 39 |
+
namespace detail
|
| 40 |
+
{
|
| 41 |
+
|
| 42 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputType, typename BinaryFunction>
|
| 43 |
+
OutputType reduce(execution_policy<DerivedPolicy>& exec,
|
| 44 |
+
InputIterator begin,
|
| 45 |
+
InputIterator end,
|
| 46 |
+
OutputType init,
|
| 47 |
+
BinaryFunction binary_op);
|
| 48 |
+
|
| 49 |
+
} // end namespace detail
|
| 50 |
+
} // end namespace tbb
|
| 51 |
+
} // end namespace system
|
| 52 |
+
THRUST_NAMESPACE_END
|
| 53 |
+
|
| 54 |
+
#include <thrust/system/tbb/detail/reduce.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.inl
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/function.h>
|
| 29 |
+
#include <thrust/detail/static_assert.h>
|
| 30 |
+
#include <thrust/distance.h>
|
| 31 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 32 |
+
#include <thrust/reduce.h>
|
| 33 |
+
|
| 34 |
+
#include <tbb/blocked_range.h>
|
| 35 |
+
#include <tbb/parallel_reduce.h>
|
| 36 |
+
|
| 37 |
+
THRUST_NAMESPACE_BEGIN
|
| 38 |
+
namespace system
|
| 39 |
+
{
|
| 40 |
+
namespace tbb
|
| 41 |
+
{
|
| 42 |
+
namespace detail
|
| 43 |
+
{
|
| 44 |
+
namespace reduce_detail
|
| 45 |
+
{
|
| 46 |
+
|
| 47 |
+
template <typename RandomAccessIterator, typename OutputType, typename BinaryFunction>
|
| 48 |
+
struct body
|
| 49 |
+
{
|
| 50 |
+
RandomAccessIterator first;
|
| 51 |
+
OutputType sum;
|
| 52 |
+
bool first_call; // TBB can invoke operator() multiple times on the same body
|
| 53 |
+
thrust::detail::wrapped_function<BinaryFunction, OutputType> binary_op;
|
| 54 |
+
|
| 55 |
+
// note: we only initialize sum with init to avoid calling OutputType's default constructor
|
| 56 |
+
body(RandomAccessIterator first, OutputType init, BinaryFunction binary_op)
|
| 57 |
+
: first(first)
|
| 58 |
+
, sum(init)
|
| 59 |
+
, first_call(true)
|
| 60 |
+
, binary_op{binary_op}
|
| 61 |
+
{}
|
| 62 |
+
|
| 63 |
+
// note: we only initialize sum with b.sum to avoid calling OutputType's default constructor
|
| 64 |
+
body(body& b, ::tbb::split)
|
| 65 |
+
: first(b.first)
|
| 66 |
+
, sum(b.sum)
|
| 67 |
+
, first_call(true)
|
| 68 |
+
, binary_op{b.binary_op}
|
| 69 |
+
{}
|
| 70 |
+
|
| 71 |
+
template <typename Size>
|
| 72 |
+
void operator()(const ::tbb::blocked_range<Size>& r)
|
| 73 |
+
{
|
| 74 |
+
// we assume that blocked_range specifies a contiguous range of integers
|
| 75 |
+
|
| 76 |
+
if (r.empty())
|
| 77 |
+
{
|
| 78 |
+
return; // nothing to do
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
RandomAccessIterator iter = first + r.begin();
|
| 82 |
+
|
| 83 |
+
OutputType temp = thrust::raw_reference_cast(*iter);
|
| 84 |
+
|
| 85 |
+
++iter;
|
| 86 |
+
|
| 87 |
+
for (Size i = r.begin() + 1; i != r.end(); ++i, ++iter)
|
| 88 |
+
{
|
| 89 |
+
temp = binary_op(temp, *iter);
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
if (first_call)
|
| 93 |
+
{
|
| 94 |
+
// first time body has been invoked
|
| 95 |
+
first_call = false;
|
| 96 |
+
sum = temp;
|
| 97 |
+
}
|
| 98 |
+
else
|
| 99 |
+
{
|
| 100 |
+
// body has been previously invoked, accumulate temp into sum
|
| 101 |
+
sum = binary_op(sum, temp);
|
| 102 |
+
}
|
| 103 |
+
} // end operator()()
|
| 104 |
+
|
| 105 |
+
void join(body& b)
|
| 106 |
+
{
|
| 107 |
+
sum = binary_op(sum, b.sum);
|
| 108 |
+
}
|
| 109 |
+
}; // end body
|
| 110 |
+
|
| 111 |
+
} // namespace reduce_detail
|
| 112 |
+
|
| 113 |
+
template <typename DerivedPolicy, typename InputIterator, typename OutputType, typename BinaryFunction>
|
| 114 |
+
OutputType reduce(
|
| 115 |
+
execution_policy<DerivedPolicy>&, InputIterator begin, InputIterator end, OutputType init, BinaryFunction binary_op)
|
| 116 |
+
{
|
| 117 |
+
using Size = typename thrust::iterator_difference<InputIterator>::type;
|
| 118 |
+
|
| 119 |
+
Size n = thrust::distance(begin, end);
|
| 120 |
+
|
| 121 |
+
if (n == 0)
|
| 122 |
+
{
|
| 123 |
+
return init;
|
| 124 |
+
}
|
| 125 |
+
else
|
| 126 |
+
{
|
| 127 |
+
using Body = typename reduce_detail::body<InputIterator, OutputType, BinaryFunction>;
|
| 128 |
+
Body reduce_body(begin, init, binary_op);
|
| 129 |
+
::tbb::parallel_reduce(::tbb::blocked_range<Size>(0, n), reduce_body);
|
| 130 |
+
return binary_op(init, reduce_body.sum);
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
} // end namespace detail
|
| 135 |
+
} // end namespace tbb
|
| 136 |
+
} // end namespace system
|
| 137 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_by_key.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/pair.h>
|
| 29 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace system
|
| 33 |
+
{
|
| 34 |
+
namespace tbb
|
| 35 |
+
{
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
|
| 39 |
+
template <typename DerivedPolicy,
|
| 40 |
+
typename InputIterator1,
|
| 41 |
+
typename InputIterator2,
|
| 42 |
+
typename OutputIterator1,
|
| 43 |
+
typename OutputIterator2,
|
| 44 |
+
typename BinaryPredicate,
|
| 45 |
+
typename BinaryFunction>
|
| 46 |
+
thrust::pair<OutputIterator1, OutputIterator2> reduce_by_key(
|
| 47 |
+
execution_policy<DerivedPolicy>& exec,
|
| 48 |
+
InputIterator1 keys_first,
|
| 49 |
+
InputIterator1 keys_last,
|
| 50 |
+
InputIterator2 values_first,
|
| 51 |
+
OutputIterator1 keys_output,
|
| 52 |
+
OutputIterator2 values_output,
|
| 53 |
+
BinaryPredicate binary_pred,
|
| 54 |
+
BinaryFunction binary_op);
|
| 55 |
+
|
| 56 |
+
} // end namespace detail
|
| 57 |
+
} // end namespace tbb
|
| 58 |
+
} // end namespace system
|
| 59 |
+
THRUST_NAMESPACE_END
|
| 60 |
+
|
| 61 |
+
#include <thrust/system/tbb/detail/reduce_by_key.inl>
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_intervals.h
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/minmax.h>
|
| 29 |
+
#include <thrust/detail/seq.h>
|
| 30 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 31 |
+
#include <thrust/reduce.h>
|
| 32 |
+
#include <thrust/system/cpp/memory.h>
|
| 33 |
+
#include <thrust/system/tbb/detail/execution_policy.h>
|
| 34 |
+
|
| 35 |
+
#include <cassert>
|
| 36 |
+
#include <type_traits>
|
| 37 |
+
|
| 38 |
+
#include <tbb/parallel_for.h>
|
| 39 |
+
|
| 40 |
+
THRUST_NAMESPACE_BEGIN
|
| 41 |
+
namespace system
|
| 42 |
+
{
|
| 43 |
+
namespace tbb
|
| 44 |
+
{
|
| 45 |
+
namespace detail
|
| 46 |
+
{
|
| 47 |
+
namespace reduce_intervals_detail
|
| 48 |
+
{
|
| 49 |
+
|
| 50 |
+
template <typename L, typename R>
|
| 51 |
+
inline L divide_ri(const L x, const R y)
|
| 52 |
+
{
|
| 53 |
+
return (x + (y - 1)) / y;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
template <typename RandomAccessIterator1, typename RandomAccessIterator2, typename Size, typename BinaryFunction>
|
| 57 |
+
struct body
|
| 58 |
+
{
|
| 59 |
+
RandomAccessIterator1 first;
|
| 60 |
+
RandomAccessIterator2 result;
|
| 61 |
+
Size n, interval_size;
|
| 62 |
+
BinaryFunction binary_op;
|
| 63 |
+
|
| 64 |
+
body(RandomAccessIterator1 first, RandomAccessIterator2 result, Size n, Size interval_size, BinaryFunction binary_op)
|
| 65 |
+
: first(first)
|
| 66 |
+
, result(result)
|
| 67 |
+
, n(n)
|
| 68 |
+
, interval_size(interval_size)
|
| 69 |
+
, binary_op(binary_op)
|
| 70 |
+
{}
|
| 71 |
+
|
| 72 |
+
void operator()(const ::tbb::blocked_range<Size>& r) const
|
| 73 |
+
{
|
| 74 |
+
assert(r.size() == 1);
|
| 75 |
+
|
| 76 |
+
Size interval_idx = r.begin();
|
| 77 |
+
|
| 78 |
+
Size offset_to_first = interval_size * interval_idx;
|
| 79 |
+
Size offset_to_last = (thrust::min)(n, offset_to_first + interval_size);
|
| 80 |
+
|
| 81 |
+
RandomAccessIterator1 my_first = first + offset_to_first;
|
| 82 |
+
RandomAccessIterator1 my_last = first + offset_to_last;
|
| 83 |
+
|
| 84 |
+
// carefully pass the init value for the interval with raw_reference_cast
|
| 85 |
+
using sum_type = typename std::decay<decltype(binary_op(*my_first, *my_first))>::type;
|
| 86 |
+
result[interval_idx] =
|
| 87 |
+
thrust::reduce(thrust::seq, my_first + 1, my_last, sum_type(thrust::raw_reference_cast(*my_first)), binary_op);
|
| 88 |
+
}
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
template <typename RandomAccessIterator1, typename RandomAccessIterator2, typename Size, typename BinaryFunction>
|
| 92 |
+
body<RandomAccessIterator1, RandomAccessIterator2, Size, BinaryFunction> make_body(
|
| 93 |
+
RandomAccessIterator1 first, RandomAccessIterator2 result, Size n, Size interval_size, BinaryFunction binary_op)
|
| 94 |
+
{
|
| 95 |
+
return body<RandomAccessIterator1, RandomAccessIterator2, Size, BinaryFunction>(
|
| 96 |
+
first, result, n, interval_size, binary_op);
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
} // namespace reduce_intervals_detail
|
| 100 |
+
|
| 101 |
+
template <typename DerivedPolicy,
|
| 102 |
+
typename RandomAccessIterator1,
|
| 103 |
+
typename Size,
|
| 104 |
+
typename RandomAccessIterator2,
|
| 105 |
+
typename BinaryFunction>
|
| 106 |
+
void reduce_intervals(
|
| 107 |
+
thrust::tbb::execution_policy<DerivedPolicy>&,
|
| 108 |
+
RandomAccessIterator1 first,
|
| 109 |
+
RandomAccessIterator1 last,
|
| 110 |
+
Size interval_size,
|
| 111 |
+
RandomAccessIterator2 result,
|
| 112 |
+
BinaryFunction binary_op)
|
| 113 |
+
{
|
| 114 |
+
typename thrust::iterator_difference<RandomAccessIterator1>::type n = last - first;
|
| 115 |
+
|
| 116 |
+
Size num_intervals = reduce_intervals_detail::divide_ri(n, interval_size);
|
| 117 |
+
|
| 118 |
+
::tbb::parallel_for(::tbb::blocked_range<Size>(0, num_intervals, 1),
|
| 119 |
+
reduce_intervals_detail::make_body(first, result, Size(n), interval_size, binary_op),
|
| 120 |
+
::tbb::simple_partitioner());
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
template <typename DerivedPolicy, typename RandomAccessIterator1, typename Size, typename RandomAccessIterator2>
|
| 124 |
+
void reduce_intervals(
|
| 125 |
+
thrust::tbb::execution_policy<DerivedPolicy>& exec,
|
| 126 |
+
RandomAccessIterator1 first,
|
| 127 |
+
RandomAccessIterator1 last,
|
| 128 |
+
Size interval_size,
|
| 129 |
+
RandomAccessIterator2 result)
|
| 130 |
+
{
|
| 131 |
+
using value_type = typename thrust::iterator_value<RandomAccessIterator1>::type;
|
| 132 |
+
|
| 133 |
+
return thrust::system::tbb::detail::reduce_intervals(
|
| 134 |
+
exec, first, last, interval_size, result, thrust::plus<value_type>());
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
} // namespace detail
|
| 138 |
+
} // namespace tbb
|
| 139 |
+
} // namespace system
|
| 140 |
+
THRUST_NAMESPACE_END
|
vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/system/omp/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace system
|
| 32 |
+
{
|
| 33 |
+
namespace omp
|
| 34 |
+
{
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename ExecutionPolicy, typename ForwardIterator, typename Predicate>
|
| 39 |
+
ForwardIterator
|
| 40 |
+
remove_if(execution_policy<ExecutionPolicy>& exec, ForwardIterator first, ForwardIterator last, Predicate pred);
|
| 41 |
+
|
| 42 |
+
template <typename ExecutionPolicy, typename ForwardIterator, typename InputIterator, typename Predicate>
|
| 43 |
+
ForwardIterator remove_if(
|
| 44 |
+
execution_policy<ExecutionPolicy>& exec,
|
| 45 |
+
ForwardIterator first,
|
| 46 |
+
ForwardIterator last,
|
| 47 |
+
InputIterator stencil,
|
| 48 |
+
Predicate pred);
|
| 49 |
+
|
| 50 |
+
template <typename ExecutionPolicy, typename InputIterator, typename OutputIterator, typename Predicate>
|
| 51 |
+
OutputIterator remove_copy_if(
|
| 52 |
+
execution_policy<ExecutionPolicy>& exec,
|
| 53 |
+
InputIterator first,
|
| 54 |
+
InputIterator last,
|
| 55 |
+
OutputIterator result,
|
| 56 |
+
Predicate pred);
|
| 57 |
+
|
| 58 |
+
template <typename ExecutionPolicy,
|
| 59 |
+
typename InputIterator1,
|
| 60 |
+
typename InputIterator2,
|
| 61 |
+
typename OutputIterator,
|
| 62 |
+
typename Predicate>
|
| 63 |
+
OutputIterator remove_copy_if(
|
| 64 |
+
execution_policy<ExecutionPolicy>& exec,
|
| 65 |
+
InputIterator1 first,
|
| 66 |
+
InputIterator1 last,
|
| 67 |
+
InputIterator2 stencil,
|
| 68 |
+
OutputIterator result,
|
| 69 |
+
Predicate pred);
|
| 70 |
+
|
| 71 |
+
} // end namespace detail
|
| 72 |
+
} // end namespace omp
|
| 73 |
+
} // end namespace system
|
| 74 |
+
THRUST_NAMESPACE_END
|
| 75 |
+
|
| 76 |
+
#include <thrust/system/tbb/detail/remove.inl>
|