diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/assign_value.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/assign_value.h new file mode 100644 index 0000000000000000000000000000000000000000..ae23da2846c07f74fb396bd7f64f3ef1521b9f0b --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/assign_value.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits assign_value +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/extrema.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/extrema.h new file mode 100644 index 0000000000000000000000000000000000000000..170f9530908f2140956aa418206f1807662fd254 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/extrema.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits extrema algorithms +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/inner_product.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/inner_product.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/inner_product.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/memory.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/memory.inl new file mode 100644 index 0000000000000000000000000000000000000000..ab6976b48a7e5fd84baa89979041c987eaabcfc7 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/memory.inl @@ -0,0 +1,60 @@ +/* + * Copyright 2008-2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace cpp +{ + +pointer malloc(std::size_t n) +{ + tag t; + return pointer(thrust::system::detail::sequential::malloc(t, n)); +} // end malloc() + +template +pointer malloc(std::size_t n) +{ + pointer raw_ptr = thrust::system::cpp::malloc(sizeof(T) * n); + return pointer(reinterpret_cast(raw_ptr.get())); +} // end malloc() + +void free(pointer ptr) +{ + tag t; + return thrust::system::detail::sequential::free(t, ptr); +} // end free() + +} // namespace cpp +} // namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/mismatch.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/mismatch.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/mismatch.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/par.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/par.h new file mode 100644 index 0000000000000000000000000000000000000000..162f51215aadf9f14639322b1fbe6edf8f9a7469 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/par.h @@ -0,0 +1,62 @@ +/* + * Copyright 2008-2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace cpp +{ +namespace detail +{ + +struct par_t + : thrust::system::cpp::detail::execution_policy + , thrust::detail::allocator_aware_execution_policy +{ + _CCCL_HOST_DEVICE constexpr par_t() + : thrust::system::cpp::detail::execution_policy() + {} +}; + +} // namespace detail + +_CCCL_GLOBAL_CONSTANT detail::par_t par; + +} // namespace cpp +} // namespace system + +// alias par here +namespace cpp +{ + +using thrust::system::cpp::par; + +} // namespace cpp +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/reduce_by_key.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/reduce_by_key.h new file mode 100644 index 0000000000000000000000000000000000000000..f08d9e6c05b0ad70cb527aec59815ee52650f0cf --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/reduce_by_key.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits reduce_by_key +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/remove.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/remove.h new file mode 100644 index 0000000000000000000000000000000000000000..fb230bd4814ba53b3b38079d71b1f63d2cfa9f5a --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/remove.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits remove +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/replace.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/replace.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/replace.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan.h new file mode 100644 index 0000000000000000000000000000000000000000..0fb9cb32ae79db62973760dc7ee11bc06bddf6cb --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits scan +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan_by_key.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan_by_key.h new file mode 100644 index 0000000000000000000000000000000000000000..301675dacf5e9cd57dde9c9d20d7de8beb78b968 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scan_by_key.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits the scan_by_key algorithms +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scatter.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scatter.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/scatter.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/sort.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/sort.h new file mode 100644 index 0000000000000000000000000000000000000000..6aa946c6f1dadbabb6139e8849925b75f59f5e28 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/sort.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits sort +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform.h new file mode 100644 index 0000000000000000000000000000000000000000..4368a4f348a36f995f7d66dc4bfd18cb463cb46e --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// cpp has no special transform diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_reduce.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_reduce.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_reduce.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_scan.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_scan.h new file mode 100644 index 0000000000000000000000000000000000000000..0968d886dc52f20a71c2cdb4d68a8a6d524dd053 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/detail/transform_scan.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special version of this algorithm diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/pointer.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/pointer.h new file mode 100644 index 0000000000000000000000000000000000000000..04963e2cf618de3a6ee6c565ca76abe8a0141c5e --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/cpp/pointer.h @@ -0,0 +1,119 @@ +/* + * Copyright 2008-2020 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//! \file +//! Managing memory associated with Thrust's TBB system. + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace cpp +{ + +/*! \p cpp::pointer stores a pointer to an object allocated in memory accessible + * by the \p cpp system. This type provides type safety when dispatching + * algorithms on ranges resident in \p cpp memory. + * + * \p cpp::pointer has pointer semantics: it may be dereferenced and + * manipulated with pointer arithmetic. + * + * \p cpp::pointer can be created with the function \p cpp::malloc, or by + * explicitly calling its constructor with a raw pointer. + * + * The raw pointer encapsulated by a \p cpp::pointer may be obtained by either its + * get member function or the \p raw_pointer_cast function. + * + * \note \p cpp::pointer is not a "smart" pointer; it is the programmer's + * responsibility to deallocate memory pointed to by \p cpp::pointer. + * + * \tparam T specifies the type of the pointee. + * + * \see cpp::malloc + * \see cpp::free + * \see raw_pointer_cast + */ +template +using pointer = thrust::pointer>; + +/*! \p cpp::universal_pointer stores a pointer to an object allocated in memory + * accessible by the \p cpp system and host systems. + * + * \p cpp::universal_pointer has pointer semantics: it may be dereferenced and + * manipulated with pointer arithmetic. + * + * \p cpp::universal_pointer can be created with \p cpp::universal_allocator + * or by explicitly calling its constructor with a raw pointer. + * + * The raw pointer encapsulated by a \p cpp::universal_pointer may be obtained + * by either its get member function or the \p raw_pointer_cast + * function. + * + * \note \p cpp::universal_pointer is not a "smart" pointer; it is the + * programmer's responsibility to deallocate memory pointed to by + * \p cpp::universal_pointer. + * + * \tparam T specifies the type of the pointee. + * + * \see cpp::universal_allocator + * \see raw_pointer_cast + */ +template +using universal_pointer = thrust::pointer::type>; + +/*! \p reference is a wrapped reference to an object stored in memory available + * to the \p cpp system. \p reference is the type of the result of + * dereferencing a \p cpp::pointer. + * + * \tparam T Specifies the type of the referenced object. + */ +template +using reference = thrust::reference; + +} // namespace cpp +} // namespace system + +/*! \addtogroup system_backends Systems + * \ingroup system + * \{ + */ + +/*! \namespace thrust::cpp + * \brief \p thrust::cpp is a top-level alias for \p thrust::system::cpp. */ +namespace cpp +{ +using thrust::system::cpp::pointer; +using thrust::system::cpp::reference; +using thrust::system::cpp::universal_pointer; +} // namespace cpp + +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/detail/sequential/find.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/detail/sequential/find.h new file mode 100644 index 0000000000000000000000000000000000000000..4edee4e621cb34288d0d51521096dab6573ba836 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/detail/sequential/find.h @@ -0,0 +1,68 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file find.h + * \brief Sequential implementation of find_if. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace detail +{ +namespace sequential +{ + +_CCCL_EXEC_CHECK_DISABLE +template +_CCCL_HOST_DEVICE InputIterator +find_if(execution_policy&, InputIterator first, InputIterator last, Predicate pred) +{ + // wrap pred + thrust::detail::wrapped_function wrapped_pred{pred}; + + while (first != last) + { + if (wrapped_pred(*first)) + { + return first; + } + + ++first; + } + + // return first so zip_iterator works correctly + return first; +} + +} // end namespace sequential +} // end namespace detail +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/adjacent_difference.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/adjacent_difference.h new file mode 100644 index 0000000000000000000000000000000000000000..0ad22863b574dd25c16e78239ec3b4493b82bc36 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/adjacent_difference.h @@ -0,0 +1,54 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputIterator adjacent_difference( + execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator result, + BinaryFunction binary_op) +{ + // tbb prefers generic::adjacent_difference to cpp::adjacent_difference + return thrust::system::detail::generic::adjacent_difference(exec, first, last, result, binary_op); +} // end adjacent_difference() + +} // namespace detail +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/assign_value.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/assign_value.h new file mode 100644 index 0000000000000000000000000000000000000000..7b95165e7480a496d5929572cb058092df2146c3 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/assign_value.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits assign_value +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/binary_search.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/binary_search.h new file mode 100644 index 0000000000000000000000000000000000000000..5596b7cc3caad665683ed39293edff48103bef91 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/binary_search.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits binary_search +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.h new file mode 100644 index 0000000000000000000000000000000000000000..6594c2beb163d199ccc20653df0915c3e8e4ede2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.h @@ -0,0 +1,50 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputIterator +copy(execution_policy& exec, InputIterator first, InputIterator last, OutputIterator result); + +template +OutputIterator copy_n(execution_policy& exec, InputIterator first, Size n, OutputIterator result); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.inl new file mode 100644 index 0000000000000000000000000000000000000000..6afb9b69e4bb7b56872705b9a03f44fea274ffdb --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy.inl @@ -0,0 +1,118 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace dispatch +{ + +template +OutputIterator +copy(execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator result, + thrust::incrementable_traversal_tag) +{ + return thrust::system::detail::sequential::copy(exec, first, last, result); +} // end copy() + +template +OutputIterator +copy(execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator result, + thrust::random_access_traversal_tag) +{ + return thrust::system::detail::generic::copy(exec, first, last, result); +} // end copy() + +template +OutputIterator +copy_n(execution_policy& exec, + InputIterator first, + Size n, + OutputIterator result, + thrust::incrementable_traversal_tag) +{ + return thrust::system::detail::sequential::copy_n(exec, first, n, result); +} // end copy_n() + +template +OutputIterator +copy_n(execution_policy& exec, + InputIterator first, + Size n, + OutputIterator result, + thrust::random_access_traversal_tag) +{ + return thrust::system::detail::generic::copy_n(exec, first, n, result); +} // end copy_n() + +} // namespace dispatch + +template +OutputIterator +copy(execution_policy& exec, InputIterator first, InputIterator last, OutputIterator result) +{ + using traversal1 = typename thrust::iterator_traversal::type; + using traversal2 = typename thrust::iterator_traversal::type; + + using traversal = typename thrust::detail::minimum_type::type; + + // dispatch on minimum traversal + return thrust::system::tbb::detail::dispatch::copy(exec, first, last, result, traversal()); +} // end copy() + +template +OutputIterator copy_n(execution_policy& exec, InputIterator first, Size n, OutputIterator result) +{ + using traversal1 = typename thrust::iterator_traversal::type; + using traversal2 = typename thrust::iterator_traversal::type; + + using traversal = typename thrust::detail::minimum_type::type; + + // dispatch on minimum traversal + return thrust::system::tbb::detail::dispatch::copy_n(exec, first, n, result, traversal()); +} // end copy_n() + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy_if.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy_if.h new file mode 100644 index 0000000000000000000000000000000000000000..a84605103e89cc80b14ac596787b12d43be79e62 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/copy_if.h @@ -0,0 +1,47 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputIterator +copy_if(tag, InputIterator1 first, InputIterator1 last, InputIterator2 stencil, OutputIterator result, Predicate pred); + +} // namespace detail +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/count.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/count.h new file mode 100644 index 0000000000000000000000000000000000000000..2258d8a4a339b86a7b16d6ed229c9239ef19984c --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/count.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits count +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/equal.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/equal.h new file mode 100644 index 0000000000000000000000000000000000000000..e2eee998de4f50b60a72c78f1bd0ccfec8264a88 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/equal.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits equal +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/execution_policy.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/execution_policy.h new file mode 100644 index 0000000000000000000000000000000000000000..e173a06343042d7d79fd4e02ffaa57d41b0ffbbf --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/execution_policy.h @@ -0,0 +1,92 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +// put the canonical tag in the same ns as the backend's entry points +namespace tbb +{ +namespace detail +{ + +// this awkward sequence of definitions arise +// from the desire both for tag to derive +// from execution_policy and for execution_policy +// to convert to tag (when execution_policy is not +// an ancestor of tag) + +// forward declaration of tag +struct tag; + +// forward declaration of execution_policy +template +struct execution_policy; + +// specialize execution_policy for tag +template <> +struct execution_policy : thrust::system::cpp::detail::execution_policy +{}; + +// tag's definition comes before the +// generic definition of execution_policy +struct tag : execution_policy +{}; + +// allow conversion to tag when it is not a successor +template +struct execution_policy : thrust::system::cpp::detail::execution_policy +{ + using tag_type = tag; + operator tag() const + { + return tag(); + } +}; + +} // namespace detail + +// alias execution_policy and tag here +using thrust::system::tbb::detail::execution_policy; +using thrust::system::tbb::detail::tag; + +} // namespace tbb +} // namespace system + +// alias items at top-level +namespace tbb +{ + +using thrust::system::tbb::execution_policy; +using thrust::system::tbb::tag; + +} // namespace tbb +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/extrema.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/extrema.h new file mode 100644 index 0000000000000000000000000000000000000000..8e891833cca731d9a3de9d3cf122503a4766ddd9 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/extrema.h @@ -0,0 +1,66 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +ForwardIterator +max_element(execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) +{ + // tbb prefers generic::max_element to cpp::max_element + return thrust::system::detail::generic::max_element(exec, first, last, comp); +} // end max_element() + +template +ForwardIterator +min_element(execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) +{ + // tbb prefers generic::min_element to cpp::min_element + return thrust::system::detail::generic::min_element(exec, first, last, comp); +} // end min_element() + +template +thrust::pair +minmax_element(execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate comp) +{ + // tbb prefers generic::minmax_element to cpp::minmax_element + return thrust::system::detail::generic::minmax_element(exec, first, last, comp); +} // end minmax_element() + +} // namespace detail +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/fill.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/fill.h new file mode 100644 index 0000000000000000000000000000000000000000..d8cfca51b1df887e988cf683c04990e4083f88d8 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/fill.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits fill +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.h new file mode 100644 index 0000000000000000000000000000000000000000..04b2cf37adfa06b96c293e9dbe13e7ad22725583 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.h @@ -0,0 +1,51 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +RandomAccessIterator +for_each(execution_policy& exec, RandomAccessIterator first, RandomAccessIterator last, UnaryFunction f); + +template +RandomAccessIterator +for_each_n(execution_policy& exec, RandomAccessIterator first, Size n, UnaryFunction f); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.inl new file mode 100644 index 0000000000000000000000000000000000000000..0a0a12e1eaff8dbeff00c4786174f1d8c2ca6dcd --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/for_each.inl @@ -0,0 +1,91 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include + +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace for_each_detail +{ + +template +struct body +{ + RandomAccessIterator m_first; + UnaryFunction m_f; + + body(RandomAccessIterator first, UnaryFunction f) + : m_first(first) + , m_f(f) + {} + + void operator()(const ::tbb::blocked_range& r) const + { + // we assume that blocked_range specifies a contiguous range of integers + thrust::for_each_n(thrust::system::detail::sequential::seq, m_first + r.begin(), r.size(), m_f); + } // end operator()() +}; // end body + +template +body make_body(RandomAccessIterator first, UnaryFunction f) +{ + return body(first, f); +} // end make_body() + +} // namespace for_each_detail + +template +RandomAccessIterator for_each_n(execution_policy&, RandomAccessIterator first, Size n, UnaryFunction f) +{ + ::tbb::parallel_for(::tbb::blocked_range(0, n), for_each_detail::make_body(first, f)); + + // return the end of the range + return first + n; +} // end for_each_n + +template +RandomAccessIterator +for_each(execution_policy& s, RandomAccessIterator first, RandomAccessIterator last, UnaryFunction f) +{ + return tbb::detail::for_each_n(s, first, thrust::distance(first, last), f); +} // end for_each() + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/gather.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/gather.h new file mode 100644 index 0000000000000000000000000000000000000000..13d2569f31e14e57a1fa6de3b0b16616bfa73788 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/gather.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits gather +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/generate.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/generate.h new file mode 100644 index 0000000000000000000000000000000000000000..3132859d07ff1ec2fe94892e9bca70243c876021 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/generate.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits generate +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/get_value.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/get_value.h new file mode 100644 index 0000000000000000000000000000000000000000..6a2607e57c9390a6b40367b61b94eb500e4ba46a --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/get_value.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits get_value +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/inner_product.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/inner_product.h new file mode 100644 index 0000000000000000000000000000000000000000..8abc2f44ef61c801af08ff031978ac3273da86f2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/inner_product.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits inner_product +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/logical.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/logical.h new file mode 100644 index 0000000000000000000000000000000000000000..4b1168fc8e0976fb91badb52d135dfb0b263b2c1 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/logical.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits logical +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/malloc_and_free.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/malloc_and_free.h new file mode 100644 index 0000000000000000000000000000000000000000..a4b98b61ebd95462bae4007aee7beeae672a2a21 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/malloc_and_free.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits malloc and free +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/memory.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/memory.inl new file mode 100644 index 0000000000000000000000000000000000000000..3c0f4c661ff19fc25d55045bbf05e178278ff8b6 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/memory.inl @@ -0,0 +1,94 @@ +/* + * Copyright 2008-2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ + +namespace detail +{ + +// XXX circular #inclusion problems cause the compiler to believe that cpp::malloc +// is not defined +// WAR the problem by using adl to call cpp::malloc, which requires it to depend +// on a template parameter +template +pointer malloc_workaround(Tag t, std::size_t n) +{ + return pointer(malloc(t, n)); +} // end malloc_workaround() + +// XXX circular #inclusion problems cause the compiler to believe that cpp::free +// is not defined +// WAR the problem by using adl to call cpp::free, which requires it to depend +// on a template parameter +template +void free_workaround(Tag t, pointer ptr) +{ + free(t, ptr.get()); +} // end free_workaround() + +} // namespace detail + +inline pointer malloc(std::size_t n) +{ + // XXX this is how we'd like to implement this function, + // if not for circular #inclusion problems: + // + // return pointer(thrust::system::cpp::malloc(n)) + // + return detail::malloc_workaround(cpp::tag(), n); +} // end malloc() + +template +pointer malloc(std::size_t n) +{ + pointer raw_ptr = thrust::system::tbb::malloc(sizeof(T) * n); + return pointer(reinterpret_cast(raw_ptr.get())); +} // end malloc() + +inline void free(pointer ptr) +{ + // XXX this is how we'd like to implement this function, + // if not for circular #inclusion problems: + // + // thrust::system::cpp::free(ptr) + // + detail::free_workaround(cpp::tag(), ptr); +} // end free() + +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.h new file mode 100644 index 0000000000000000000000000000000000000000..f99cab61248554e7fa5139ecce4993f21434585e --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.h @@ -0,0 +1,77 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputIterator +merge(execution_policy& exec, + InputIterator1 first1, + InputIterator1 last1, + InputIterator2 first2, + InputIterator2 last2, + OutputIterator result, + StrictWeakOrdering comp); + +template +thrust::pair merge_by_key( + execution_policy& exec, + InputIterator1 keys_first1, + InputIterator1 keys_last1, + InputIterator2 keys_first2, + InputIterator2 keys_last2, + InputIterator3 values_first3, + InputIterator4 values_first4, + OutputIterator1 keys_result, + OutputIterator2 values_result, + StrictWeakOrdering comp); + +} // namespace detail +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.inl new file mode 100644 index 0000000000000000000000000000000000000000..4d793c9eb7b84f8819fc995f42af3c9362aab0c9 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/merge.inl @@ -0,0 +1,323 @@ +/* + * Copyright 2008-2021 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +#include +#include +#include +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace merge_detail +{ + +template +struct range +{ + InputIterator1 first1, last1; + InputIterator2 first2, last2; + OutputIterator result; + StrictWeakOrdering comp; + size_t grain_size; + + range(InputIterator1 first1, + InputIterator1 last1, + InputIterator2 first2, + InputIterator2 last2, + OutputIterator result, + StrictWeakOrdering comp, + size_t grain_size = 1024) + : first1(first1) + , last1(last1) + , first2(first2) + , last2(last2) + , result(result) + , comp(comp) + , grain_size(grain_size) + {} + + range(range& r, ::tbb::split) + : first1(r.first1) + , last1(r.last1) + , first2(r.first2) + , last2(r.last2) + , result(r.result) + , comp(r.comp) + , grain_size(r.grain_size) + { + // we can assume n1 and n2 are not both 0 + size_t n1 = thrust::distance(first1, last1); + size_t n2 = thrust::distance(first2, last2); + + InputIterator1 mid1 = first1; + InputIterator2 mid2 = first2; + + if (n1 > n2) + { + mid1 += n1 / 2; + mid2 = thrust::lower_bound(thrust::seq, first2, last2, raw_reference_cast(*mid1), comp); + } + else + { + mid2 += n2 / 2; + mid1 = thrust::upper_bound(thrust::seq, first1, last1, raw_reference_cast(*mid2), comp); + } + + // set first range to [first1, mid1), [first2, mid2), result + r.last1 = mid1; + r.last2 = mid2; + + // set second range to [mid1, last1), [mid2, last2), result + (mid1 - first1) + (mid2 - first2) + first1 = mid1; + first2 = mid2; + result += thrust::distance(r.first1, mid1) + thrust::distance(r.first2, mid2); + } + + bool empty() const + { + return (first1 == last1) && (first2 == last2); + } + + bool is_divisible() const + { + return static_cast(thrust::distance(first1, last1) + thrust::distance(first2, last2)) > grain_size; + } +}; + +struct body +{ + template + void operator()(Range& r) const + { + thrust::merge(thrust::seq, r.first1, r.last1, r.first2, r.last2, r.result, r.comp); + } +}; + +} // end namespace merge_detail + +namespace merge_by_key_detail +{ + +template +struct range +{ + InputIterator1 keys_first1, keys_last1; + InputIterator2 keys_first2, keys_last2; + InputIterator3 values_first1; + InputIterator4 values_first2; + OutputIterator1 keys_result; + OutputIterator2 values_result; + StrictWeakOrdering comp; + size_t grain_size; + + range(InputIterator1 keys_first1, + InputIterator1 keys_last1, + InputIterator2 keys_first2, + InputIterator2 keys_last2, + InputIterator3 values_first1, + InputIterator4 values_first2, + OutputIterator1 keys_result, + OutputIterator2 values_result, + StrictWeakOrdering comp, + size_t grain_size = 1024) + : keys_first1(keys_first1) + , keys_last1(keys_last1) + , keys_first2(keys_first2) + , keys_last2(keys_last2) + , values_first1(values_first1) + , values_first2(values_first2) + , keys_result(keys_result) + , values_result(values_result) + , comp(comp) + , grain_size(grain_size) + {} + + range(range& r, ::tbb::split) + : keys_first1(r.keys_first1) + , keys_last1(r.keys_last1) + , keys_first2(r.keys_first2) + , keys_last2(r.keys_last2) + , values_first1(r.values_first1) + , values_first2(r.values_first2) + , keys_result(r.keys_result) + , values_result(r.values_result) + , comp(r.comp) + , grain_size(r.grain_size) + { + // we can assume n1 and n2 are not both 0 + size_t n1 = thrust::distance(keys_first1, keys_last1); + size_t n2 = thrust::distance(keys_first2, keys_last2); + + InputIterator1 mid1 = keys_first1; + InputIterator2 mid2 = keys_first2; + + if (n1 > n2) + { + mid1 += n1 / 2; + mid2 = thrust::lower_bound(thrust::seq, keys_first2, keys_last2, raw_reference_cast(*mid1), comp); + } + else + { + mid2 += n2 / 2; + mid1 = thrust::upper_bound(thrust::seq, keys_first1, keys_last1, raw_reference_cast(*mid2), comp); + } + + // set first range to [keys_first1, mid1), [keys_first2, mid2), keys_result, values_result + r.keys_last1 = mid1; + r.keys_last2 = mid2; + + // set second range to [mid1, keys_last1), [mid2, keys_last2), keys_result + (mid1 - keys_first1) + (mid2 - + // keys_first2), values_result + (mid1 - keys_first1) + (mid2 - keys_first2) + keys_first1 = mid1; + keys_first2 = mid2; + values_first1 += thrust::distance(r.keys_first1, mid1); + values_first2 += thrust::distance(r.keys_first2, mid2); + keys_result += thrust::distance(r.keys_first1, mid1) + thrust::distance(r.keys_first2, mid2); + values_result += thrust::distance(r.keys_first1, mid1) + thrust::distance(r.keys_first2, mid2); + } + + bool empty() const + { + return (keys_first1 == keys_last1) && (keys_first2 == keys_last2); + } + + bool is_divisible() const + { + return static_cast(thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2)) + > grain_size; + } +}; + +struct body +{ + template + void operator()(Range& r) const + { + thrust::merge_by_key( + thrust::seq, + r.keys_first1, + r.keys_last1, + r.keys_first2, + r.keys_last2, + r.values_first1, + r.values_first2, + r.keys_result, + r.values_result, + r.comp); + } +}; + +} // end namespace merge_by_key_detail + +template +OutputIterator +merge(execution_policy&, + InputIterator1 first1, + InputIterator1 last1, + InputIterator2 first2, + InputIterator2 last2, + OutputIterator result, + StrictWeakOrdering comp) +{ + using Range = typename merge_detail::range; + using Body = merge_detail::body; + Range range(first1, last1, first2, last2, result, comp); + Body body; + + ::tbb::parallel_for(range, body); + + thrust::advance(result, thrust::distance(first1, last1) + thrust::distance(first2, last2)); + + return result; +} // end merge() + +template +thrust::pair merge_by_key( + execution_policy&, + InputIterator1 keys_first1, + InputIterator1 keys_last1, + InputIterator2 keys_first2, + InputIterator2 keys_last2, + InputIterator3 values_first3, + InputIterator4 values_first4, + OutputIterator1 keys_result, + OutputIterator2 values_result, + StrictWeakOrdering comp) +{ + using Range = typename merge_by_key_detail::range< + InputIterator1, + InputIterator2, + InputIterator3, + InputIterator4, + OutputIterator1, + OutputIterator2, + StrictWeakOrdering>; + using Body = merge_by_key_detail::body; + + Range range( + keys_first1, keys_last1, keys_first2, keys_last2, values_first3, values_first4, keys_result, values_result, comp); + Body body; + + ::tbb::parallel_for(range, body); + + thrust::advance(keys_result, thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2)); + thrust::advance(values_result, thrust::distance(keys_first1, keys_last1) + thrust::distance(keys_first2, keys_last2)); + + return thrust::make_pair(keys_result, values_result); +} + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/mismatch.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/mismatch.h new file mode 100644 index 0000000000000000000000000000000000000000..c6e447e8657fcb59a27789383ab483f5d05e9455 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/mismatch.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits mismatch +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/par.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/par.h new file mode 100644 index 0000000000000000000000000000000000000000..29e18d6b25426304913d96d0f8b837ed5daa4649 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/par.h @@ -0,0 +1,62 @@ +/* + * Copyright 2008-2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +struct par_t + : thrust::system::tbb::detail::execution_policy + , thrust::detail::allocator_aware_execution_policy +{ + _CCCL_HOST_DEVICE constexpr par_t() + : thrust::system::tbb::detail::execution_policy() + {} +}; + +} // namespace detail + +static const detail::par_t par; + +} // namespace tbb +} // namespace system + +// alias par here +namespace tbb +{ + +using thrust::system::tbb::par; + +} // namespace tbb +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.h new file mode 100644 index 0000000000000000000000000000000000000000..2edef271f9c9d40726ca3d187450577d0a998659 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.h @@ -0,0 +1,84 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +ForwardIterator +stable_partition(execution_policy& exec, ForwardIterator first, ForwardIterator last, Predicate pred); + +template +ForwardIterator stable_partition( + execution_policy& exec, + ForwardIterator first, + ForwardIterator last, + InputIterator stencil, + Predicate pred); + +template +thrust::pair stable_partition_copy( + execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator1 out_true, + OutputIterator2 out_false, + Predicate pred); + +template +thrust::pair stable_partition_copy( + execution_policy& exec, + InputIterator1 first, + InputIterator1 last, + InputIterator2 stencil, + OutputIterator1 out_true, + OutputIterator2 out_false, + Predicate pred); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.inl new file mode 100644 index 0000000000000000000000000000000000000000..2fec1e3637f3813617f79c774e89f0ca0509f77f --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/partition.inl @@ -0,0 +1,98 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +ForwardIterator +stable_partition(execution_policy& exec, ForwardIterator first, ForwardIterator last, Predicate pred) +{ + // tbb prefers generic::stable_partition to cpp::stable_partition + return thrust::system::detail::generic::stable_partition(exec, first, last, pred); +} // end stable_partition() + +template +ForwardIterator stable_partition( + execution_policy& exec, + ForwardIterator first, + ForwardIterator last, + InputIterator stencil, + Predicate pred) +{ + // tbb prefers generic::stable_partition to cpp::stable_partition + return thrust::system::detail::generic::stable_partition(exec, first, last, stencil, pred); +} // end stable_partition() + +template +thrust::pair stable_partition_copy( + execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator1 out_true, + OutputIterator2 out_false, + Predicate pred) +{ + // tbb prefers generic::stable_partition_copy to cpp::stable_partition_copy + return thrust::system::detail::generic::stable_partition_copy(exec, first, last, out_true, out_false, pred); +} // end stable_partition_copy() + +template +thrust::pair stable_partition_copy( + execution_policy& exec, + InputIterator1 first, + InputIterator1 last, + InputIterator2 stencil, + OutputIterator1 out_true, + OutputIterator2 out_false, + Predicate pred) +{ + // tbb prefers generic::stable_partition_copy to cpp::stable_partition_copy + return thrust::system::detail::generic::stable_partition_copy(exec, first, last, stencil, out_true, out_false, pred); +} // end stable_partition_copy() + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/per_device_resource.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/per_device_resource.h new file mode 100644 index 0000000000000000000000000000000000000000..f02fcfcdc3ffb035a21d9189dfa72f235ff82146 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/per_device_resource.h @@ -0,0 +1,29 @@ +/* + * Copyright 2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special per device resource functions diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.h new file mode 100644 index 0000000000000000000000000000000000000000..1af75a04dc33e611f35d3adc5c07dfd42b69c685 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.h @@ -0,0 +1,54 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file reduce.h + * \brief TBB implementation of reduce. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputType reduce(execution_policy& exec, + InputIterator begin, + InputIterator end, + OutputType init, + BinaryFunction binary_op); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.inl new file mode 100644 index 0000000000000000000000000000000000000000..3a45ab246cb9b56c1999ecfceb8bc93e87aa8eb2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce.inl @@ -0,0 +1,137 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include +#include + +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace reduce_detail +{ + +template +struct body +{ + RandomAccessIterator first; + OutputType sum; + bool first_call; // TBB can invoke operator() multiple times on the same body + thrust::detail::wrapped_function binary_op; + + // note: we only initialize sum with init to avoid calling OutputType's default constructor + body(RandomAccessIterator first, OutputType init, BinaryFunction binary_op) + : first(first) + , sum(init) + , first_call(true) + , binary_op{binary_op} + {} + + // note: we only initialize sum with b.sum to avoid calling OutputType's default constructor + body(body& b, ::tbb::split) + : first(b.first) + , sum(b.sum) + , first_call(true) + , binary_op{b.binary_op} + {} + + template + void operator()(const ::tbb::blocked_range& r) + { + // we assume that blocked_range specifies a contiguous range of integers + + if (r.empty()) + { + return; // nothing to do + } + + RandomAccessIterator iter = first + r.begin(); + + OutputType temp = thrust::raw_reference_cast(*iter); + + ++iter; + + for (Size i = r.begin() + 1; i != r.end(); ++i, ++iter) + { + temp = binary_op(temp, *iter); + } + + if (first_call) + { + // first time body has been invoked + first_call = false; + sum = temp; + } + else + { + // body has been previously invoked, accumulate temp into sum + sum = binary_op(sum, temp); + } + } // end operator()() + + void join(body& b) + { + sum = binary_op(sum, b.sum); + } +}; // end body + +} // namespace reduce_detail + +template +OutputType reduce( + execution_policy&, InputIterator begin, InputIterator end, OutputType init, BinaryFunction binary_op) +{ + using Size = typename thrust::iterator_difference::type; + + Size n = thrust::distance(begin, end); + + if (n == 0) + { + return init; + } + else + { + using Body = typename reduce_detail::body; + Body reduce_body(begin, init, binary_op); + ::tbb::parallel_reduce(::tbb::blocked_range(0, n), reduce_body); + return binary_op(init, reduce_body.sum); + } +} + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_by_key.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_by_key.h new file mode 100644 index 0000000000000000000000000000000000000000..d1d70759e00bffd62571b0ab107c56f5f833d77b --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_by_key.h @@ -0,0 +1,61 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +thrust::pair reduce_by_key( + execution_policy& exec, + InputIterator1 keys_first, + InputIterator1 keys_last, + InputIterator2 values_first, + OutputIterator1 keys_output, + OutputIterator2 values_output, + BinaryPredicate binary_pred, + BinaryFunction binary_op); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_intervals.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_intervals.h new file mode 100644 index 0000000000000000000000000000000000000000..6270650b04da7d25983ab79b0dd90d0ae3bcb6f4 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reduce_intervals.h @@ -0,0 +1,140 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace reduce_intervals_detail +{ + +template +inline L divide_ri(const L x, const R y) +{ + return (x + (y - 1)) / y; +} + +template +struct body +{ + RandomAccessIterator1 first; + RandomAccessIterator2 result; + Size n, interval_size; + BinaryFunction binary_op; + + body(RandomAccessIterator1 first, RandomAccessIterator2 result, Size n, Size interval_size, BinaryFunction binary_op) + : first(first) + , result(result) + , n(n) + , interval_size(interval_size) + , binary_op(binary_op) + {} + + void operator()(const ::tbb::blocked_range& r) const + { + assert(r.size() == 1); + + Size interval_idx = r.begin(); + + Size offset_to_first = interval_size * interval_idx; + Size offset_to_last = (thrust::min)(n, offset_to_first + interval_size); + + RandomAccessIterator1 my_first = first + offset_to_first; + RandomAccessIterator1 my_last = first + offset_to_last; + + // carefully pass the init value for the interval with raw_reference_cast + using sum_type = typename std::decay::type; + result[interval_idx] = + thrust::reduce(thrust::seq, my_first + 1, my_last, sum_type(thrust::raw_reference_cast(*my_first)), binary_op); + } +}; + +template +body make_body( + RandomAccessIterator1 first, RandomAccessIterator2 result, Size n, Size interval_size, BinaryFunction binary_op) +{ + return body( + first, result, n, interval_size, binary_op); +} + +} // namespace reduce_intervals_detail + +template +void reduce_intervals( + thrust::tbb::execution_policy&, + RandomAccessIterator1 first, + RandomAccessIterator1 last, + Size interval_size, + RandomAccessIterator2 result, + BinaryFunction binary_op) +{ + typename thrust::iterator_difference::type n = last - first; + + Size num_intervals = reduce_intervals_detail::divide_ri(n, interval_size); + + ::tbb::parallel_for(::tbb::blocked_range(0, num_intervals, 1), + reduce_intervals_detail::make_body(first, result, Size(n), interval_size, binary_op), + ::tbb::simple_partitioner()); +} + +template +void reduce_intervals( + thrust::tbb::execution_policy& exec, + RandomAccessIterator1 first, + RandomAccessIterator1 last, + Size interval_size, + RandomAccessIterator2 result) +{ + using value_type = typename thrust::iterator_value::type; + + return thrust::system::tbb::detail::reduce_intervals( + exec, first, last, interval_size, result, thrust::plus()); +} + +} // namespace detail +} // namespace tbb +} // namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.h new file mode 100644 index 0000000000000000000000000000000000000000..739b0ab410318cdbcb2d95e7425d5f54ee7bde56 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.h @@ -0,0 +1,76 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace omp +{ +namespace detail +{ + +template +ForwardIterator +remove_if(execution_policy& exec, ForwardIterator first, ForwardIterator last, Predicate pred); + +template +ForwardIterator remove_if( + execution_policy& exec, + ForwardIterator first, + ForwardIterator last, + InputIterator stencil, + Predicate pred); + +template +OutputIterator remove_copy_if( + execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator result, + Predicate pred); + +template +OutputIterator remove_copy_if( + execution_policy& exec, + InputIterator1 first, + InputIterator1 last, + InputIterator2 stencil, + OutputIterator result, + Predicate pred); + +} // end namespace detail +} // end namespace omp +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.inl new file mode 100644 index 0000000000000000000000000000000000000000..cb1dbbe993599d6227b12bc4e8d43ba0dfcddcfd --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/remove.inl @@ -0,0 +1,87 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +ForwardIterator +remove_if(execution_policy& exec, ForwardIterator first, ForwardIterator last, Predicate pred) +{ + // tbb prefers generic::remove_if to cpp::remove_if + return thrust::system::detail::generic::remove_if(exec, first, last, pred); +} + +template +ForwardIterator remove_if( + execution_policy& exec, + ForwardIterator first, + ForwardIterator last, + InputIterator stencil, + Predicate pred) +{ + // tbb prefers generic::remove_if to cpp::remove_if + return thrust::system::detail::generic::remove_if(exec, first, last, stencil, pred); +} + +template +OutputIterator remove_copy_if( + execution_policy& exec, InputIterator first, InputIterator last, OutputIterator result, Predicate pred) +{ + // tbb prefers generic::remove_copy_if to cpp::remove_copy_if + return thrust::system::detail::generic::remove_copy_if(exec, first, last, result, pred); +} + +template +OutputIterator remove_copy_if( + execution_policy& exec, + InputIterator1 first, + InputIterator1 last, + InputIterator2 stencil, + OutputIterator result, + Predicate pred) +{ + // tbb prefers generic::remove_copy_if to cpp::remove_copy_if + return thrust::system::detail::generic::remove_copy_if(exec, first, last, stencil, result, pred); +} + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/replace.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/replace.h new file mode 100644 index 0000000000000000000000000000000000000000..9b23e5de64f68e6da593ffc990aaa6ca1153e7b1 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/replace.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits this algorithm +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reverse.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reverse.h new file mode 100644 index 0000000000000000000000000000000000000000..5140fb4cfe94be1520d4eb3fee222818b636a5ed --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/reverse.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits reverse +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.h new file mode 100644 index 0000000000000000000000000000000000000000..18a3ec3ee2c6680e47a530438e369b6bb6b346d0 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.h @@ -0,0 +1,59 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file scan.h + * \brief TBB implementations of scan functions. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +OutputIterator +inclusive_scan(tag, InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op); + +template +OutputIterator +inclusive_scan(tag, InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op); + +template +OutputIterator +exclusive_scan(tag, InputIterator first, InputIterator last, OutputIterator result, T init, BinaryFunction binary_op); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.inl new file mode 100644 index 0000000000000000000000000000000000000000..683ed226025465fcd170383aafae211633006ecc --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan.inl @@ -0,0 +1,313 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace scan_detail +{ + +template +struct inclusive_body +{ + InputIterator input; + OutputIterator output; + thrust::detail::wrapped_function binary_op; + ValueType sum; + bool first_call; + + inclusive_body(InputIterator input, OutputIterator output, BinaryFunction binary_op, ValueType init) + : input(input) + , output(output) + , binary_op{binary_op} + , sum(init) + , first_call(true) + {} + + inclusive_body(inclusive_body& b, ::tbb::split) + : input(b.input) + , output(b.output) + , binary_op{b.binary_op} + , sum(b.sum) + , first_call(true) + {} + + template + void operator()(const ::tbb::blocked_range& r, ::tbb::pre_scan_tag) + { + InputIterator iter = input + r.begin(); + + ValueType temp = *iter; + + ++iter; + + for (Size i = r.begin() + 1; i != r.end(); ++i, ++iter) + { + temp = binary_op(temp, *iter); + } + + if (first_call) + { + sum = temp; + } + else + { + sum = binary_op(sum, temp); + } + + first_call = false; + } + + template + void operator()(const ::tbb::blocked_range& r, ::tbb::final_scan_tag) + { + InputIterator iter1 = input + r.begin(); + OutputIterator iter2 = output + r.begin(); + + if (first_call) + { + _CCCL_IF_CONSTEXPR (HasInit) + { + *iter2 = sum = binary_op(sum, *iter1); + } + else + { + *iter2 = sum = *iter1; + } + ++iter1; + ++iter2; + for (Size i = r.begin() + 1; i != r.end(); ++i, ++iter1, ++iter2) + { + *iter2 = sum = binary_op(sum, *iter1); + } + } + else + { + for (Size i = r.begin(); i != r.end(); ++i, ++iter1, ++iter2) + { + *iter2 = sum = binary_op(sum, *iter1); + } + } + + first_call = false; + } + + void reverse_join(inclusive_body& b) + { + // Only accumulate this functor's partial sum if this functor has been + // called at least once -- otherwise we'll over-count the initial value. + if (!first_call) + { + sum = binary_op(b.sum, sum); + } + } + + void assign(inclusive_body& b) + { + sum = b.sum; + } +}; + +template +struct exclusive_body +{ + InputIterator input; + OutputIterator output; + thrust::detail::wrapped_function binary_op; + ValueType sum; + bool first_call; + + exclusive_body(InputIterator input, OutputIterator output, BinaryFunction binary_op, ValueType init) + : input(input) + , output(output) + , binary_op{binary_op} + , sum(init) + , first_call(true) + {} + + exclusive_body(exclusive_body& b, ::tbb::split) + : input(b.input) + , output(b.output) + , binary_op{b.binary_op} + , sum(b.sum) + , first_call(true) + {} + + template + void operator()(const ::tbb::blocked_range& r, ::tbb::pre_scan_tag) + { + InputIterator iter = input + r.begin(); + + ValueType temp = *iter; + + ++iter; + + for (Size i = r.begin() + 1; i != r.end(); ++i, ++iter) + { + temp = binary_op(temp, *iter); + } + + if (first_call && r.begin() > 0) + { + sum = temp; + } + else + { + sum = binary_op(sum, temp); + } + + first_call = false; + } + + template + void operator()(const ::tbb::blocked_range& r, ::tbb::final_scan_tag) + { + InputIterator iter1 = input + r.begin(); + OutputIterator iter2 = output + r.begin(); + + for (Size i = r.begin(); i != r.end(); ++i, ++iter1, ++iter2) + { + ValueType temp = binary_op(sum, *iter1); + *iter2 = sum; + sum = temp; + } + + first_call = false; + } + + void reverse_join(exclusive_body& b) + { + // Only accumulate this functor's partial sum if this functor has been + // called at least once -- otherwise we'll over-count the initial value. + if (!first_call) + { + sum = binary_op(b.sum, sum); + } + } + + void assign(exclusive_body& b) + { + sum = b.sum; + } +}; + +} // namespace scan_detail + +template +OutputIterator +inclusive_scan(tag, InputIterator first, InputIterator last, OutputIterator result, BinaryFunction binary_op) +{ + using namespace thrust::detail; + + // Use the input iterator's value type per https://wg21.link/P0571 + using ValueType = typename thrust::iterator_value::type; + + using Size = typename thrust::iterator_difference::type; + Size n = thrust::distance(first, last); + + if (n != 0) + { + using Body = typename scan_detail::inclusive_body; + Body scan_body(first, result, binary_op, *first); + ::tbb::parallel_scan(::tbb::blocked_range(0, n), scan_body); + } + + thrust::advance(result, n); + + return result; +} + +template +OutputIterator inclusive_scan( + tag, InputIterator first, InputIterator last, OutputIterator result, InitialValueType init, BinaryFunction binary_op) +{ + using namespace thrust::detail; + + // Use the input iterator's value type and the initial value type per wg21.link/p2322 + using ValueType = typename ::cuda::std:: + __accumulator_t::value_type, InitialValueType>; + + using Size = typename thrust::iterator_difference::type; + Size n = thrust::distance(first, last); + + if (n != 0) + { + using Body = typename scan_detail::inclusive_body; + Body scan_body(first, result, binary_op, init); + ::tbb::parallel_scan(::tbb::blocked_range(0, n), scan_body); + } + + thrust::advance(result, n); + + return result; +} + +template +OutputIterator exclusive_scan( + tag, InputIterator first, InputIterator last, OutputIterator result, InitialValueType init, BinaryFunction binary_op) +{ + using namespace thrust::detail; + + // Use the initial value type per https://wg21.link/P0571 + using ValueType = InitialValueType; + + using Size = typename thrust::iterator_difference::type; + Size n = thrust::distance(first, last); + + if (n != 0) + { + using Body = typename scan_detail::exclusive_body; + Body scan_body(first, result, binary_op, init); + ::tbb::parallel_scan(::tbb::blocked_range(0, n), scan_body); + } + + thrust::advance(result, n); + + return result; +} + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan_by_key.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan_by_key.h new file mode 100644 index 0000000000000000000000000000000000000000..2e04e972e73e8f585d61c9fd53df945ca0fe9527 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scan_by_key.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits scan_by_key +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scatter.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scatter.h new file mode 100644 index 0000000000000000000000000000000000000000..9b23e5de64f68e6da593ffc990aaa6ca1153e7b1 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/scatter.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits this algorithm +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sequence.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sequence.h new file mode 100644 index 0000000000000000000000000000000000000000..fa7973de8096990f61c0556cecd026a5e0c5ffbb --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sequence.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits sequence +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.h new file mode 100644 index 0000000000000000000000000000000000000000..a9811a0a376cfaa976dae3e092b360b448fd4a93 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.h @@ -0,0 +1,60 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +void stable_sort(execution_policy& exec, + RandomAccessIterator first, + RandomAccessIterator last, + StrictWeakOrdering comp); + +template +void stable_sort_by_key( + execution_policy& exec, + RandomAccessIterator1 keys_first, + RandomAccessIterator1 keys_last, + RandomAccessIterator2 values_first, + StrictWeakOrdering comp); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.inl new file mode 100644 index 0000000000000000000000000000000000000000..a6485ed2be7ba28f164e10bc70acecb400c326d0 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/sort.inl @@ -0,0 +1,295 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ +namespace sort_detail +{ + +// TODO tune this based on data type and comp +const static int threshold = 128 * 1024; + +template +void merge_sort(execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + StrictWeakOrdering comp, + bool inplace); + +template +struct merge_sort_closure +{ + execution_policy& exec; + Iterator1 first1, last1; + Iterator2 first2; + StrictWeakOrdering comp; + bool inplace; + + merge_sort_closure( + execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + StrictWeakOrdering comp, + bool inplace) + : exec(exec) + , first1(first1) + , last1(last1) + , first2(first2) + , comp(comp) + , inplace(inplace) + {} + + void operator()(void) const + { + merge_sort(exec, first1, last1, first2, comp, inplace); + } +}; + +template +void merge_sort(execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + StrictWeakOrdering comp, + bool inplace) +{ + using difference_type = typename thrust::iterator_difference::type; + + difference_type n = thrust::distance(first1, last1); + + if (n < threshold) + { + thrust::stable_sort(thrust::seq, first1, last1, comp); + + if (!inplace) + { + thrust::copy(thrust::seq, first1, last1, first2); + } + + return; + } + + Iterator1 mid1 = first1 + (n / 2); + Iterator2 mid2 = first2 + (n / 2); + Iterator2 last2 = first2 + n; + + using Closure = merge_sort_closure; + + Closure left(exec, first1, mid1, first2, comp, !inplace); + Closure right(exec, mid1, last1, mid2, comp, !inplace); + + ::tbb::parallel_invoke(left, right); + + if (inplace) + { + thrust::merge(exec, first2, mid2, mid2, last2, first1, comp); + } + else + { + thrust::merge(exec, first1, mid1, mid1, last1, first2, comp); + } +} + +} // end namespace sort_detail + +namespace sort_by_key_detail +{ + +// TODO tune this based on data type and comp +const static int threshold = 128 * 1024; + +template +void merge_sort_by_key( + execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + Iterator3 first3, + Iterator4 first4, + StrictWeakOrdering comp, + bool inplace); + +template +struct merge_sort_by_key_closure +{ + execution_policy& exec; + Iterator1 first1, last1; + Iterator2 first2; + Iterator3 first3; + Iterator4 first4; + StrictWeakOrdering comp; + bool inplace; + + merge_sort_by_key_closure( + execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + Iterator3 first3, + Iterator4 first4, + StrictWeakOrdering comp, + bool inplace) + : exec(exec) + , first1(first1) + , last1(last1) + , first2(first2) + , first3(first3) + , first4(first4) + , comp(comp) + , inplace(inplace) + {} + + void operator()(void) const + { + merge_sort_by_key(exec, first1, last1, first2, first3, first4, comp, inplace); + } +}; + +template +void merge_sort_by_key( + execution_policy& exec, + Iterator1 first1, + Iterator1 last1, + Iterator2 first2, + Iterator3 first3, + Iterator4 first4, + StrictWeakOrdering comp, + bool inplace) +{ + using difference_type = typename thrust::iterator_difference::type; + + difference_type n = thrust::distance(first1, last1); + + Iterator1 mid1 = first1 + (n / 2); + Iterator2 mid2 = first2 + (n / 2); + Iterator3 mid3 = first3 + (n / 2); + Iterator4 mid4 = first4 + (n / 2); + Iterator2 last2 = first2 + n; + Iterator3 last3 = first3 + n; + + if (n < threshold) + { + thrust::stable_sort_by_key(thrust::seq, first1, last1, first2, comp); + + if (!inplace) + { + thrust::copy(thrust::seq, first1, last1, first3); + thrust::copy(thrust::seq, first2, last2, first4); + } + + return; + } + + using Closure = + merge_sort_by_key_closure; + + Closure left(exec, first1, mid1, first2, first3, first4, comp, !inplace); + Closure right(exec, mid1, last1, mid2, mid3, mid4, comp, !inplace); + + ::tbb::parallel_invoke(left, right); + + if (inplace) + { + thrust::merge_by_key(exec, first3, mid3, mid3, last3, first4, mid4, first1, first2, comp); + } + else + { + thrust::merge_by_key(exec, first1, mid1, mid1, last1, first2, mid2, first3, first4, comp); + } +} + +} // namespace sort_by_key_detail + +template +void stable_sort( + execution_policy& exec, RandomAccessIterator first, RandomAccessIterator last, StrictWeakOrdering comp) +{ + using key_type = typename thrust::iterator_value::type; + + thrust::detail::temporary_array temp(exec, first, last); + + sort_detail::merge_sort(exec, first, last, temp.begin(), comp, true); +} + +template +void stable_sort_by_key( + execution_policy& exec, + RandomAccessIterator1 first1, + RandomAccessIterator1 last1, + RandomAccessIterator2 first2, + StrictWeakOrdering comp) +{ + using key_type = typename thrust::iterator_value::type; + using val_type = typename thrust::iterator_value::type; + + RandomAccessIterator2 last2 = first2 + thrust::distance(first1, last1); + + thrust::detail::temporary_array temp1(exec, first1, last1); + thrust::detail::temporary_array temp2(exec, first2, last2); + + sort_by_key_detail::merge_sort_by_key(exec, first1, last1, first2, temp1.begin(), temp2.begin(), comp, true); +} + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/swap_ranges.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/swap_ranges.h new file mode 100644 index 0000000000000000000000000000000000000000..600fbe4ced18f5e9623067dd3b95bb464d7ee134 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/swap_ranges.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// tbb inherits swap_ranges +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/tabulate.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/tabulate.h new file mode 100644 index 0000000000000000000000000000000000000000..8b26140153a4c373fad3ef8f13557b93b6b1be0c --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/tabulate.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits tabulate +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/temporary_buffer.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/temporary_buffer.h new file mode 100644 index 0000000000000000000000000000000000000000..8da64673cb337c02e8312ca12bcdad1dc6e44df6 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/temporary_buffer.h @@ -0,0 +1,29 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system has no special temporary buffer functions diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform.h new file mode 100644 index 0000000000000000000000000000000000000000..ba29642fdfe3d60e81a2f668398e08b167928c3f --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// omp inherits transform +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_reduce.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_reduce.h new file mode 100644 index 0000000000000000000000000000000000000000..6b095061ae3dd6017079a72f906a6f3a6b3c6a5c --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_reduce.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits transform_reduce +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_scan.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_scan.h new file mode 100644 index 0000000000000000000000000000000000000000..0a8831232235a82c0770e5ff6bfba99dbc2bbd60 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/transform_scan.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits transform_scan +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_copy.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_copy.h new file mode 100644 index 0000000000000000000000000000000000000000..11ad5f131bae8265e78a995f2f9b9da4221426cb --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_copy.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits uninitialized_copy +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_fill.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_fill.h new file mode 100644 index 0000000000000000000000000000000000000000..168d13c351698d3ec797823860a53e7e49b98cfe --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/uninitialized_fill.h @@ -0,0 +1,30 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +// this system inherits uninitialized_fill +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique.h new file mode 100644 index 0000000000000000000000000000000000000000..4cf5f6cf40b9304cb1a1ff4672a3ebe0f74c789c --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique.h @@ -0,0 +1,60 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +ForwardIterator unique( + execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate binary_pred); + +template +OutputIterator unique_copy( + execution_policy& exec, + InputIterator first, + InputIterator last, + OutputIterator output, + BinaryPredicate binary_pred); + +template +typename thrust::iterator_traits::difference_type unique_count( + execution_policy& exec, ForwardIterator first, ForwardIterator last, BinaryPredicate binary_pred); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.h new file mode 100644 index 0000000000000000000000000000000000000000..ac08d1e78e25c0144fd285940d7203b7b053de76 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.h @@ -0,0 +1,67 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +thrust::pair unique_by_key( + execution_policy& exec, + ForwardIterator1 keys_first, + ForwardIterator1 keys_last, + ForwardIterator2 values_first, + BinaryPredicate binary_pred); + +template +thrust::pair unique_by_key_copy( + execution_policy& exec, + InputIterator1 keys_first, + InputIterator1 keys_last, + InputIterator2 values_first, + OutputIterator1 keys_output, + OutputIterator2 values_output, + BinaryPredicate binary_pred); + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.inl b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.inl new file mode 100644 index 0000000000000000000000000000000000000000..4ec00b2bf9dda64539a23b24a6441c3ea12da2d4 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/detail/unique_by_key.inl @@ -0,0 +1,75 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ +namespace detail +{ + +template +thrust::pair unique_by_key( + execution_policy& exec, + ForwardIterator1 keys_first, + ForwardIterator1 keys_last, + ForwardIterator2 values_first, + BinaryPredicate binary_pred) +{ + // tbb prefers generic::unique_by_key to cpp::unique_by_key + return thrust::system::detail::generic::unique_by_key(exec, keys_first, keys_last, values_first, binary_pred); +} // end unique_by_key() + +template +thrust::pair unique_by_key_copy( + execution_policy& exec, + InputIterator1 keys_first, + InputIterator1 keys_last, + InputIterator2 values_first, + OutputIterator1 keys_output, + OutputIterator2 values_output, + BinaryPredicate binary_pred) +{ + // tbb prefers generic::unique_by_key_copy to cpp::unique_by_key_copy + return thrust::system::detail::generic::unique_by_key_copy( + exec, keys_first, keys_last, values_first, keys_output, values_output, binary_pred); +} // end unique_by_key_copy() + +} // end namespace detail +} // end namespace tbb +} // end namespace system +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/execution_policy.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/execution_policy.h new file mode 100644 index 0000000000000000000000000000000000000000..a21e0604ad891753bb2aa270bdd3aea77cfdab98 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/execution_policy.h @@ -0,0 +1,160 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +/*! \file thrust/system/tbb/execution_policy.h + * \brief Execution policies for Thrust's TBB system. + */ + +// get the execution policies definitions first +#include + +// get the definition of par +#include + +// now get all the algorithm definitions + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// define these entities here for the purpose of Doxygenating them +// they are actually defined elsewhere +#if 0 +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ + + +/*! \addtogroup execution_policies + * \{ + */ + + +/*! \p thrust::tbb::execution_policy is the base class for all Thrust parallel execution + * policies which are derived from Thrust's TBB backend system. + */ +template +struct execution_policy : thrust::execution_policy +{}; + + +/*! \p tbb::tag is a type representing Thrust's TBB backend system in C++'s type system. + * Iterators "tagged" with a type which is convertible to \p tbb::tag assert that they may be + * "dispatched" to algorithm implementations in the \p tbb system. + */ +struct tag : thrust::system::tbb::execution_policy { unspecified }; + + +/*! \p thrust::tbb::par is the parallel execution policy associated with Thrust's TBB + * backend system. + * + * Instead of relying on implicit algorithm dispatch through iterator system tags, users may + * directly target Thrust's TBB backend system by providing \p thrust::tbb::par as an algorithm + * parameter. + * + * Explicit dispatch can be useful in avoiding the introduction of data copies into containers such + * as \p thrust::tbb::vector. + * + * The type of \p thrust::tbb::par is implementation-defined. + * + * The following code snippet demonstrates how to use \p thrust::tbb::par to explicitly dispatch an + * invocation of \p thrust::for_each to the TBB backend system: + * + * \code + * #include + * #include + * #include + * + * struct printf_functor + * { + * __host__ __device__ + * void operator()(int x) + * { + * printf("%d\n", x); + * } + * }; + * ... + * int vec[3]; + * vec[0] = 0; vec[1] = 1; vec[2] = 2; + * + * thrust::for_each(thrust::tbb::par, vec.begin(), vec.end(), printf_functor()); + * + * // 0 1 2 is printed to standard output in some unspecified order + * \endcode + */ +static const unspecified par; + + +/*! \} + */ + + +} // end tbb +} // end system +THRUST_NAMESPACE_END +#endif diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/memory.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/memory.h new file mode 100644 index 0000000000000000000000000000000000000000..789358cb3352250ecb6002940ebc5cae0d76c599 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/memory.h @@ -0,0 +1,111 @@ +/* + * Copyright 2008-2018 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in ctbbliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file thrust/system/tbb/memory.h + * \brief Managing memory associated with Thrust's TBB system. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ + +/*! Allocates an area of memory available to Thrust's tbb system. + * \param n Number of bytes to allocate. + * \return A tbb::pointer pointing to the beginning of the newly + * allocated memory. A null tbb::pointer is returned if + * an error occurs. + * \note The tbb::pointer returned by this function must be + * deallocated with \p tbb::free. + * \see tbb::free + * \see std::malloc + */ +inline pointer malloc(std::size_t n); + +/*! Allocates a typed area of memory available to Thrust's tbb system. + * \param n Number of elements to allocate. + * \return A tbb::pointer pointing to the beginning of the newly + * allocated memory. A null tbb::pointer is returned if + * an error occurs. + * \note The tbb::pointer returned by this function must be + * deallocated with \p tbb::free. + * \see tbb::free + * \see std::malloc + */ +template +inline pointer malloc(std::size_t n); + +/*! Deallocates an area of memory previously allocated by tbb::malloc. + * \param ptr A tbb::pointer pointing to the beginning of an area + * of memory previously allocated with tbb::malloc. + * \see tbb::malloc + * \see std::free + */ +inline void free(pointer ptr); + +/*! \p tbb::allocator is the default allocator used by the \p tbb system's + * containers such as tbb::vector if no user-specified allocator is + * provided. \p tbb::allocator allocates (deallocates) storage with \p + * tbb::malloc (\p tbb::free). + */ +template +using allocator = thrust::mr::stateless_resource_allocator; + +//! \p tbb::universal_allocator allocates memory that can be used by the \p tbb system and host systems. +template +using universal_allocator = thrust::mr::stateless_resource_allocator; + +//! \p tbb::universal_host_pinned_allocator allocates memory that can be used by the \p tbb system and host systems. +template +using universal_host_pinned_allocator = + thrust::mr::stateless_resource_allocator; +} // namespace tbb +} // namespace system + +/*! \namespace thrust::tbb + * \brief \p thrust::tbb is a top-level alias for thrust::system::tbb. + */ +namespace tbb +{ +using thrust::system::tbb::allocator; +using thrust::system::tbb::free; +using thrust::system::tbb::malloc; +using thrust::system::tbb::universal_allocator; +using thrust::system::tbb::universal_host_pinned_allocator; +} // namespace tbb + +THRUST_NAMESPACE_END + +#include diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/pointer.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/pointer.h new file mode 100644 index 0000000000000000000000000000000000000000..910e1ec93af127868a04e69fcf32ed74bd243482 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/pointer.h @@ -0,0 +1,120 @@ +/* + * Copyright 2008-2020 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file thrust/system/tbb/memory.h + * \brief Managing memory associated with Thrust's TBB system. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ + +/*! \p tbb::pointer stores a pointer to an object allocated in memory accessible + * by the \p tbb system. This type provides type safety when dispatching + * algorithms on ranges resident in \p tbb memory. + * + * \p tbb::pointer has pointer semantics: it may be dereferenced and + * manipulated with pointer arithmetic. + * + * \p tbb::pointer can be created with the function \p tbb::malloc, or by + * explicitly calling its constructor with a raw pointer. + * + * The raw pointer encapsulated by a \p tbb::pointer may be obtained by either its + * get member function or the \p raw_pointer_cast function. + * + * \note \p tbb::pointer is not a "smart" pointer; it is the programmer's + * responsibility to deallocate memory pointed to by \p tbb::pointer. + * + * \tparam T specifies the type of the pointee. + * + * \see tbb::malloc + * \see tbb::free + * \see raw_pointer_cast + */ +template +using pointer = thrust::pointer>; + +/*! \p tbb::universal_pointer stores a pointer to an object allocated in memory + * accessible by the \p tbb system and host systems. + * + * \p tbb::universal_pointer has pointer semantics: it may be dereferenced and + * manipulated with pointer arithmetic. + * + * \p tbb::universal_pointer can be created with \p tbb::universal_allocator + * or by explicitly calling its constructor with a raw pointer. + * + * The raw pointer encapsulated by a \p tbb::universal_pointer may be obtained + * by either its get member function or the \p raw_pointer_cast + * function. + * + * \note \p tbb::universal_pointer is not a "smart" pointer; it is the + * programmer's responsibility to deallocate memory pointed to by + * \p tbb::universal_pointer. + * + * \tparam T specifies the type of the pointee. + * + * \see tbb::universal_allocator + * \see raw_pointer_cast + */ +template +using universal_pointer = thrust::pointer::type>; + +/*! \p reference is a wrapped reference to an object stored in memory available + * to the \p tbb system. \p reference is the type of the result of + * dereferencing a \p tbb::pointer. + * + * \tparam T Specifies the type of the referenced object. + */ +template +using reference = thrust::tagged_reference; + +} // namespace tbb +} // namespace system + +/*! \addtogroup system_backends Systems + * \ingroup system + * \{ + */ + +/*! \namespace thrust::tbb + * \brief \p thrust::tbb is a top-level alias for \p thrust::system::tbb. */ +namespace tbb +{ +using thrust::system::tbb::pointer; +using thrust::system::tbb::reference; +using thrust::system::tbb::universal_pointer; +} // namespace tbb + +THRUST_NAMESPACE_END diff --git a/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/vector.h b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/vector.h new file mode 100644 index 0000000000000000000000000000000000000000..2ee6a445f65ac428b0f8aa979d7dedeb662aca78 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/cupy/_core/include/cupy/_cccl/thrust/thrust/system/tbb/vector.h @@ -0,0 +1,96 @@ +/* + * Copyright 2008-2013 NVIDIA Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*! \file thrust/system/tbb/vector.h + * \brief A dynamically-sizable array of elements which reside in memory available to + * Thrust's TBB system. + */ + +#pragma once + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header +#include +#include + +#include + +THRUST_NAMESPACE_BEGIN +namespace system +{ +namespace tbb +{ + +/*! \p tbb::vector is a container that supports random access to elements, + * constant time removal of elements at the end, and linear time insertion + * and removal of elements at the beginning or in the middle. The number of + * elements in a \p tbb::vector may vary dynamically; memory management is + * automatic. The elements contained in a \p tbb::vector reside in memory + * accessible by the \p tbb system. + * + * \tparam T The element type of the \p tbb::vector. + * \tparam Allocator The allocator type of the \p tbb::vector. + * Defaults to \p tbb::allocator. + * + * \see https://en.cppreference.com/w/cpp/container/vector + * \see host_vector For the documentation of the complete interface which is + * shared by \p tbb::vector. + * \see device_vector + * \see universal_vector + */ +template > +using vector = thrust::detail::vector_base; + +/*! \p tbb::universal_vector is a container that supports random access to + * elements, constant time removal of elements at the end, and linear time + * insertion and removal of elements at the beginning or in the middle. The + * number of elements in a \p tbb::universal_vector may vary dynamically; + * memory management is automatic. The elements contained in a + * \p tbb::universal_vector reside in memory accessible by the \p tbb system + * and host systems. + * + * \tparam T The element type of the \p tbb::universal_vector. + * \tparam Allocator The allocator type of the \p tbb::universal_vector. + * Defaults to \p tbb::universal_allocator. + * + * \see https://en.cppreference.com/w/cpp/container/vector + * \see host_vector For the documentation of the complete interface which is + * shared by \p tbb::universal_vector + * \see device_vector + * \see universal_vector + */ +template > +using universal_vector = thrust::detail::vector_base; + +template +using universal_host_pinned_vector = thrust::detail::vector_base>; +} // namespace tbb +} // namespace system + +namespace tbb +{ +using thrust::system::tbb::universal_vector; +using thrust::system::tbb::vector; +} // namespace tbb + +THRUST_NAMESPACE_END