Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/info/licenses/LICENSE +1632 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/info/test/run_test.sh +9 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/nv/detail/__preprocessor +176 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/nv/detail/__target_macros +610 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/allocator_traits.h +350 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/allocator_traits.inl +370 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/copy_construct_range.h +45 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/copy_construct_range.inl +242 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/destroy_range.h +39 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/destroy_range.inl +137 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/fill_construct_range.h +39 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/fill_construct_range.inl +99 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/malloc_allocator.h +53 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/malloc_allocator.inl +68 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/no_throw_allocator.h +76 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/tagged_allocator.h +102 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/tagged_allocator.inl +86 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/temporary_allocator.h +79 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/temporary_allocator.inl +81 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/value_initialize_range.h +39 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/value_initialize_range.inl +98 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/arithmetic.h +255 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/c99math.h +221 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/catrig.h +875 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/catrigf.h +588 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ccosh.h +233 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ccoshf.h +161 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cexp.h +195 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cexpf.h +173 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/clog.h +223 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/clogf.h +210 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/complex.inl +255 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cpow.h +50 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cproj.h +80 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csinh.h +226 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csinhf.h +166 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csqrt.h +177 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csqrtf.h +173 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ctanh.h +208 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ctanhf.h +133 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/math_private.h +138 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/stream.h +73 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/compiler.h +119 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/compiler_fence.h +79 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/config.h +45 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/cpp_compatibility.h +61 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/cpp_dialect.h +100 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/device_system.h +55 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/global_workarounds.h +36 -0
- data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/host_system.h +52 -0
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,1632 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
End User License Agreement
|
| 2 |
+
--------------------------
|
| 3 |
+
|
| 4 |
+
NVIDIA Software License Agreement and CUDA Supplement to
|
| 5 |
+
Software License Agreement.
|
| 6 |
+
|
| 7 |
+
The CUDA Toolkit End User License Agreement applies to the
|
| 8 |
+
NVIDIA CUDA Toolkit, the NVIDIA CUDA Samples, the NVIDIA
|
| 9 |
+
Display Driver, NVIDIA Nsight tools (Visual Studio Edition),
|
| 10 |
+
and the associated documentation on CUDA APIs, programming
|
| 11 |
+
model and development tools. If you do not agree with the
|
| 12 |
+
terms and conditions of the license agreement, then do not
|
| 13 |
+
download or use the software.
|
| 14 |
+
|
| 15 |
+
Last updated: January 12, 2024.
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
Preface
|
| 19 |
+
-------
|
| 20 |
+
|
| 21 |
+
The Software License Agreement in Chapter 1 and the Supplement
|
| 22 |
+
in Chapter 2 contain license terms and conditions that govern
|
| 23 |
+
the use of NVIDIA toolkit. By accepting this agreement, you
|
| 24 |
+
agree to comply with all the terms and conditions applicable
|
| 25 |
+
to the product(s) included herein.
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
NVIDIA Driver
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
Description
|
| 32 |
+
|
| 33 |
+
This package contains the operating system driver and
|
| 34 |
+
fundamental system software components for NVIDIA GPUs.
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
NVIDIA CUDA Toolkit
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
Description
|
| 41 |
+
|
| 42 |
+
The NVIDIA CUDA Toolkit provides command-line and graphical
|
| 43 |
+
tools for building, debugging and optimizing the performance
|
| 44 |
+
of applications accelerated by NVIDIA GPUs, runtime and math
|
| 45 |
+
libraries, and documentation including programming guides,
|
| 46 |
+
user manuals, and API references.
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
Default Install Location of CUDA Toolkit
|
| 50 |
+
|
| 51 |
+
Windows platform:
|
| 52 |
+
|
| 53 |
+
%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.#
|
| 54 |
+
|
| 55 |
+
Linux platform:
|
| 56 |
+
|
| 57 |
+
/usr/local/cuda-#.#
|
| 58 |
+
|
| 59 |
+
Mac platform:
|
| 60 |
+
|
| 61 |
+
/Developer/NVIDIA/CUDA-#.#
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
NVIDIA CUDA Samples
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
Description
|
| 68 |
+
|
| 69 |
+
CUDA Samples are now located in
|
| 70 |
+
https://github.com/nvidia/cuda-samples, which includes
|
| 71 |
+
instructions for obtaining, building, and running the samples.
|
| 72 |
+
They are no longer included in the CUDA toolkit.
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
NVIDIA Nsight Visual Studio Edition (Windows only)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
Description
|
| 79 |
+
|
| 80 |
+
NVIDIA Nsight Development Platform, Visual Studio Edition is a
|
| 81 |
+
development environment integrated into Microsoft Visual
|
| 82 |
+
Studio that provides tools for debugging, profiling, analyzing
|
| 83 |
+
and optimizing your GPU computing and graphics applications.
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
Default Install Location of Nsight Visual Studio Edition
|
| 87 |
+
|
| 88 |
+
Windows platform:
|
| 89 |
+
|
| 90 |
+
%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.#
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
1. License Agreement for NVIDIA Software Development Kits
|
| 94 |
+
---------------------------------------------------------
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
Important Notice—Read before downloading, installing,
|
| 98 |
+
copying or using the licensed software:
|
| 99 |
+
-------------------------------------------------------
|
| 100 |
+
|
| 101 |
+
This license agreement, including exhibits attached
|
| 102 |
+
("Agreement”) is a legal agreement between you and NVIDIA
|
| 103 |
+
Corporation ("NVIDIA") and governs your use of a NVIDIA
|
| 104 |
+
software development kit (“SDK”).
|
| 105 |
+
|
| 106 |
+
Each SDK has its own set of software and materials, but here
|
| 107 |
+
is a description of the types of items that may be included in
|
| 108 |
+
a SDK: source code, header files, APIs, data sets and assets
|
| 109 |
+
(examples include images, textures, models, scenes, videos,
|
| 110 |
+
native API input/output files), binary software, sample code,
|
| 111 |
+
libraries, utility programs, programming code and
|
| 112 |
+
documentation.
|
| 113 |
+
|
| 114 |
+
This Agreement can be accepted only by an adult of legal age
|
| 115 |
+
of majority in the country in which the SDK is used.
|
| 116 |
+
|
| 117 |
+
If you are entering into this Agreement on behalf of a company
|
| 118 |
+
or other legal entity, you represent that you have the legal
|
| 119 |
+
authority to bind the entity to this Agreement, in which case
|
| 120 |
+
“you” will mean the entity you represent.
|
| 121 |
+
|
| 122 |
+
If you don’t have the required age or authority to accept
|
| 123 |
+
this Agreement, or if you don’t accept all the terms and
|
| 124 |
+
conditions of this Agreement, do not download, install or use
|
| 125 |
+
the SDK.
|
| 126 |
+
|
| 127 |
+
You agree to use the SDK only for purposes that are permitted
|
| 128 |
+
by (a) this Agreement, and (b) any applicable law, regulation
|
| 129 |
+
or generally accepted practices or guidelines in the relevant
|
| 130 |
+
jurisdictions.
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
1.1. License
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
1.1.1. License Grant
|
| 137 |
+
|
| 138 |
+
Subject to the terms of this Agreement, NVIDIA hereby grants
|
| 139 |
+
you a non-exclusive, non-transferable license, without the
|
| 140 |
+
right to sublicense (except as expressly provided in this
|
| 141 |
+
Agreement) to:
|
| 142 |
+
|
| 143 |
+
1. Install and use the SDK,
|
| 144 |
+
|
| 145 |
+
2. Modify and create derivative works of sample source code
|
| 146 |
+
delivered in the SDK, and
|
| 147 |
+
|
| 148 |
+
3. Distribute those portions of the SDK that are identified
|
| 149 |
+
in this Agreement as distributable, as incorporated in
|
| 150 |
+
object code format into a software application that meets
|
| 151 |
+
the distribution requirements indicated in this Agreement.
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
1.1.2. Distribution Requirements
|
| 155 |
+
|
| 156 |
+
These are the distribution requirements for you to exercise
|
| 157 |
+
the distribution grant:
|
| 158 |
+
|
| 159 |
+
1. Your application must have material additional
|
| 160 |
+
functionality, beyond the included portions of the SDK.
|
| 161 |
+
|
| 162 |
+
2. The distributable portions of the SDK shall only be
|
| 163 |
+
accessed by your application.
|
| 164 |
+
|
| 165 |
+
3. The following notice shall be included in modifications
|
| 166 |
+
and derivative works of sample source code distributed:
|
| 167 |
+
“This software contains source code provided by NVIDIA
|
| 168 |
+
Corporation.”
|
| 169 |
+
|
| 170 |
+
4. Unless a developer tool is identified in this Agreement
|
| 171 |
+
as distributable, it is delivered for your internal use
|
| 172 |
+
only.
|
| 173 |
+
|
| 174 |
+
5. The terms under which you distribute your application
|
| 175 |
+
must be consistent with the terms of this Agreement,
|
| 176 |
+
including (without limitation) terms relating to the
|
| 177 |
+
license grant and license restrictions and protection of
|
| 178 |
+
NVIDIA’s intellectual property rights. Additionally, you
|
| 179 |
+
agree that you will protect the privacy, security and
|
| 180 |
+
legal rights of your application users.
|
| 181 |
+
|
| 182 |
+
6. You agree to notify NVIDIA in writing of any known or
|
| 183 |
+
suspected distribution or use of the SDK not in compliance
|
| 184 |
+
with the requirements of this Agreement, and to enforce
|
| 185 |
+
the terms of your agreements with respect to distributed
|
| 186 |
+
SDK.
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
1.1.3. Authorized Users
|
| 190 |
+
|
| 191 |
+
You may allow employees and contractors of your entity or of
|
| 192 |
+
your subsidiary(ies) to access and use the SDK from your
|
| 193 |
+
secure network to perform work on your behalf.
|
| 194 |
+
|
| 195 |
+
If you are an academic institution you may allow users
|
| 196 |
+
enrolled or employed by the academic institution to access and
|
| 197 |
+
use the SDK from your secure network.
|
| 198 |
+
|
| 199 |
+
You are responsible for the compliance with the terms of this
|
| 200 |
+
Agreement by your authorized users. If you become aware that
|
| 201 |
+
your authorized users didn’t follow the terms of this
|
| 202 |
+
Agreement, you agree to take reasonable steps to resolve the
|
| 203 |
+
non-compliance and prevent new occurrences.
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
1.1.4. Pre-Release SDK
|
| 207 |
+
|
| 208 |
+
The SDK versions identified as alpha, beta, preview or
|
| 209 |
+
otherwise as pre-release, may not be fully functional, may
|
| 210 |
+
contain errors or design flaws, and may have reduced or
|
| 211 |
+
different security, privacy, accessibility, availability, and
|
| 212 |
+
reliability standards relative to commercial versions of
|
| 213 |
+
NVIDIA software and materials. Use of a pre-release SDK may
|
| 214 |
+
result in unexpected results, loss of data, project delays or
|
| 215 |
+
other unpredictable damage or loss.
|
| 216 |
+
|
| 217 |
+
You may use a pre-release SDK at your own risk, understanding
|
| 218 |
+
that pre-release SDKs are not intended for use in production
|
| 219 |
+
or business-critical systems.
|
| 220 |
+
|
| 221 |
+
NVIDIA may choose not to make available a commercial version
|
| 222 |
+
of any pre-release SDK. NVIDIA may also choose to abandon
|
| 223 |
+
development and terminate the availability of a pre-release
|
| 224 |
+
SDK at any time without liability.
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
1.1.5. Updates
|
| 228 |
+
|
| 229 |
+
NVIDIA may, at its option, make available patches, workarounds
|
| 230 |
+
or other updates to this SDK. Unless the updates are provided
|
| 231 |
+
with their separate governing terms, they are deemed part of
|
| 232 |
+
the SDK licensed to you as provided in this Agreement. You
|
| 233 |
+
agree that the form and content of the SDK that NVIDIA
|
| 234 |
+
provides may change without prior notice to you. While NVIDIA
|
| 235 |
+
generally maintains compatibility between versions, NVIDIA may
|
| 236 |
+
in some cases make changes that introduce incompatibilities in
|
| 237 |
+
future versions of the SDK.
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
1.1.6. Components Under Other Licenses
|
| 241 |
+
|
| 242 |
+
The SDK may come bundled with, or otherwise include or be
|
| 243 |
+
distributed with, NVIDIA or third-party components with
|
| 244 |
+
separate legal notices or terms as may be described in
|
| 245 |
+
proprietary notices accompanying the SDK. If and to the extent
|
| 246 |
+
there is a conflict between the terms in this Agreement and
|
| 247 |
+
the license terms associated with the component, the license
|
| 248 |
+
terms associated with the components control only to the
|
| 249 |
+
extent necessary to resolve the conflict.
|
| 250 |
+
|
| 251 |
+
Subject to the other terms of this Agreement, you may use the
|
| 252 |
+
SDK to develop and test applications released under Open
|
| 253 |
+
Source Initiative (OSI) approved open source software
|
| 254 |
+
licenses.
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
1.1.7. Reservation of Rights
|
| 258 |
+
|
| 259 |
+
NVIDIA reserves all rights, title, and interest in and to the
|
| 260 |
+
SDK, not expressly granted to you under this Agreement.
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
1.2. Limitations
|
| 264 |
+
|
| 265 |
+
The following license limitations apply to your use of the
|
| 266 |
+
SDK:
|
| 267 |
+
|
| 268 |
+
1. You may not reverse engineer, decompile or disassemble,
|
| 269 |
+
or remove copyright or other proprietary notices from any
|
| 270 |
+
portion of the SDK or copies of the SDK.
|
| 271 |
+
|
| 272 |
+
2. Except as expressly provided in this Agreement, you may
|
| 273 |
+
not copy, sell, rent, sublicense, transfer, distribute,
|
| 274 |
+
modify, or create derivative works of any portion of the
|
| 275 |
+
SDK. For clarity, you may not distribute or sublicense the
|
| 276 |
+
SDK as a stand-alone product.
|
| 277 |
+
|
| 278 |
+
3. Unless you have an agreement with NVIDIA for this
|
| 279 |
+
purpose, you may not indicate that an application created
|
| 280 |
+
with the SDK is sponsored or endorsed by NVIDIA.
|
| 281 |
+
|
| 282 |
+
4. You may not bypass, disable, or circumvent any
|
| 283 |
+
encryption, security, digital rights management or
|
| 284 |
+
authentication mechanism in the SDK.
|
| 285 |
+
|
| 286 |
+
5. You may not use the SDK in any manner that would cause it
|
| 287 |
+
to become subject to an open source software license. As
|
| 288 |
+
examples, licenses that require as a condition of use,
|
| 289 |
+
modification, and/or distribution that the SDK be:
|
| 290 |
+
|
| 291 |
+
a. Disclosed or distributed in source code form;
|
| 292 |
+
|
| 293 |
+
b. Licensed for the purpose of making derivative works;
|
| 294 |
+
or
|
| 295 |
+
|
| 296 |
+
c. Redistributable at no charge.
|
| 297 |
+
|
| 298 |
+
6. You acknowledge that the SDK as delivered is not tested
|
| 299 |
+
or certified by NVIDIA for use in connection with the
|
| 300 |
+
design, construction, maintenance, and/or operation of any
|
| 301 |
+
system where the use or failure of such system could
|
| 302 |
+
result in a situation that threatens the safety of human
|
| 303 |
+
life or results in catastrophic damages (each, a "Critical
|
| 304 |
+
Application"). Examples of Critical Applications include
|
| 305 |
+
use in avionics, navigation, autonomous vehicle
|
| 306 |
+
applications, ai solutions for automotive products,
|
| 307 |
+
military, medical, life support or other life critical
|
| 308 |
+
applications. NVIDIA shall not be liable to you or any
|
| 309 |
+
third party, in whole or in part, for any claims or
|
| 310 |
+
damages arising from such uses. You are solely responsible
|
| 311 |
+
for ensuring that any product or service developed with
|
| 312 |
+
the SDK as a whole includes sufficient features to comply
|
| 313 |
+
with all applicable legal and regulatory standards and
|
| 314 |
+
requirements.
|
| 315 |
+
|
| 316 |
+
7. You agree to defend, indemnify and hold harmless NVIDIA
|
| 317 |
+
and its affiliates, and their respective employees,
|
| 318 |
+
contractors, agents, officers and directors, from and
|
| 319 |
+
against any and all claims, damages, obligations, losses,
|
| 320 |
+
liabilities, costs or debt, fines, restitutions and
|
| 321 |
+
expenses (including but not limited to attorney’s fees
|
| 322 |
+
and costs incident to establishing the right of
|
| 323 |
+
indemnification) arising out of or related to products or
|
| 324 |
+
services that use the SDK in or for Critical Applications,
|
| 325 |
+
and for use of the SDK outside of the scope of this
|
| 326 |
+
Agreement or not in compliance with its terms.
|
| 327 |
+
|
| 328 |
+
8. You may not reverse engineer, decompile or disassemble
|
| 329 |
+
any portion of the output generated using SDK elements for
|
| 330 |
+
the purpose of translating such output artifacts to target
|
| 331 |
+
a non-NVIDIA platform.
|
| 332 |
+
|
| 333 |
+
|
| 334 |
+
1.3. Ownership
|
| 335 |
+
|
| 336 |
+
1. NVIDIA or its licensors hold all rights, title and
|
| 337 |
+
interest in and to the SDK and its modifications and
|
| 338 |
+
derivative works, including their respective intellectual
|
| 339 |
+
property rights, subject to your rights under Section
|
| 340 |
+
1.3.2. This SDK may include software and materials from
|
| 341 |
+
NVIDIA’s licensors, and these licensors are intended
|
| 342 |
+
third party beneficiaries that may enforce this Agreement
|
| 343 |
+
with respect to their intellectual property rights.
|
| 344 |
+
|
| 345 |
+
2. You hold all rights, title and interest in and to your
|
| 346 |
+
applications and your derivative works of the sample
|
| 347 |
+
source code delivered in the SDK, including their
|
| 348 |
+
respective intellectual property rights, subject to
|
| 349 |
+
NVIDIA’s rights under Section 1.3.1.
|
| 350 |
+
|
| 351 |
+
3. You may, but don’t have to, provide to NVIDIA
|
| 352 |
+
suggestions, feature requests or other feedback regarding
|
| 353 |
+
the SDK, including possible enhancements or modifications
|
| 354 |
+
to the SDK. For any feedback that you voluntarily provide,
|
| 355 |
+
you hereby grant NVIDIA and its affiliates a perpetual,
|
| 356 |
+
non-exclusive, worldwide, irrevocable license to use,
|
| 357 |
+
reproduce, modify, license, sublicense (through multiple
|
| 358 |
+
tiers of sublicensees), and distribute (through multiple
|
| 359 |
+
tiers of distributors) it without the payment of any
|
| 360 |
+
royalties or fees to you. NVIDIA will use feedback at its
|
| 361 |
+
choice. NVIDIA is constantly looking for ways to improve
|
| 362 |
+
its products, so you may send feedback to NVIDIA through
|
| 363 |
+
the developer portal at https://developer.nvidia.com.
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
1.4. No Warranties
|
| 367 |
+
|
| 368 |
+
THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL
|
| 369 |
+
FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND
|
| 370 |
+
ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND
|
| 371 |
+
OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
|
| 372 |
+
BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
|
| 373 |
+
FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE
|
| 374 |
+
ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO
|
| 375 |
+
WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF
|
| 376 |
+
DEALING OR COURSE OF TRADE.
|
| 377 |
+
|
| 378 |
+
|
| 379 |
+
1.5. Limitation of Liability
|
| 380 |
+
|
| 381 |
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS
|
| 382 |
+
AFFILIATES SHALL NOT BE LIABLE FOR ANY (I) SPECIAL, INCIDENTAL,
|
| 383 |
+
PUNITIVE OR CONSEQUENTIAL DAMAGES, OR (II) DAMAGES FOR (A) ANY
|
| 384 |
+
LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL,
|
| 385 |
+
OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF
|
| 386 |
+
OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE
|
| 387 |
+
OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED
|
| 388 |
+
UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING
|
| 389 |
+
NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR
|
| 390 |
+
THEORY OF LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES
|
| 391 |
+
TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS
|
| 392 |
+
AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE
|
| 393 |
+
NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS
|
| 394 |
+
LIMIT.
|
| 395 |
+
|
| 396 |
+
These exclusions and limitations of liability shall apply
|
| 397 |
+
regardless if NVIDIA or its affiliates have been advised of
|
| 398 |
+
the possibility of such damages, and regardless of whether a
|
| 399 |
+
remedy fails its essential purpose. These exclusions and
|
| 400 |
+
limitations of liability form an essential basis of the
|
| 401 |
+
bargain between the parties, and, absent any of these
|
| 402 |
+
exclusions or limitations of liability, the provisions of this
|
| 403 |
+
Agreement, including, without limitation, the economic terms,
|
| 404 |
+
would be substantially different.
|
| 405 |
+
|
| 406 |
+
|
| 407 |
+
1.6. Termination
|
| 408 |
+
|
| 409 |
+
1. This Agreement will continue to apply until terminated by
|
| 410 |
+
either you or NVIDIA as described below.
|
| 411 |
+
|
| 412 |
+
2. If you want to terminate this Agreement, you may do so by
|
| 413 |
+
stopping to use the SDK.
|
| 414 |
+
|
| 415 |
+
3. NVIDIA may, at any time, terminate this Agreement if:
|
| 416 |
+
|
| 417 |
+
a. (i) you fail to comply with any term of this
|
| 418 |
+
Agreement and the non-compliance is not fixed within
|
| 419 |
+
thirty (30) days following notice from NVIDIA (or
|
| 420 |
+
immediately if you violate NVIDIA’s intellectual
|
| 421 |
+
property rights);
|
| 422 |
+
|
| 423 |
+
b. (ii) you commence or participate in any legal
|
| 424 |
+
proceeding against NVIDIA with respect to the SDK; or
|
| 425 |
+
|
| 426 |
+
c. (iii) NVIDIA decides to no longer provide the SDK in
|
| 427 |
+
a country or, in NVIDIA’s sole discretion, the
|
| 428 |
+
continued use of it is no longer commercially viable.
|
| 429 |
+
|
| 430 |
+
4. Upon any termination of this Agreement, you agree to
|
| 431 |
+
promptly discontinue use of the SDK and destroy all copies
|
| 432 |
+
in your possession or control. Your prior distributions in
|
| 433 |
+
accordance with this Agreement are not affected by the
|
| 434 |
+
termination of this Agreement. Upon written request, you
|
| 435 |
+
will certify in writing that you have complied with your
|
| 436 |
+
commitments under this section. Upon any termination of
|
| 437 |
+
this Agreement all provisions survive except for the
|
| 438 |
+
license grant provisions.
|
| 439 |
+
|
| 440 |
+
|
| 441 |
+
1.7. General
|
| 442 |
+
|
| 443 |
+
If you wish to assign this Agreement or your rights and
|
| 444 |
+
obligations, including by merger, consolidation, dissolution
|
| 445 |
+
or operation of law, contact NVIDIA to ask for permission. Any
|
| 446 |
+
attempted assignment not approved by NVIDIA in writing shall
|
| 447 |
+
be void and of no effect. NVIDIA may assign, delegate or
|
| 448 |
+
transfer this Agreement and its rights and obligations, and if
|
| 449 |
+
to a non-affiliate you will be notified.
|
| 450 |
+
|
| 451 |
+
You agree to cooperate with NVIDIA and provide reasonably
|
| 452 |
+
requested information to verify your compliance with this
|
| 453 |
+
Agreement.
|
| 454 |
+
|
| 455 |
+
This Agreement will be governed in all respects by the laws of
|
| 456 |
+
the United States and of the State of Delaware, without regard to the
|
| 457 |
+
conflicts of laws principles. The United Nations Convention on
|
| 458 |
+
Contracts for the International Sale of Goods is specifically
|
| 459 |
+
disclaimed. You agree to all terms of this Agreement in the
|
| 460 |
+
English language.
|
| 461 |
+
|
| 462 |
+
The state or federal courts residing in Santa Clara County,
|
| 463 |
+
California shall have exclusive jurisdiction over any dispute
|
| 464 |
+
or claim arising out of this Agreement. Notwithstanding this,
|
| 465 |
+
you agree that NVIDIA shall still be allowed to apply for
|
| 466 |
+
injunctive remedies or an equivalent type of urgent legal
|
| 467 |
+
relief in any jurisdiction.
|
| 468 |
+
|
| 469 |
+
If any court of competent jurisdiction determines that any
|
| 470 |
+
provision of this Agreement is illegal, invalid or
|
| 471 |
+
unenforceable, such provision will be construed as limited to
|
| 472 |
+
the extent necessary to be consistent with and fully
|
| 473 |
+
enforceable under the law and the remaining provisions will
|
| 474 |
+
remain in full force and effect. Unless otherwise specified,
|
| 475 |
+
remedies are cumulative.
|
| 476 |
+
|
| 477 |
+
Each party acknowledges and agrees that the other is an
|
| 478 |
+
independent contractor in the performance of this Agreement.
|
| 479 |
+
|
| 480 |
+
The SDK has been developed entirely at private expense and is
|
| 481 |
+
“commercial items” consisting of “commercial computer
|
| 482 |
+
software” and “commercial computer software
|
| 483 |
+
documentation” provided with RESTRICTED RIGHTS. Use,
|
| 484 |
+
duplication or disclosure by the U.S. Government or a U.S.
|
| 485 |
+
Government subcontractor is subject to the restrictions in
|
| 486 |
+
this Agreement pursuant to DFARS 227.7202-3(a) or as set forth
|
| 487 |
+
in subparagraphs (c)(1) and (2) of the Commercial Computer
|
| 488 |
+
Software - Restricted Rights clause at FAR 52.227-19, as
|
| 489 |
+
applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas
|
| 490 |
+
Expressway, Santa Clara, CA 95051.
|
| 491 |
+
|
| 492 |
+
The SDK is subject to United States export laws and
|
| 493 |
+
regulations. You agree that you will not ship, transfer or
|
| 494 |
+
export the SDK into any country, or use the SDK in any manner,
|
| 495 |
+
prohibited by the United States Bureau of Industry and
|
| 496 |
+
Security or economic sanctions regulations administered by the
|
| 497 |
+
U.S. Department of Treasury’s Office of Foreign Assets
|
| 498 |
+
Control (OFAC), or any applicable export laws, restrictions or
|
| 499 |
+
regulations. These laws include restrictions on destinations,
|
| 500 |
+
end users and end use. By accepting this Agreement, you
|
| 501 |
+
confirm that you are not located in a country currently
|
| 502 |
+
embargoed by the U.S. or otherwise prohibited from receiving
|
| 503 |
+
the SDK under U.S. law.
|
| 504 |
+
|
| 505 |
+
Any notice delivered by NVIDIA to you under this Agreement
|
| 506 |
+
will be delivered via mail, email or fax. You agree that any
|
| 507 |
+
notices that NVIDIA sends you electronically will satisfy any
|
| 508 |
+
legal communication requirements. Please direct your legal
|
| 509 |
+
notices or other correspondence to NVIDIA Corporation, 2788
|
| 510 |
+
San Tomas Expressway, Santa Clara, California 95051, United
|
| 511 |
+
States of America, Attention: Legal Department.
|
| 512 |
+
|
| 513 |
+
This Agreement and any exhibits incorporated into this
|
| 514 |
+
Agreement constitute the entire agreement of the parties with
|
| 515 |
+
respect to the subject matter of this Agreement and supersede
|
| 516 |
+
all prior negotiations or documentation exchanged between the
|
| 517 |
+
parties relating to this SDK license. Any additional and/or
|
| 518 |
+
conflicting terms on documents issued by you are null, void,
|
| 519 |
+
and invalid. Any amendment or waiver under this Agreement
|
| 520 |
+
shall be in writing and signed by representatives of both
|
| 521 |
+
parties.
|
| 522 |
+
|
| 523 |
+
|
| 524 |
+
2. CUDA Toolkit Supplement to Software License Agreement for
|
| 525 |
+
NVIDIA Software Development Kits
|
| 526 |
+
------------------------------------------------------------
|
| 527 |
+
|
| 528 |
+
The terms in this supplement govern your use of the NVIDIA
|
| 529 |
+
CUDA Toolkit SDK under the terms of your license agreement
|
| 530 |
+
(“Agreement”) as modified by this supplement. Capitalized
|
| 531 |
+
terms used but not defined below have the meaning assigned to
|
| 532 |
+
them in the Agreement.
|
| 533 |
+
|
| 534 |
+
This supplement is an exhibit to the Agreement and is
|
| 535 |
+
incorporated as an integral part of the Agreement. In the
|
| 536 |
+
event of conflict between the terms in this supplement and the
|
| 537 |
+
terms in the Agreement, the terms in this supplement govern.
|
| 538 |
+
|
| 539 |
+
|
| 540 |
+
2.1. License Scope
|
| 541 |
+
|
| 542 |
+
The SDK is licensed for you to develop applications only for
|
| 543 |
+
use in systems with NVIDIA GPUs.
|
| 544 |
+
|
| 545 |
+
|
| 546 |
+
2.2. Distribution
|
| 547 |
+
|
| 548 |
+
The portions of the SDK that are distributable under the
|
| 549 |
+
Agreement are listed in Attachment A.
|
| 550 |
+
|
| 551 |
+
|
| 552 |
+
2.3. Operating Systems
|
| 553 |
+
|
| 554 |
+
Those portions of the SDK designed exclusively for use on the
|
| 555 |
+
Linux or FreeBSD operating systems, or other operating systems
|
| 556 |
+
derived from the source code to these operating systems, may
|
| 557 |
+
be copied and redistributed for use in accordance with this
|
| 558 |
+
Agreement, provided that the object code files are not
|
| 559 |
+
modified in any way (except for unzipping of compressed
|
| 560 |
+
files).
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
2.4. Audio and Video Encoders and Decoders
|
| 564 |
+
|
| 565 |
+
You acknowledge and agree that it is your sole responsibility
|
| 566 |
+
to obtain any additional third-party licenses required to
|
| 567 |
+
make, have made, use, have used, sell, import, and offer for
|
| 568 |
+
sale your products or services that include or incorporate any
|
| 569 |
+
third-party software and content relating to audio and/or
|
| 570 |
+
video encoders and decoders from, including but not limited
|
| 571 |
+
to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A.,
|
| 572 |
+
MPEG-LA, and Coding Technologies. NVIDIA does not grant to you
|
| 573 |
+
under this Agreement any necessary patent or other rights with
|
| 574 |
+
respect to any audio and/or video encoders and decoders.
|
| 575 |
+
|
| 576 |
+
|
| 577 |
+
2.5. Licensing
|
| 578 |
+
|
| 579 |
+
If the distribution terms in this Agreement are not suitable
|
| 580 |
+
for your organization, or for any questions regarding this
|
| 581 |
+
Agreement, please contact NVIDIA at
|
| 582 |
+
nvidia-compute-license-questions@nvidia.com.
|
| 583 |
+
|
| 584 |
+
|
| 585 |
+
2.6. Attachment A
|
| 586 |
+
|
| 587 |
+
The following CUDA Toolkit files may be distributed with
|
| 588 |
+
applications developed by you, including certain
|
| 589 |
+
variations of these files that have version number or
|
| 590 |
+
architecture specific information embedded in the file name -
|
| 591 |
+
as an example only, for release version 9.0 of the 64-bit
|
| 592 |
+
Windows software, the file cudart64_90.dll is redistributable.
|
| 593 |
+
|
| 594 |
+
Component
|
| 595 |
+
|
| 596 |
+
CUDA Runtime
|
| 597 |
+
|
| 598 |
+
Windows
|
| 599 |
+
|
| 600 |
+
cudart.dll, cudart_static.lib, cudadevrt.lib
|
| 601 |
+
|
| 602 |
+
Mac OSX
|
| 603 |
+
|
| 604 |
+
libcudart.dylib, libcudart_static.a, libcudadevrt.a
|
| 605 |
+
|
| 606 |
+
Linux
|
| 607 |
+
|
| 608 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
| 609 |
+
|
| 610 |
+
Android
|
| 611 |
+
|
| 612 |
+
libcudart.so, libcudart_static.a, libcudadevrt.a
|
| 613 |
+
|
| 614 |
+
Component
|
| 615 |
+
|
| 616 |
+
CUDA FFT Library
|
| 617 |
+
|
| 618 |
+
Windows
|
| 619 |
+
|
| 620 |
+
cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
|
| 621 |
+
|
| 622 |
+
Mac OSX
|
| 623 |
+
|
| 624 |
+
libcufft.dylib, libcufft_static.a, libcufftw.dylib,
|
| 625 |
+
libcufftw_static.a
|
| 626 |
+
|
| 627 |
+
Linux
|
| 628 |
+
|
| 629 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
| 630 |
+
libcufftw_static.a
|
| 631 |
+
|
| 632 |
+
Android
|
| 633 |
+
|
| 634 |
+
libcufft.so, libcufft_static.a, libcufftw.so,
|
| 635 |
+
libcufftw_static.a
|
| 636 |
+
|
| 637 |
+
Component
|
| 638 |
+
|
| 639 |
+
CUDA BLAS Library
|
| 640 |
+
|
| 641 |
+
Windows
|
| 642 |
+
|
| 643 |
+
cublas.dll, cublasLt.dll
|
| 644 |
+
|
| 645 |
+
Mac OSX
|
| 646 |
+
|
| 647 |
+
libcublas.dylib, libcublasLt.dylib, libcublas_static.a,
|
| 648 |
+
libcublasLt_static.a
|
| 649 |
+
|
| 650 |
+
Linux
|
| 651 |
+
|
| 652 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
| 653 |
+
libcublasLt_static.a
|
| 654 |
+
|
| 655 |
+
Android
|
| 656 |
+
|
| 657 |
+
libcublas.so, libcublasLt.so, libcublas_static.a,
|
| 658 |
+
libcublasLt_static.a
|
| 659 |
+
|
| 660 |
+
Component
|
| 661 |
+
|
| 662 |
+
NVIDIA "Drop-in" BLAS Library
|
| 663 |
+
|
| 664 |
+
Windows
|
| 665 |
+
|
| 666 |
+
nvblas.dll
|
| 667 |
+
|
| 668 |
+
Mac OSX
|
| 669 |
+
|
| 670 |
+
libnvblas.dylib
|
| 671 |
+
|
| 672 |
+
Linux
|
| 673 |
+
|
| 674 |
+
libnvblas.so
|
| 675 |
+
|
| 676 |
+
Component
|
| 677 |
+
|
| 678 |
+
CUDA Sparse Matrix Library
|
| 679 |
+
|
| 680 |
+
Windows
|
| 681 |
+
|
| 682 |
+
cusparse.dll, cusparse.lib
|
| 683 |
+
|
| 684 |
+
Mac OSX
|
| 685 |
+
|
| 686 |
+
libcusparse.dylib, libcusparse_static.a
|
| 687 |
+
|
| 688 |
+
Linux
|
| 689 |
+
|
| 690 |
+
libcusparse.so, libcusparse_static.a
|
| 691 |
+
|
| 692 |
+
Android
|
| 693 |
+
|
| 694 |
+
libcusparse.so, libcusparse_static.a
|
| 695 |
+
|
| 696 |
+
Component
|
| 697 |
+
|
| 698 |
+
CUDA Linear Solver Library
|
| 699 |
+
|
| 700 |
+
Windows
|
| 701 |
+
|
| 702 |
+
cusolver.dll, cusolver.lib
|
| 703 |
+
|
| 704 |
+
Mac OSX
|
| 705 |
+
|
| 706 |
+
libcusolver.dylib, libcusolver_static.a
|
| 707 |
+
|
| 708 |
+
Linux
|
| 709 |
+
|
| 710 |
+
libcusolver.so, libcusolver_static.a
|
| 711 |
+
|
| 712 |
+
Android
|
| 713 |
+
|
| 714 |
+
libcusolver.so, libcusolver_static.a
|
| 715 |
+
|
| 716 |
+
Component
|
| 717 |
+
|
| 718 |
+
CUDA Random Number Generation Library
|
| 719 |
+
|
| 720 |
+
Windows
|
| 721 |
+
|
| 722 |
+
curand.dll, curand.lib
|
| 723 |
+
|
| 724 |
+
Mac OSX
|
| 725 |
+
|
| 726 |
+
libcurand.dylib, libcurand_static.a
|
| 727 |
+
|
| 728 |
+
Linux
|
| 729 |
+
|
| 730 |
+
libcurand.so, libcurand_static.a
|
| 731 |
+
|
| 732 |
+
Android
|
| 733 |
+
|
| 734 |
+
libcurand.so, libcurand_static.a
|
| 735 |
+
|
| 736 |
+
Component
|
| 737 |
+
|
| 738 |
+
NVIDIA Performance Primitives Library
|
| 739 |
+
|
| 740 |
+
Windows
|
| 741 |
+
|
| 742 |
+
nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll,
|
| 743 |
+
nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll,
|
| 744 |
+
nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib,
|
| 745 |
+
nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll,
|
| 746 |
+
nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
|
| 747 |
+
|
| 748 |
+
Mac OSX
|
| 749 |
+
|
| 750 |
+
libnppc.dylib, libnppc_static.a, libnppial.dylib,
|
| 751 |
+
libnppial_static.a, libnppicc.dylib, libnppicc_static.a,
|
| 752 |
+
libnppicom.dylib, libnppicom_static.a, libnppidei.dylib,
|
| 753 |
+
libnppidei_static.a, libnppif.dylib, libnppif_static.a,
|
| 754 |
+
libnppig.dylib, libnppig_static.a, libnppim.dylib,
|
| 755 |
+
libnppisu_static.a, libnppitc.dylib, libnppitc_static.a,
|
| 756 |
+
libnpps.dylib, libnpps_static.a
|
| 757 |
+
|
| 758 |
+
Linux
|
| 759 |
+
|
| 760 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
| 761 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
| 762 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
| 763 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
| 764 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
| 765 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
| 766 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
| 767 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
| 768 |
+
|
| 769 |
+
Android
|
| 770 |
+
|
| 771 |
+
libnppc.so, libnppc_static.a, libnppial.so,
|
| 772 |
+
libnppial_static.a, libnppicc.so, libnppicc_static.a,
|
| 773 |
+
libnppicom.so, libnppicom_static.a, libnppidei.so,
|
| 774 |
+
libnppidei_static.a, libnppif.so, libnppif_static.a
|
| 775 |
+
libnppig.so, libnppig_static.a, libnppim.so,
|
| 776 |
+
libnppim_static.a, libnppist.so, libnppist_static.a,
|
| 777 |
+
libnppisu.so, libnppisu_static.a, libnppitc.so
|
| 778 |
+
libnppitc_static.a, libnpps.so, libnpps_static.a
|
| 779 |
+
|
| 780 |
+
Component
|
| 781 |
+
|
| 782 |
+
NVIDIA JPEG Library
|
| 783 |
+
|
| 784 |
+
Windows
|
| 785 |
+
|
| 786 |
+
nvjpeg.lib, nvjpeg.dll
|
| 787 |
+
|
| 788 |
+
Linux
|
| 789 |
+
|
| 790 |
+
libnvjpeg.so, libnvjpeg_static.a
|
| 791 |
+
|
| 792 |
+
Component
|
| 793 |
+
|
| 794 |
+
Internal common library required for statically linking to
|
| 795 |
+
cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
|
| 796 |
+
|
| 797 |
+
Mac OSX
|
| 798 |
+
|
| 799 |
+
libculibos.a
|
| 800 |
+
|
| 801 |
+
Linux
|
| 802 |
+
|
| 803 |
+
libculibos.a
|
| 804 |
+
|
| 805 |
+
Component
|
| 806 |
+
|
| 807 |
+
NVIDIA Runtime Compilation Library and Header
|
| 808 |
+
|
| 809 |
+
All
|
| 810 |
+
|
| 811 |
+
nvrtc.h
|
| 812 |
+
|
| 813 |
+
Windows
|
| 814 |
+
|
| 815 |
+
nvrtc.dll, nvrtc-builtins.dll
|
| 816 |
+
|
| 817 |
+
Mac OSX
|
| 818 |
+
|
| 819 |
+
libnvrtc.dylib, libnvrtc-builtins.dylib
|
| 820 |
+
|
| 821 |
+
Linux
|
| 822 |
+
|
| 823 |
+
libnvrtc.so, libnvrtc-builtins.so, libnvrtc_static.a, libnvrtx-builtins_static.a
|
| 824 |
+
|
| 825 |
+
Component
|
| 826 |
+
|
| 827 |
+
NVIDIA Optimizing Compiler Library
|
| 828 |
+
|
| 829 |
+
Windows
|
| 830 |
+
|
| 831 |
+
nvvm.dll
|
| 832 |
+
|
| 833 |
+
Mac OSX
|
| 834 |
+
|
| 835 |
+
libnvvm.dylib
|
| 836 |
+
|
| 837 |
+
Linux
|
| 838 |
+
|
| 839 |
+
libnvvm.so
|
| 840 |
+
|
| 841 |
+
Component
|
| 842 |
+
|
| 843 |
+
NVIDIA JIT Linking Library
|
| 844 |
+
|
| 845 |
+
Windows
|
| 846 |
+
|
| 847 |
+
libnvJitLink.dll, libnvJitLink.lib
|
| 848 |
+
|
| 849 |
+
Linux
|
| 850 |
+
|
| 851 |
+
libnvJitLink.so, libnvJitLink_static.a
|
| 852 |
+
|
| 853 |
+
Component
|
| 854 |
+
|
| 855 |
+
NVIDIA Common Device Math Functions Library
|
| 856 |
+
|
| 857 |
+
Windows
|
| 858 |
+
|
| 859 |
+
libdevice.10.bc
|
| 860 |
+
|
| 861 |
+
Mac OSX
|
| 862 |
+
|
| 863 |
+
libdevice.10.bc
|
| 864 |
+
|
| 865 |
+
Linux
|
| 866 |
+
|
| 867 |
+
libdevice.10.bc
|
| 868 |
+
|
| 869 |
+
Component
|
| 870 |
+
|
| 871 |
+
CUDA Occupancy Calculation Header Library
|
| 872 |
+
|
| 873 |
+
All
|
| 874 |
+
|
| 875 |
+
cuda_occupancy.h
|
| 876 |
+
|
| 877 |
+
Component
|
| 878 |
+
|
| 879 |
+
CUDA Half Precision Headers
|
| 880 |
+
|
| 881 |
+
All
|
| 882 |
+
|
| 883 |
+
cuda_fp16.h, cuda_fp16.hpp
|
| 884 |
+
|
| 885 |
+
Component
|
| 886 |
+
|
| 887 |
+
CUDA Profiling Tools Interface (CUPTI) Library
|
| 888 |
+
|
| 889 |
+
Windows
|
| 890 |
+
|
| 891 |
+
cupti.dll
|
| 892 |
+
|
| 893 |
+
Mac OSX
|
| 894 |
+
|
| 895 |
+
libcupti.dylib
|
| 896 |
+
|
| 897 |
+
Linux
|
| 898 |
+
|
| 899 |
+
libcupti.so
|
| 900 |
+
|
| 901 |
+
Component
|
| 902 |
+
|
| 903 |
+
NVIDIA Tools Extension Library
|
| 904 |
+
|
| 905 |
+
Windows
|
| 906 |
+
|
| 907 |
+
nvToolsExt.dll, nvToolsExt.lib
|
| 908 |
+
|
| 909 |
+
Mac OSX
|
| 910 |
+
|
| 911 |
+
libnvToolsExt.dylib
|
| 912 |
+
|
| 913 |
+
Linux
|
| 914 |
+
|
| 915 |
+
libnvToolsExt.so
|
| 916 |
+
|
| 917 |
+
Component
|
| 918 |
+
|
| 919 |
+
NVIDIA CUDA Driver Libraries
|
| 920 |
+
|
| 921 |
+
Linux
|
| 922 |
+
|
| 923 |
+
libcuda.so, libnvidia-ptxjitcompiler.so, libnvptxcompiler_static.a
|
| 924 |
+
|
| 925 |
+
Component
|
| 926 |
+
|
| 927 |
+
NVIDIA CUDA File IO Libraries and Header
|
| 928 |
+
|
| 929 |
+
All
|
| 930 |
+
|
| 931 |
+
cufile.h
|
| 932 |
+
|
| 933 |
+
Linux
|
| 934 |
+
|
| 935 |
+
libcufile.so, libcufile_rdma.so, libcufile_static.a,
|
| 936 |
+
libcufile_rdma_static.a
|
| 937 |
+
|
| 938 |
+
In addition to the rights above, for parties that are
|
| 939 |
+
developing software intended solely for use on Jetson
|
| 940 |
+
development kits or Jetson modules, and running Linux for
|
| 941 |
+
Tegra software, the following shall apply:
|
| 942 |
+
|
| 943 |
+
* The SDK may be distributed in its entirety, as provided by
|
| 944 |
+
NVIDIA, and without separation of its components, for you
|
| 945 |
+
and/or your licensees to create software development kits
|
| 946 |
+
for use only on the Jetson platform and running Linux for
|
| 947 |
+
Tegra software.
|
| 948 |
+
|
| 949 |
+
|
| 950 |
+
2.7. Attachment B
|
| 951 |
+
|
| 952 |
+
|
| 953 |
+
Additional Licensing Obligations
|
| 954 |
+
|
| 955 |
+
The following third party components included in the SOFTWARE
|
| 956 |
+
are licensed to Licensee pursuant to the following terms and
|
| 957 |
+
conditions:
|
| 958 |
+
|
| 959 |
+
1. Licensee's use of the GDB third party component is
|
| 960 |
+
subject to the terms and conditions of GNU GPL v3:
|
| 961 |
+
|
| 962 |
+
This product includes copyrighted third-party software licensed
|
| 963 |
+
under the terms of the GNU General Public License v3 ("GPL v3").
|
| 964 |
+
All third-party software packages are copyright by their respective
|
| 965 |
+
authors. GPL v3 terms and conditions are hereby incorporated into
|
| 966 |
+
the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
|
| 967 |
+
|
| 968 |
+
Consistent with these licensing requirements, the software
|
| 969 |
+
listed below is provided under the terms of the specified
|
| 970 |
+
open source software licenses. To obtain source code for
|
| 971 |
+
software provided under licenses that require
|
| 972 |
+
redistribution of source code, including the GNU General
|
| 973 |
+
Public License (GPL) and GNU Lesser General Public License
|
| 974 |
+
(LGPL), contact oss-requests@nvidia.com. This offer is
|
| 975 |
+
valid for a period of three (3) years from the date of the
|
| 976 |
+
distribution of this product by NVIDIA CORPORATION.
|
| 977 |
+
|
| 978 |
+
Component License
|
| 979 |
+
CUDA-GDB GPL v3
|
| 980 |
+
|
| 981 |
+
2. Licensee represents and warrants that any and all third
|
| 982 |
+
party licensing and/or royalty payment obligations in
|
| 983 |
+
connection with Licensee's use of the H.264 video codecs
|
| 984 |
+
are solely the responsibility of Licensee.
|
| 985 |
+
|
| 986 |
+
3. Licensee's use of the Thrust library is subject to the
|
| 987 |
+
terms and conditions of the Apache License Version 2.0.
|
| 988 |
+
All third-party software packages are copyright by their
|
| 989 |
+
respective authors. Apache License Version 2.0 terms and
|
| 990 |
+
conditions are hereby incorporated into the Agreement by
|
| 991 |
+
this reference.
|
| 992 |
+
http://www.apache.org/licenses/LICENSE-2.0.html
|
| 993 |
+
|
| 994 |
+
In addition, Licensee acknowledges the following notice:
|
| 995 |
+
Thrust includes source code from the Boost Iterator,
|
| 996 |
+
Tuple, System, and Random Number libraries.
|
| 997 |
+
|
| 998 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
| 999 |
+
. . . .
|
| 1000 |
+
|
| 1001 |
+
Permission is hereby granted, free of charge, to any person or
|
| 1002 |
+
organization obtaining a copy of the software and accompanying
|
| 1003 |
+
documentation covered by this license (the "Software") to use,
|
| 1004 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
| 1005 |
+
and to prepare derivative works of the Software, and to permit
|
| 1006 |
+
third-parties to whom the Software is furnished to do so, all
|
| 1007 |
+
subject to the following:
|
| 1008 |
+
|
| 1009 |
+
The copyright notices in the Software and this entire statement,
|
| 1010 |
+
including the above license grant, this restriction and the following
|
| 1011 |
+
disclaimer, must be included in all copies of the Software, in whole
|
| 1012 |
+
or in part, and all derivative works of the Software, unless such
|
| 1013 |
+
copies or derivative works are solely in the form of machine-executable
|
| 1014 |
+
object code generated by a source language processor.
|
| 1015 |
+
|
| 1016 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 1017 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 1018 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
| 1019 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
| 1020 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
| 1021 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
| 1022 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 1023 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
| 1024 |
+
|
| 1025 |
+
4. Licensee's use of the LLVM third party component is
|
| 1026 |
+
subject to the following terms and conditions:
|
| 1027 |
+
|
| 1028 |
+
======================================================
|
| 1029 |
+
LLVM Release License
|
| 1030 |
+
======================================================
|
| 1031 |
+
University of Illinois/NCSA
|
| 1032 |
+
Open Source License
|
| 1033 |
+
|
| 1034 |
+
Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
|
| 1035 |
+
All rights reserved.
|
| 1036 |
+
|
| 1037 |
+
Developed by:
|
| 1038 |
+
|
| 1039 |
+
LLVM Team
|
| 1040 |
+
|
| 1041 |
+
University of Illinois at Urbana-Champaign
|
| 1042 |
+
|
| 1043 |
+
http://llvm.org
|
| 1044 |
+
|
| 1045 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 1046 |
+
of this software and associated documentation files (the "Software"), to
|
| 1047 |
+
deal with the Software without restriction, including without limitation the
|
| 1048 |
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
| 1049 |
+
sell copies of the Software, and to permit persons to whom the Software is
|
| 1050 |
+
furnished to do so, subject to the following conditions:
|
| 1051 |
+
|
| 1052 |
+
* Redistributions of source code must retain the above copyright notice,
|
| 1053 |
+
this list of conditions and the following disclaimers.
|
| 1054 |
+
|
| 1055 |
+
* Redistributions in binary form must reproduce the above copyright
|
| 1056 |
+
notice, this list of conditions and the following disclaimers in the
|
| 1057 |
+
documentation and/or other materials provided with the distribution.
|
| 1058 |
+
|
| 1059 |
+
* Neither the names of the LLVM Team, University of Illinois at Urbana-
|
| 1060 |
+
Champaign, nor the names of its contributors may be used to endorse or
|
| 1061 |
+
promote products derived from this Software without specific prior
|
| 1062 |
+
written permission.
|
| 1063 |
+
|
| 1064 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 1065 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 1066 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
| 1067 |
+
THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
| 1068 |
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
| 1069 |
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
| 1070 |
+
DEALINGS WITH THE SOFTWARE.
|
| 1071 |
+
|
| 1072 |
+
5. Licensee's use of the PCRE third party component is
|
| 1073 |
+
subject to the following terms and conditions:
|
| 1074 |
+
|
| 1075 |
+
------------
|
| 1076 |
+
PCRE LICENCE
|
| 1077 |
+
------------
|
| 1078 |
+
PCRE is a library of functions to support regular expressions whose syntax
|
| 1079 |
+
and semantics are as close as possible to those of the Perl 5 language.
|
| 1080 |
+
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
|
| 1081 |
+
specified below. The documentation for PCRE, supplied in the "doc"
|
| 1082 |
+
directory, is distributed under the same terms as the software itself. The
|
| 1083 |
+
basic library functions are written in C and are freestanding. Also
|
| 1084 |
+
included in the distribution is a set of C++ wrapper functions, and a just-
|
| 1085 |
+
in-time compiler that can be used to optimize pattern matching. These are
|
| 1086 |
+
both optional features that can be omitted when the library is built.
|
| 1087 |
+
|
| 1088 |
+
THE BASIC LIBRARY FUNCTIONS
|
| 1089 |
+
---------------------------
|
| 1090 |
+
Written by: Philip Hazel
|
| 1091 |
+
Email local part: ph10
|
| 1092 |
+
Email domain: cam.ac.uk
|
| 1093 |
+
University of Cambridge Computing Service,
|
| 1094 |
+
Cambridge, England.
|
| 1095 |
+
Copyright (c) 1997-2012 University of Cambridge
|
| 1096 |
+
All rights reserved.
|
| 1097 |
+
|
| 1098 |
+
PCRE JUST-IN-TIME COMPILATION SUPPORT
|
| 1099 |
+
-------------------------------------
|
| 1100 |
+
Written by: Zoltan Herczeg
|
| 1101 |
+
Email local part: hzmester
|
| 1102 |
+
Emain domain: freemail.hu
|
| 1103 |
+
Copyright(c) 2010-2012 Zoltan Herczeg
|
| 1104 |
+
All rights reserved.
|
| 1105 |
+
|
| 1106 |
+
STACK-LESS JUST-IN-TIME COMPILER
|
| 1107 |
+
--------------------------------
|
| 1108 |
+
Written by: Zoltan Herczeg
|
| 1109 |
+
Email local part: hzmester
|
| 1110 |
+
Emain domain: freemail.hu
|
| 1111 |
+
Copyright(c) 2009-2012 Zoltan Herczeg
|
| 1112 |
+
All rights reserved.
|
| 1113 |
+
|
| 1114 |
+
THE C++ WRAPPER FUNCTIONS
|
| 1115 |
+
-------------------------
|
| 1116 |
+
Contributed by: Google Inc.
|
| 1117 |
+
Copyright (c) 2007-2012, Google Inc.
|
| 1118 |
+
All rights reserved.
|
| 1119 |
+
|
| 1120 |
+
THE "BSD" LICENCE
|
| 1121 |
+
-----------------
|
| 1122 |
+
Redistribution and use in source and binary forms, with or without
|
| 1123 |
+
modification, are permitted provided that the following conditions are met:
|
| 1124 |
+
|
| 1125 |
+
* Redistributions of source code must retain the above copyright notice,
|
| 1126 |
+
this list of conditions and the following disclaimer.
|
| 1127 |
+
|
| 1128 |
+
* Redistributions in binary form must reproduce the above copyright
|
| 1129 |
+
notice, this list of conditions and the following disclaimer in the
|
| 1130 |
+
documentation and/or other materials provided with the distribution.
|
| 1131 |
+
|
| 1132 |
+
* Neither the name of the University of Cambridge nor the name of Google
|
| 1133 |
+
Inc. nor the names of their contributors may be used to endorse or
|
| 1134 |
+
promote products derived from this software without specific prior
|
| 1135 |
+
written permission.
|
| 1136 |
+
|
| 1137 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
| 1138 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 1139 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 1140 |
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
| 1141 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
| 1142 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
| 1143 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
| 1144 |
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
| 1145 |
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
| 1146 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
| 1147 |
+
POSSIBILITY OF SUCH DAMAGE.
|
| 1148 |
+
|
| 1149 |
+
6. Some of the cuBLAS library routines were written by or
|
| 1150 |
+
derived from code written by Vasily Volkov and are subject
|
| 1151 |
+
to the Modified Berkeley Software Distribution License as
|
| 1152 |
+
follows:
|
| 1153 |
+
|
| 1154 |
+
Copyright (c) 2007-2009, Regents of the University of California
|
| 1155 |
+
|
| 1156 |
+
All rights reserved.
|
| 1157 |
+
|
| 1158 |
+
Redistribution and use in source and binary forms, with or without
|
| 1159 |
+
modification, are permitted provided that the following conditions are
|
| 1160 |
+
met:
|
| 1161 |
+
* Redistributions of source code must retain the above copyright
|
| 1162 |
+
notice, this list of conditions and the following disclaimer.
|
| 1163 |
+
* Redistributions in binary form must reproduce the above
|
| 1164 |
+
copyright notice, this list of conditions and the following
|
| 1165 |
+
disclaimer in the documentation and/or other materials provided
|
| 1166 |
+
with the distribution.
|
| 1167 |
+
* Neither the name of the University of California, Berkeley nor
|
| 1168 |
+
the names of its contributors may be used to endorse or promote
|
| 1169 |
+
products derived from this software without specific prior
|
| 1170 |
+
written permission.
|
| 1171 |
+
|
| 1172 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
| 1173 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
| 1174 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 1175 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
| 1176 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
| 1177 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 1178 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 1179 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
| 1180 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
| 1181 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
| 1182 |
+
POSSIBILITY OF SUCH DAMAGE.
|
| 1183 |
+
|
| 1184 |
+
7. Some of the cuBLAS library routines were written by or
|
| 1185 |
+
derived from code written by Davide Barbieri and are
|
| 1186 |
+
subject to the Modified Berkeley Software Distribution
|
| 1187 |
+
License as follows:
|
| 1188 |
+
|
| 1189 |
+
Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
|
| 1190 |
+
|
| 1191 |
+
All rights reserved.
|
| 1192 |
+
|
| 1193 |
+
Redistribution and use in source and binary forms, with or without
|
| 1194 |
+
modification, are permitted provided that the following conditions are
|
| 1195 |
+
met:
|
| 1196 |
+
* Redistributions of source code must retain the above copyright
|
| 1197 |
+
notice, this list of conditions and the following disclaimer.
|
| 1198 |
+
* Redistributions in binary form must reproduce the above
|
| 1199 |
+
copyright notice, this list of conditions and the following
|
| 1200 |
+
disclaimer in the documentation and/or other materials provided
|
| 1201 |
+
with the distribution.
|
| 1202 |
+
* The name of the author may not be used to endorse or promote
|
| 1203 |
+
products derived from this software without specific prior
|
| 1204 |
+
written permission.
|
| 1205 |
+
|
| 1206 |
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
|
| 1207 |
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
| 1208 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 1209 |
+
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
| 1210 |
+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
| 1211 |
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
| 1212 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 1213 |
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
| 1214 |
+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
| 1215 |
+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
| 1216 |
+
POSSIBILITY OF SUCH DAMAGE.
|
| 1217 |
+
|
| 1218 |
+
8. Some of the cuBLAS library routines were derived from
|
| 1219 |
+
code developed by the University of Tennessee and are
|
| 1220 |
+
subject to the Modified Berkeley Software Distribution
|
| 1221 |
+
License as follows:
|
| 1222 |
+
|
| 1223 |
+
Copyright (c) 2010 The University of Tennessee.
|
| 1224 |
+
|
| 1225 |
+
All rights reserved.
|
| 1226 |
+
|
| 1227 |
+
Redistribution and use in source and binary forms, with or without
|
| 1228 |
+
modification, are permitted provided that the following conditions are
|
| 1229 |
+
met:
|
| 1230 |
+
* Redistributions of source code must retain the above copyright
|
| 1231 |
+
notice, this list of conditions and the following disclaimer.
|
| 1232 |
+
* Redistributions in binary form must reproduce the above
|
| 1233 |
+
copyright notice, this list of conditions and the following
|
| 1234 |
+
disclaimer listed in this license in the documentation and/or
|
| 1235 |
+
other materials provided with the distribution.
|
| 1236 |
+
* Neither the name of the copyright holders nor the names of its
|
| 1237 |
+
contributors may be used to endorse or promote products derived
|
| 1238 |
+
from this software without specific prior written permission.
|
| 1239 |
+
|
| 1240 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1241 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1242 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1243 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1244 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1245 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1246 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1247 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1248 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1249 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1250 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1251 |
+
|
| 1252 |
+
9. Some of the cuBLAS library routines were written by or
|
| 1253 |
+
derived from code written by Jonathan Hogg and are subject
|
| 1254 |
+
to the Modified Berkeley Software Distribution License as
|
| 1255 |
+
follows:
|
| 1256 |
+
|
| 1257 |
+
Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
|
| 1258 |
+
|
| 1259 |
+
All rights reserved.
|
| 1260 |
+
|
| 1261 |
+
Redistribution and use in source and binary forms, with or without
|
| 1262 |
+
modification, are permitted provided that the following conditions are
|
| 1263 |
+
met:
|
| 1264 |
+
* Redistributions of source code must retain the above copyright
|
| 1265 |
+
notice, this list of conditions and the following disclaimer.
|
| 1266 |
+
* Redistributions in binary form must reproduce the above
|
| 1267 |
+
copyright notice, this list of conditions and the following
|
| 1268 |
+
disclaimer in the documentation and/or other materials provided
|
| 1269 |
+
with the distribution.
|
| 1270 |
+
* Neither the name of the STFC nor the names of its contributors
|
| 1271 |
+
may be used to endorse or promote products derived from this
|
| 1272 |
+
software without specific prior written permission.
|
| 1273 |
+
|
| 1274 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1275 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1276 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1277 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
|
| 1278 |
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
| 1279 |
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
| 1280 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
| 1281 |
+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
| 1282 |
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
| 1283 |
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
| 1284 |
+
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1285 |
+
|
| 1286 |
+
10. Some of the cuBLAS library routines were written by or
|
| 1287 |
+
derived from code written by Ahmad M. Abdelfattah, David
|
| 1288 |
+
Keyes, and Hatem Ltaief, and are subject to the Apache
|
| 1289 |
+
License, Version 2.0, as follows:
|
| 1290 |
+
|
| 1291 |
+
-- (C) Copyright 2013 King Abdullah University of Science and Technology
|
| 1292 |
+
Authors:
|
| 1293 |
+
Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa)
|
| 1294 |
+
David Keyes (david.keyes@kaust.edu.sa)
|
| 1295 |
+
Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
|
| 1296 |
+
|
| 1297 |
+
Redistribution and use in source and binary forms, with or without
|
| 1298 |
+
modification, are permitted provided that the following conditions
|
| 1299 |
+
are met:
|
| 1300 |
+
|
| 1301 |
+
* Redistributions of source code must retain the above copyright
|
| 1302 |
+
notice, this list of conditions and the following disclaimer.
|
| 1303 |
+
* Redistributions in binary form must reproduce the above copyright
|
| 1304 |
+
notice, this list of conditions and the following disclaimer in the
|
| 1305 |
+
documentation and/or other materials provided with the distribution.
|
| 1306 |
+
* Neither the name of the King Abdullah University of Science and
|
| 1307 |
+
Technology nor the names of its contributors may be used to endorse
|
| 1308 |
+
or promote products derived from this software without specific prior
|
| 1309 |
+
written permission.
|
| 1310 |
+
|
| 1311 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1312 |
+
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1313 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1314 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1315 |
+
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1316 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1317 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1318 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1319 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1320 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1321 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
|
| 1322 |
+
|
| 1323 |
+
11. Some of the cuSPARSE library routines were written by or
|
| 1324 |
+
derived from code written by Li-Wen Chang and are subject
|
| 1325 |
+
to the NCSA Open Source License as follows:
|
| 1326 |
+
|
| 1327 |
+
Copyright (c) 2012, University of Illinois.
|
| 1328 |
+
|
| 1329 |
+
All rights reserved.
|
| 1330 |
+
|
| 1331 |
+
Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
|
| 1332 |
+
|
| 1333 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
| 1334 |
+
a copy of this software and associated documentation files (the
|
| 1335 |
+
"Software"), to deal with the Software without restriction, including
|
| 1336 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
| 1337 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
| 1338 |
+
permit persons to whom the Software is furnished to do so, subject to
|
| 1339 |
+
the following conditions:
|
| 1340 |
+
* Redistributions of source code must retain the above copyright
|
| 1341 |
+
notice, this list of conditions and the following disclaimer.
|
| 1342 |
+
* Redistributions in binary form must reproduce the above
|
| 1343 |
+
copyright notice, this list of conditions and the following
|
| 1344 |
+
disclaimers in the documentation and/or other materials provided
|
| 1345 |
+
with the distribution.
|
| 1346 |
+
* Neither the names of IMPACT Group, University of Illinois, nor
|
| 1347 |
+
the names of its contributors may be used to endorse or promote
|
| 1348 |
+
products derived from this Software without specific prior
|
| 1349 |
+
written permission.
|
| 1350 |
+
|
| 1351 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 1352 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 1353 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
| 1354 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
|
| 1355 |
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
| 1356 |
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
| 1357 |
+
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
| 1358 |
+
SOFTWARE.
|
| 1359 |
+
|
| 1360 |
+
12. Some of the cuRAND library routines were written by or
|
| 1361 |
+
derived from code written by Mutsuo Saito and Makoto
|
| 1362 |
+
Matsumoto and are subject to the following license:
|
| 1363 |
+
|
| 1364 |
+
Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
|
| 1365 |
+
University. All rights reserved.
|
| 1366 |
+
|
| 1367 |
+
Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
|
| 1368 |
+
University and University of Tokyo. All rights reserved.
|
| 1369 |
+
|
| 1370 |
+
Redistribution and use in source and binary forms, with or without
|
| 1371 |
+
modification, are permitted provided that the following conditions are
|
| 1372 |
+
met:
|
| 1373 |
+
* Redistributions of source code must retain the above copyright
|
| 1374 |
+
notice, this list of conditions and the following disclaimer.
|
| 1375 |
+
* Redistributions in binary form must reproduce the above
|
| 1376 |
+
copyright notice, this list of conditions and the following
|
| 1377 |
+
disclaimer in the documentation and/or other materials provided
|
| 1378 |
+
with the distribution.
|
| 1379 |
+
* Neither the name of the Hiroshima University nor the names of
|
| 1380 |
+
its contributors may be used to endorse or promote products
|
| 1381 |
+
derived from this software without specific prior written
|
| 1382 |
+
permission.
|
| 1383 |
+
|
| 1384 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1385 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1386 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1387 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1388 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1389 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1390 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1391 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1392 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1393 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1394 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1395 |
+
|
| 1396 |
+
13. Some of the cuRAND library routines were derived from
|
| 1397 |
+
code developed by D. E. Shaw Research and are subject to
|
| 1398 |
+
the following license:
|
| 1399 |
+
|
| 1400 |
+
Copyright 2010-2011, D. E. Shaw Research.
|
| 1401 |
+
|
| 1402 |
+
All rights reserved.
|
| 1403 |
+
|
| 1404 |
+
Redistribution and use in source and binary forms, with or without
|
| 1405 |
+
modification, are permitted provided that the following conditions are
|
| 1406 |
+
met:
|
| 1407 |
+
* Redistributions of source code must retain the above copyright
|
| 1408 |
+
notice, this list of conditions, and the following disclaimer.
|
| 1409 |
+
* Redistributions in binary form must reproduce the above
|
| 1410 |
+
copyright notice, this list of conditions, and the following
|
| 1411 |
+
disclaimer in the documentation and/or other materials provided
|
| 1412 |
+
with the distribution.
|
| 1413 |
+
* Neither the name of D. E. Shaw Research nor the names of its
|
| 1414 |
+
contributors may be used to endorse or promote products derived
|
| 1415 |
+
from this software without specific prior written permission.
|
| 1416 |
+
|
| 1417 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1418 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1419 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1420 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1421 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1422 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1423 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1424 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1425 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1426 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1427 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1428 |
+
|
| 1429 |
+
14. Some of the Math library routines were written by or
|
| 1430 |
+
derived from code developed by Norbert Juffa and are
|
| 1431 |
+
subject to the following license:
|
| 1432 |
+
|
| 1433 |
+
Copyright (c) 2015-2017, Norbert Juffa
|
| 1434 |
+
All rights reserved.
|
| 1435 |
+
|
| 1436 |
+
Redistribution and use in source and binary forms, with or without
|
| 1437 |
+
modification, are permitted provided that the following conditions
|
| 1438 |
+
are met:
|
| 1439 |
+
|
| 1440 |
+
1. Redistributions of source code must retain the above copyright
|
| 1441 |
+
notice, this list of conditions and the following disclaimer.
|
| 1442 |
+
|
| 1443 |
+
2. Redistributions in binary form must reproduce the above copyright
|
| 1444 |
+
notice, this list of conditions and the following disclaimer in the
|
| 1445 |
+
documentation and/or other materials provided with the distribution.
|
| 1446 |
+
|
| 1447 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1448 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1449 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1450 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1451 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1452 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1453 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1454 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1455 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1456 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1457 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1458 |
+
|
| 1459 |
+
15. Licensee's use of the lz4 third party component is
|
| 1460 |
+
subject to the following terms and conditions:
|
| 1461 |
+
|
| 1462 |
+
Copyright (C) 2011-2013, Yann Collet.
|
| 1463 |
+
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
| 1464 |
+
|
| 1465 |
+
Redistribution and use in source and binary forms, with or without
|
| 1466 |
+
modification, are permitted provided that the following conditions are
|
| 1467 |
+
met:
|
| 1468 |
+
|
| 1469 |
+
* Redistributions of source code must retain the above copyright
|
| 1470 |
+
notice, this list of conditions and the following disclaimer.
|
| 1471 |
+
* Redistributions in binary form must reproduce the above
|
| 1472 |
+
copyright notice, this list of conditions and the following disclaimer
|
| 1473 |
+
in the documentation and/or other materials provided with the
|
| 1474 |
+
distribution.
|
| 1475 |
+
|
| 1476 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
| 1477 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
| 1478 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
| 1479 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
| 1480 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
| 1481 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
| 1482 |
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 1483 |
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 1484 |
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 1485 |
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| 1486 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 1487 |
+
|
| 1488 |
+
16. The NPP library uses code from the Boost Math Toolkit,
|
| 1489 |
+
and is subject to the following license:
|
| 1490 |
+
|
| 1491 |
+
Boost Software License - Version 1.0 - August 17th, 2003
|
| 1492 |
+
. . . .
|
| 1493 |
+
|
| 1494 |
+
Permission is hereby granted, free of charge, to any person or
|
| 1495 |
+
organization obtaining a copy of the software and accompanying
|
| 1496 |
+
documentation covered by this license (the "Software") to use,
|
| 1497 |
+
reproduce, display, distribute, execute, and transmit the Software,
|
| 1498 |
+
and to prepare derivative works of the Software, and to permit
|
| 1499 |
+
third-parties to whom the Software is furnished to do so, all
|
| 1500 |
+
subject to the following:
|
| 1501 |
+
|
| 1502 |
+
The copyright notices in the Software and this entire statement,
|
| 1503 |
+
including the above license grant, this restriction and the following
|
| 1504 |
+
disclaimer, must be included in all copies of the Software, in whole
|
| 1505 |
+
or in part, and all derivative works of the Software, unless such
|
| 1506 |
+
copies or derivative works are solely in the form of machine-executable
|
| 1507 |
+
object code generated by a source language processor.
|
| 1508 |
+
|
| 1509 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 1510 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 1511 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
|
| 1512 |
+
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
| 1513 |
+
ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
|
| 1514 |
+
OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
|
| 1515 |
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 1516 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
| 1517 |
+
|
| 1518 |
+
17. Portions of the Nsight Eclipse Edition is subject to the
|
| 1519 |
+
following license:
|
| 1520 |
+
|
| 1521 |
+
The Eclipse Foundation makes available all content in this plug-in
|
| 1522 |
+
("Content"). Unless otherwise indicated below, the Content is provided
|
| 1523 |
+
to you under the terms and conditions of the Eclipse Public License
|
| 1524 |
+
Version 1.0 ("EPL"). A copy of the EPL is available at http://
|
| 1525 |
+
www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
|
| 1526 |
+
will mean the Content.
|
| 1527 |
+
|
| 1528 |
+
If you did not receive this Content directly from the Eclipse
|
| 1529 |
+
Foundation, the Content is being redistributed by another party
|
| 1530 |
+
("Redistributor") and different terms and conditions may apply to your
|
| 1531 |
+
use of any object code in the Content. Check the Redistributor's
|
| 1532 |
+
license that was provided with the Content. If no such license exists,
|
| 1533 |
+
contact the Redistributor. Unless otherwise indicated below, the terms
|
| 1534 |
+
and conditions of the EPL still apply to any source code in the
|
| 1535 |
+
Content and such source code may be obtained at http://www.eclipse.org.
|
| 1536 |
+
|
| 1537 |
+
18. Some of the cuBLAS library routines uses code from
|
| 1538 |
+
OpenAI, which is subject to the following license:
|
| 1539 |
+
|
| 1540 |
+
License URL
|
| 1541 |
+
https://github.com/openai/openai-gemm/blob/master/LICENSE
|
| 1542 |
+
|
| 1543 |
+
License Text
|
| 1544 |
+
The MIT License
|
| 1545 |
+
|
| 1546 |
+
Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
|
| 1547 |
+
|
| 1548 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 1549 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 1550 |
+
in the Software without restriction, including without limitation the rights
|
| 1551 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 1552 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 1553 |
+
furnished to do so, subject to the following conditions:
|
| 1554 |
+
|
| 1555 |
+
The above copyright notice and this permission notice shall be included in
|
| 1556 |
+
all copies or substantial portions of the Software.
|
| 1557 |
+
|
| 1558 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 1559 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 1560 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 1561 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 1562 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 1563 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 1564 |
+
THE SOFTWARE.
|
| 1565 |
+
|
| 1566 |
+
19. Licensee's use of the Visual Studio Setup Configuration
|
| 1567 |
+
Samples is subject to the following license:
|
| 1568 |
+
|
| 1569 |
+
The MIT License (MIT)
|
| 1570 |
+
Copyright (C) Microsoft Corporation. All rights reserved.
|
| 1571 |
+
|
| 1572 |
+
Permission is hereby granted, free of charge, to any person
|
| 1573 |
+
obtaining a copy of this software and associated documentation
|
| 1574 |
+
files (the "Software"), to deal in the Software without restriction,
|
| 1575 |
+
including without limitation the rights to use, copy, modify, merge,
|
| 1576 |
+
publish, distribute, sublicense, and/or sell copies of the Software,
|
| 1577 |
+
and to permit persons to whom the Software is furnished to do so,
|
| 1578 |
+
subject to the following conditions:
|
| 1579 |
+
|
| 1580 |
+
The above copyright notice and this permission notice shall be included
|
| 1581 |
+
in all copies or substantial portions of the Software.
|
| 1582 |
+
|
| 1583 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 1584 |
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 1585 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 1586 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 1587 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 1588 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
| 1589 |
+
|
| 1590 |
+
20. Licensee's use of linmath.h header for CPU functions for
|
| 1591 |
+
GL vector/matrix operations from lunarG is subject to the
|
| 1592 |
+
Apache License Version 2.0.
|
| 1593 |
+
|
| 1594 |
+
21. The DX12-CUDA sample uses the d3dx12.h header, which is
|
| 1595 |
+
subject to the MIT license.
|
| 1596 |
+
|
| 1597 |
+
22. Components of the driver and compiler used for binary management, including
|
| 1598 |
+
nvFatBin, nvcc, and cuobjdump, use the Zstandard library which is subject to
|
| 1599 |
+
the following license:
|
| 1600 |
+
|
| 1601 |
+
BSD License
|
| 1602 |
+
|
| 1603 |
+
For Zstandard software
|
| 1604 |
+
|
| 1605 |
+
Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
|
| 1606 |
+
|
| 1607 |
+
Redistribution and use in source and binary forms, with or without modification,
|
| 1608 |
+
are permitted provided that the following conditions are met:
|
| 1609 |
+
|
| 1610 |
+
* Redistributions of source code must retain the above copyright notice, this
|
| 1611 |
+
list of conditions and the following disclaimer.
|
| 1612 |
+
|
| 1613 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
| 1614 |
+
this list of conditions and the following disclaimer in the documentation
|
| 1615 |
+
and/or other materials provided with the distribution.
|
| 1616 |
+
|
| 1617 |
+
* Neither the name Facebook, nor Meta, nor the names of its contributors may
|
| 1618 |
+
be used to endorse or promote products derived from this software without
|
| 1619 |
+
specific prior written permission.
|
| 1620 |
+
|
| 1621 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
| 1622 |
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
| 1623 |
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
| 1624 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
| 1625 |
+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
| 1626 |
+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
| 1627 |
+
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
| 1628 |
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
| 1629 |
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
| 1630 |
+
OF SUCH DAMAGE.
|
| 1631 |
+
|
| 1632 |
+
-----------------
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/info/test/run_test.sh
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
set -ex
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
test -d $PREFIX/targets/x86_64-linux/lib
|
| 8 |
+
test -d $PREFIX/targets/x86_64-linux/include
|
| 9 |
+
exit 0
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/nv/detail/__preprocessor
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#if defined(__GNUC__)
|
| 12 |
+
# pragma GCC system_header
|
| 13 |
+
#endif
|
| 14 |
+
|
| 15 |
+
// For all compilers and dialects this header defines:
|
| 16 |
+
// _NV_EVAL
|
| 17 |
+
// _NV_IF
|
| 18 |
+
// _NV_CONCAT_EVAL
|
| 19 |
+
// For C++11 and up it defines:
|
| 20 |
+
// _NV_STRIP_PAREN
|
| 21 |
+
// _NV_DISPATCH_N_ARY
|
| 22 |
+
// _NV_FIRST_ARG
|
| 23 |
+
// _NV_REMOVE_PAREN
|
| 24 |
+
|
| 25 |
+
#if defined(_NV_TARGET_CPP11)
|
| 26 |
+
# define _NV_EVAL1(...) __VA_ARGS__
|
| 27 |
+
# define _NV_EVAL(...) _NV_EVAL1(__VA_ARGS__)
|
| 28 |
+
#else
|
| 29 |
+
# define _NV_EVAL1(x) x
|
| 30 |
+
# define _NV_EVAL(x) _NV_EVAL1(x)
|
| 31 |
+
#endif // C++11
|
| 32 |
+
|
| 33 |
+
#define _NV_CONCAT_EVAL1(l, r) _NV_EVAL(l##r)
|
| 34 |
+
#define _NV_CONCAT_EVAL(l, r) _NV_CONCAT_EVAL1(l, r)
|
| 35 |
+
|
| 36 |
+
#define _NV_IF_0(t, f) f
|
| 37 |
+
#define _NV_IF_1(t, f) t
|
| 38 |
+
|
| 39 |
+
#define _NV_IF_BIT(b) _NV_EVAL(_NV_IF_##b)
|
| 40 |
+
#define _NV_IF__EVAL(fn, t, f) _NV_EVAL(fn(t, f))
|
| 41 |
+
#define _NV_IF_EVAL(cond, t, f) _NV_IF__EVAL(_NV_IF_BIT(cond), t, f)
|
| 42 |
+
|
| 43 |
+
#define _NV_IF1(cond, t, f) _NV_IF_EVAL(cond, t, f)
|
| 44 |
+
#define _NV_IF(cond, t, f) _NV_IF1(_NV_EVAL(cond), _NV_EVAL(t), _NV_EVAL(f))
|
| 45 |
+
|
| 46 |
+
#if defined(_NV_TARGET_CPP11)
|
| 47 |
+
|
| 48 |
+
// The below mechanisms were derived from: https://gustedt.wordpress.com/2010/06/08/detect-empty-macro-arguments/
|
| 49 |
+
|
| 50 |
+
# define _NV_ARG32(...) _NV_EVAL(_NV_ARG32_0(__VA_ARGS__))
|
| 51 |
+
# define _NV_ARG32_0( \
|
| 52 |
+
_0, \
|
| 53 |
+
_1, \
|
| 54 |
+
_2, \
|
| 55 |
+
_3, \
|
| 56 |
+
_4, \
|
| 57 |
+
_5, \
|
| 58 |
+
_6, \
|
| 59 |
+
_7, \
|
| 60 |
+
_8, \
|
| 61 |
+
_9, \
|
| 62 |
+
_10, \
|
| 63 |
+
_11, \
|
| 64 |
+
_12, \
|
| 65 |
+
_13, \
|
| 66 |
+
_14, \
|
| 67 |
+
_15, \
|
| 68 |
+
_16, \
|
| 69 |
+
_17, \
|
| 70 |
+
_18, \
|
| 71 |
+
_19, \
|
| 72 |
+
_20, \
|
| 73 |
+
_21, \
|
| 74 |
+
_22, \
|
| 75 |
+
_23, \
|
| 76 |
+
_24, \
|
| 77 |
+
_25, \
|
| 78 |
+
_26, \
|
| 79 |
+
_27, \
|
| 80 |
+
_28, \
|
| 81 |
+
_29, \
|
| 82 |
+
_30, \
|
| 83 |
+
_31, \
|
| 84 |
+
...) \
|
| 85 |
+
_31
|
| 86 |
+
|
| 87 |
+
# define _NV_HAS_COMMA(...) \
|
| 88 |
+
_NV_ARG32(__VA_ARGS__, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0)
|
| 89 |
+
|
| 90 |
+
# define _NV_TRIGGER_PARENTHESIS_(...) ,
|
| 91 |
+
|
| 92 |
+
# define _NV_ISEMPTY(...) \
|
| 93 |
+
_NV_ISEMPTY0(/* test if there is just one argument, eventually an empty \
|
| 94 |
+
one */ \
|
| 95 |
+
_NV_EVAL(_NV_HAS_COMMA(__VA_ARGS__)), /* test if _TRIGGER_PARENTHESIS_ together with the argument \
|
| 96 |
+
adds a comma */ \
|
| 97 |
+
_NV_EVAL(_NV_HAS_COMMA(_NV_TRIGGER_PARENTHESIS_ __VA_ARGS__)), /* test if the argument together with \
|
| 98 |
+
a parenthesis adds a comma */ \
|
| 99 |
+
_NV_EVAL(_NV_HAS_COMMA(__VA_ARGS__(/*empty*/))), /* test if placing it between _TRIGGER_PARENTHESIS_ \
|
| 100 |
+
and the parenthesis adds a comma */ \
|
| 101 |
+
_NV_EVAL(_NV_HAS_COMMA(_NV_TRIGGER_PARENTHESIS_ __VA_ARGS__(/*empty*/))))
|
| 102 |
+
|
| 103 |
+
# define _NV_PASTE5(_0, _1, _2, _3, _4) _0##_1##_2##_3##_4
|
| 104 |
+
# define _NV_ISEMPTY0(_0, _1, _2, _3) _NV_HAS_COMMA(_NV_PASTE5(_NV_IS_EMPTY_CASE_, _0, _1, _2, _3))
|
| 105 |
+
# define _NV_IS_EMPTY_CASE_0001 ,
|
| 106 |
+
|
| 107 |
+
# define _NV_REMOVE_PAREN(...) _NV_REMOVE_PAREN1(__VA_ARGS__)
|
| 108 |
+
# define _NV_REMOVE_PAREN1(...) \
|
| 109 |
+
_NV_STRIP_PAREN(_NV_IF(_NV_TEST_PAREN(__VA_ARGS__), (_NV_STRIP_PAREN(__VA_ARGS__)), (__VA_ARGS__)))
|
| 110 |
+
|
| 111 |
+
# define _NV_STRIP_PAREN2(...) __VA_ARGS__
|
| 112 |
+
# define _NV_STRIP_PAREN1(...) _NV_STRIP_PAREN2 __VA_ARGS__
|
| 113 |
+
# define _NV_STRIP_PAREN(...) _NV_STRIP_PAREN1(__VA_ARGS__)
|
| 114 |
+
|
| 115 |
+
# define _NV_TEST_PAREN(...) _NV_TEST_PAREN1(__VA_ARGS__)
|
| 116 |
+
# define _NV_TEST_PAREN1(...) _NV_TEST_PAREN2(_NV_TEST_PAREN_DUMMY __VA_ARGS__)
|
| 117 |
+
# define _NV_TEST_PAREN2(...) _NV_TEST_PAREN3(_NV_CONCAT_EVAL(_, __VA_ARGS__))
|
| 118 |
+
# define _NV_TEST_PAREN3(...) _NV_EVAL(_NV_FIRST_ARG(__VA_ARGS__))
|
| 119 |
+
|
| 120 |
+
# define __NV_PAREN_YES 1
|
| 121 |
+
# define __NV_PAREN_NO 0
|
| 122 |
+
|
| 123 |
+
# define _NV_TEST_PAREN_DUMMY(...) _NV_PAREN_YES
|
| 124 |
+
# define __NV_TEST_PAREN_DUMMY __NV_PAREN_NO,
|
| 125 |
+
|
| 126 |
+
# define _NV_FIRST_ARG1(x, ...) x
|
| 127 |
+
# define _NV_FIRST_ARG(x, ...) _NV_FIRST_ARG1(x)
|
| 128 |
+
|
| 129 |
+
# define _NV_REMOVE_FIRST_ARGS1(...) __VA_ARGS__
|
| 130 |
+
# define _NV_REMOVE_FIRST_ARGS(x, ...) _NV_REMOVE_FIRST_ARGS1(__VA_ARGS__)
|
| 131 |
+
|
| 132 |
+
# define _NV_NUM_ARGS(...) _NV_NUM_ARGS0(__VA_ARGS__)
|
| 133 |
+
# define _NV_NUM_ARGS0(...) _NV_EVAL(_NV_NUM_ARGS1(__VA_ARGS__))
|
| 134 |
+
# define _NV_NUM_ARGS1(...) _NV_IF(_NV_ISEMPTY(__VA_ARGS__), 0, _NV_NUM_ARGS2(__VA_ARGS__))
|
| 135 |
+
# define _NV_NUM_ARGS2(...) \
|
| 136 |
+
_NV_ARG32( \
|
| 137 |
+
__VA_ARGS__, \
|
| 138 |
+
31, \
|
| 139 |
+
30, \
|
| 140 |
+
29, \
|
| 141 |
+
28, \
|
| 142 |
+
27, \
|
| 143 |
+
26, \
|
| 144 |
+
25, \
|
| 145 |
+
24, \
|
| 146 |
+
23, \
|
| 147 |
+
22, \
|
| 148 |
+
21, \
|
| 149 |
+
20, \
|
| 150 |
+
19, \
|
| 151 |
+
18, \
|
| 152 |
+
17, \
|
| 153 |
+
16, \
|
| 154 |
+
15, \
|
| 155 |
+
14, \
|
| 156 |
+
13, \
|
| 157 |
+
12, \
|
| 158 |
+
11, \
|
| 159 |
+
10, \
|
| 160 |
+
9, \
|
| 161 |
+
8, \
|
| 162 |
+
7, \
|
| 163 |
+
6, \
|
| 164 |
+
5, \
|
| 165 |
+
4, \
|
| 166 |
+
3, \
|
| 167 |
+
2, \
|
| 168 |
+
1, \
|
| 169 |
+
0)
|
| 170 |
+
|
| 171 |
+
# define _NV_DISPATCH_N_IMPL1(name, ...) _NV_EVAL(name(__VA_ARGS__))
|
| 172 |
+
# define _NV_DISPATCH_N_IMPL0(depth, name, ...) _NV_DISPATCH_N_IMPL1(_NV_CONCAT_EVAL(name, depth), __VA_ARGS__)
|
| 173 |
+
# define _NV_DISPATCH_N_IMPL(name, ...) _NV_DISPATCH_N_IMPL0(_NV_NUM_ARGS(__VA_ARGS__), name, __VA_ARGS__)
|
| 174 |
+
# define _NV_DISPATCH_N_ARY(name, ...) _NV_DISPATCH_N_IMPL(name, __VA_ARGS__)
|
| 175 |
+
|
| 176 |
+
#endif // C++11
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/nv/detail/__target_macros
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//===----------------------------------------------------------------------===//
|
| 2 |
+
//
|
| 3 |
+
// Part of libcu++, the C++ Standard Library for your entire system,
|
| 4 |
+
// under the Apache License v2.0 with LLVM Exceptions.
|
| 5 |
+
// See https://llvm.org/LICENSE.txt for license information.
|
| 6 |
+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
| 7 |
+
// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
|
| 8 |
+
//
|
| 9 |
+
//===----------------------------------------------------------------------===//
|
| 10 |
+
|
| 11 |
+
#ifndef _NV__TARGET_MACROS
|
| 12 |
+
#define _NV__TARGET_MACROS
|
| 13 |
+
|
| 14 |
+
#include <nv/detail/__preprocessor>
|
| 15 |
+
|
| 16 |
+
#if defined(__GNUC__)
|
| 17 |
+
# pragma GCC system_header
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_350 nv::target::sm_35
|
| 21 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_370 nv::target::sm_37
|
| 22 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_500 nv::target::sm_50
|
| 23 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_520 nv::target::sm_52
|
| 24 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_530 nv::target::sm_53
|
| 25 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_600 nv::target::sm_60
|
| 26 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_610 nv::target::sm_61
|
| 27 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_620 nv::target::sm_62
|
| 28 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_700 nv::target::sm_70
|
| 29 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_720 nv::target::sm_72
|
| 30 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_750 nv::target::sm_75
|
| 31 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_800 nv::target::sm_80
|
| 32 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_860 nv::target::sm_86
|
| 33 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_870 nv::target::sm_87
|
| 34 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_890 nv::target::sm_89
|
| 35 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_900 nv::target::sm_90
|
| 36 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_1000 nv::target::sm_100
|
| 37 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_1010 nv::target::sm_101
|
| 38 |
+
#define _NV_TARGET_ARCH_TO_SELECTOR_1200 nv::target::sm_120
|
| 39 |
+
|
| 40 |
+
#define _NV_TARGET_ARCH_TO_SM_350 35
|
| 41 |
+
#define _NV_TARGET_ARCH_TO_SM_370 37
|
| 42 |
+
#define _NV_TARGET_ARCH_TO_SM_500 50
|
| 43 |
+
#define _NV_TARGET_ARCH_TO_SM_520 52
|
| 44 |
+
#define _NV_TARGET_ARCH_TO_SM_530 53
|
| 45 |
+
#define _NV_TARGET_ARCH_TO_SM_600 60
|
| 46 |
+
#define _NV_TARGET_ARCH_TO_SM_610 61
|
| 47 |
+
#define _NV_TARGET_ARCH_TO_SM_620 62
|
| 48 |
+
#define _NV_TARGET_ARCH_TO_SM_700 70
|
| 49 |
+
#define _NV_TARGET_ARCH_TO_SM_720 72
|
| 50 |
+
#define _NV_TARGET_ARCH_TO_SM_750 75
|
| 51 |
+
#define _NV_TARGET_ARCH_TO_SM_800 80
|
| 52 |
+
#define _NV_TARGET_ARCH_TO_SM_860 86
|
| 53 |
+
#define _NV_TARGET_ARCH_TO_SM_870 87
|
| 54 |
+
#define _NV_TARGET_ARCH_TO_SM_890 89
|
| 55 |
+
#define _NV_TARGET_ARCH_TO_SM_900 90
|
| 56 |
+
#define _NV_TARGET_ARCH_TO_SM_1000 100
|
| 57 |
+
#define _NV_TARGET_ARCH_TO_SM_1010 101
|
| 58 |
+
#define _NV_TARGET_ARCH_TO_SM_1200 120
|
| 59 |
+
|
| 60 |
+
// Only enable when compiling for CUDA/stdpar
|
| 61 |
+
#if defined(_NV_COMPILER_NVCXX) && defined(_NVHPC_CUDA)
|
| 62 |
+
|
| 63 |
+
# define _NV_TARGET_VAL_SM_35 nv::target::sm_35
|
| 64 |
+
# define _NV_TARGET_VAL_SM_37 nv::target::sm_37
|
| 65 |
+
# define _NV_TARGET_VAL_SM_50 nv::target::sm_50
|
| 66 |
+
# define _NV_TARGET_VAL_SM_52 nv::target::sm_52
|
| 67 |
+
# define _NV_TARGET_VAL_SM_53 nv::target::sm_53
|
| 68 |
+
# define _NV_TARGET_VAL_SM_60 nv::target::sm_60
|
| 69 |
+
# define _NV_TARGET_VAL_SM_61 nv::target::sm_61
|
| 70 |
+
# define _NV_TARGET_VAL_SM_62 nv::target::sm_62
|
| 71 |
+
# define _NV_TARGET_VAL_SM_70 nv::target::sm_70
|
| 72 |
+
# define _NV_TARGET_VAL_SM_72 nv::target::sm_72
|
| 73 |
+
# define _NV_TARGET_VAL_SM_75 nv::target::sm_75
|
| 74 |
+
# define _NV_TARGET_VAL_SM_80 nv::target::sm_80
|
| 75 |
+
# define _NV_TARGET_VAL_SM_86 nv::target::sm_86
|
| 76 |
+
# define _NV_TARGET_VAL_SM_87 nv::target::sm_87
|
| 77 |
+
# define _NV_TARGET_VAL_SM_89 nv::target::sm_89
|
| 78 |
+
# define _NV_TARGET_VAL_SM_90 nv::target::sm_90
|
| 79 |
+
# define _NV_TARGET_VAL_SM_100 nv::target::sm_100
|
| 80 |
+
# define _NV_TARGET_VAL_SM_101 nv::target::sm_101
|
| 81 |
+
# define _NV_TARGET_VAL_SM_120 nv::target::sm_120
|
| 82 |
+
|
| 83 |
+
# define _NV_TARGET___NV_IS_HOST nv::target::is_host
|
| 84 |
+
# define _NV_TARGET___NV_IS_DEVICE nv::target::is_device
|
| 85 |
+
|
| 86 |
+
# define _NV_TARGET___NV_ANY_TARGET (nv::target::any_target)
|
| 87 |
+
# define _NV_TARGET___NV_NO_TARGET (nv::target::no_target)
|
| 88 |
+
|
| 89 |
+
# if defined(NV_TARGET_SM_INTEGER_LIST)
|
| 90 |
+
# define NV_TARGET_MINIMUM_SM_SELECTOR _NV_FIRST_ARG(NV_TARGET_SM_SELECTOR_LIST)
|
| 91 |
+
# define NV_TARGET_MINIMUM_SM_INTEGER _NV_FIRST_ARG(NV_TARGET_SM_INTEGER_LIST)
|
| 92 |
+
# define __CUDA_MINIMUM_ARCH__ _NV_CONCAT_EVAL(_NV_FIRST_ARG(NV_TARGET_SM_INTEGER_LIST), 0)
|
| 93 |
+
# endif
|
| 94 |
+
|
| 95 |
+
# define _NV_TARGET_PROVIDES(q) nv::target::provides(q)
|
| 96 |
+
# define _NV_TARGET_IS_EXACTLY(q) nv::target::is_exactly(q)
|
| 97 |
+
|
| 98 |
+
#elif defined(_NV_COMPILER_NVCC) || defined(_NV_COMPILER_CLANG_CUDA)
|
| 99 |
+
|
| 100 |
+
# define _NV_TARGET_VAL_SM_35 350
|
| 101 |
+
# define _NV_TARGET_VAL_SM_37 370
|
| 102 |
+
# define _NV_TARGET_VAL_SM_50 500
|
| 103 |
+
# define _NV_TARGET_VAL_SM_52 520
|
| 104 |
+
# define _NV_TARGET_VAL_SM_53 530
|
| 105 |
+
# define _NV_TARGET_VAL_SM_60 600
|
| 106 |
+
# define _NV_TARGET_VAL_SM_61 610
|
| 107 |
+
# define _NV_TARGET_VAL_SM_62 620
|
| 108 |
+
# define _NV_TARGET_VAL_SM_70 700
|
| 109 |
+
# define _NV_TARGET_VAL_SM_72 720
|
| 110 |
+
# define _NV_TARGET_VAL_SM_75 750
|
| 111 |
+
# define _NV_TARGET_VAL_SM_80 800
|
| 112 |
+
# define _NV_TARGET_VAL_SM_86 860
|
| 113 |
+
# define _NV_TARGET_VAL_SM_87 870
|
| 114 |
+
# define _NV_TARGET_VAL_SM_89 890
|
| 115 |
+
# define _NV_TARGET_VAL_SM_90 900
|
| 116 |
+
# define _NV_TARGET_VAL_SM_100 1000
|
| 117 |
+
# define _NV_TARGET_VAL_SM_101 1010
|
| 118 |
+
# define _NV_TARGET_VAL_SM_120 1200
|
| 119 |
+
|
| 120 |
+
# if defined(__CUDA_ARCH__)
|
| 121 |
+
# define _NV_TARGET_VAL __CUDA_ARCH__
|
| 122 |
+
# define NV_TARGET_MINIMUM_SM_SELECTOR _NV_CONCAT_EVAL(_NV_TARGET_ARCH_TO_SELECTOR_, __CUDA_ARCH__)
|
| 123 |
+
# define NV_TARGET_MINIMUM_SM_INTEGER _NV_CONCAT_EVAL(_NV_TARGET_ARCH_TO_SM_, __CUDA_ARCH__)
|
| 124 |
+
# define __CUDA_MINIMUM_ARCH__ __CUDA_ARCH__
|
| 125 |
+
# endif
|
| 126 |
+
|
| 127 |
+
# if defined(__CUDA_ARCH__)
|
| 128 |
+
# define _NV_TARGET_IS_HOST 0
|
| 129 |
+
# define _NV_TARGET_IS_DEVICE 1
|
| 130 |
+
# else
|
| 131 |
+
# define _NV_TARGET_IS_HOST 1
|
| 132 |
+
# define _NV_TARGET_IS_DEVICE 0
|
| 133 |
+
# endif
|
| 134 |
+
|
| 135 |
+
# if defined(_NV_TARGET_VAL)
|
| 136 |
+
# define _NV_DEVICE_CHECK(q) (q)
|
| 137 |
+
# else
|
| 138 |
+
# define _NV_DEVICE_CHECK(q) (0)
|
| 139 |
+
# endif
|
| 140 |
+
|
| 141 |
+
# define _NV_TARGET_PROVIDES(q) _NV_DEVICE_CHECK(_NV_TARGET_VAL >= q)
|
| 142 |
+
# define _NV_TARGET_IS_EXACTLY(q) _NV_DEVICE_CHECK(_NV_TARGET_VAL == q)
|
| 143 |
+
|
| 144 |
+
// NVCC/NVCXX not being used, only host dispatches allowed
|
| 145 |
+
#else
|
| 146 |
+
|
| 147 |
+
# define _NV_COMPILER_NVCC
|
| 148 |
+
|
| 149 |
+
# define _NV_TARGET_VAL_SM_35 350
|
| 150 |
+
# define _NV_TARGET_VAL_SM_37 370
|
| 151 |
+
# define _NV_TARGET_VAL_SM_50 500
|
| 152 |
+
# define _NV_TARGET_VAL_SM_52 520
|
| 153 |
+
# define _NV_TARGET_VAL_SM_53 530
|
| 154 |
+
# define _NV_TARGET_VAL_SM_60 600
|
| 155 |
+
# define _NV_TARGET_VAL_SM_61 610
|
| 156 |
+
# define _NV_TARGET_VAL_SM_62 620
|
| 157 |
+
# define _NV_TARGET_VAL_SM_70 700
|
| 158 |
+
# define _NV_TARGET_VAL_SM_72 720
|
| 159 |
+
# define _NV_TARGET_VAL_SM_75 750
|
| 160 |
+
# define _NV_TARGET_VAL_SM_80 800
|
| 161 |
+
# define _NV_TARGET_VAL_SM_86 860
|
| 162 |
+
# define _NV_TARGET_VAL_SM_87 870
|
| 163 |
+
# define _NV_TARGET_VAL_SM_89 890
|
| 164 |
+
# define _NV_TARGET_VAL_SM_90 900
|
| 165 |
+
# define _NV_TARGET_VAL_SM_100 1000
|
| 166 |
+
# define _NV_TARGET_VAL_SM_101 1010
|
| 167 |
+
# define _NV_TARGET_VAL_SM_120 1200
|
| 168 |
+
|
| 169 |
+
# define _NV_TARGET_VAL 0
|
| 170 |
+
|
| 171 |
+
# define _NV_TARGET_IS_HOST 1
|
| 172 |
+
# define _NV_TARGET_IS_DEVICE 0
|
| 173 |
+
|
| 174 |
+
# define _NV_DEVICE_CHECK(q) (false)
|
| 175 |
+
|
| 176 |
+
# define _NV_TARGET_PROVIDES(q) _NV_DEVICE_CHECK(_NV_TARGET_VAL >= q)
|
| 177 |
+
# define _NV_TARGET_IS_EXACTLY(q) _NV_DEVICE_CHECK(_NV_TARGET_VAL == q)
|
| 178 |
+
|
| 179 |
+
#endif
|
| 180 |
+
|
| 181 |
+
#define _NV_TARGET___NV_PROVIDES_SM_35 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_35))
|
| 182 |
+
#define _NV_TARGET___NV_PROVIDES_SM_37 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_37))
|
| 183 |
+
#define _NV_TARGET___NV_PROVIDES_SM_50 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_50))
|
| 184 |
+
#define _NV_TARGET___NV_PROVIDES_SM_52 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_52))
|
| 185 |
+
#define _NV_TARGET___NV_PROVIDES_SM_53 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_53))
|
| 186 |
+
#define _NV_TARGET___NV_PROVIDES_SM_60 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_60))
|
| 187 |
+
#define _NV_TARGET___NV_PROVIDES_SM_61 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_61))
|
| 188 |
+
#define _NV_TARGET___NV_PROVIDES_SM_62 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_62))
|
| 189 |
+
#define _NV_TARGET___NV_PROVIDES_SM_70 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_70))
|
| 190 |
+
#define _NV_TARGET___NV_PROVIDES_SM_72 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_72))
|
| 191 |
+
#define _NV_TARGET___NV_PROVIDES_SM_75 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_75))
|
| 192 |
+
#define _NV_TARGET___NV_PROVIDES_SM_80 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_80))
|
| 193 |
+
#define _NV_TARGET___NV_PROVIDES_SM_86 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_86))
|
| 194 |
+
#define _NV_TARGET___NV_PROVIDES_SM_87 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_87))
|
| 195 |
+
#define _NV_TARGET___NV_PROVIDES_SM_89 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_89))
|
| 196 |
+
#define _NV_TARGET___NV_PROVIDES_SM_90 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_90))
|
| 197 |
+
#define _NV_TARGET___NV_PROVIDES_SM_100 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_100))
|
| 198 |
+
#define _NV_TARGET___NV_PROVIDES_SM_101 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_101))
|
| 199 |
+
#define _NV_TARGET___NV_PROVIDES_SM_120 (_NV_TARGET_PROVIDES(_NV_TARGET_VAL_SM_120))
|
| 200 |
+
|
| 201 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_35 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_35))
|
| 202 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_37 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_37))
|
| 203 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_50 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_50))
|
| 204 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_52 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_52))
|
| 205 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_53 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_53))
|
| 206 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_60 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_60))
|
| 207 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_61 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_61))
|
| 208 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_62 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_62))
|
| 209 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_70 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_70))
|
| 210 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_72 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_72))
|
| 211 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_75 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_75))
|
| 212 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_80 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_80))
|
| 213 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_86 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_86))
|
| 214 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_87 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_87))
|
| 215 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_89 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_89))
|
| 216 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_90 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_90))
|
| 217 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_100 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_100))
|
| 218 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_101 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_101))
|
| 219 |
+
#define _NV_TARGET___NV_IS_EXACTLY_SM_120 (_NV_TARGET_IS_EXACTLY(_NV_TARGET_VAL_SM_120))
|
| 220 |
+
|
| 221 |
+
#define NV_PROVIDES_SM_35 __NV_PROVIDES_SM_35
|
| 222 |
+
#define NV_PROVIDES_SM_37 __NV_PROVIDES_SM_37
|
| 223 |
+
#define NV_PROVIDES_SM_50 __NV_PROVIDES_SM_50
|
| 224 |
+
#define NV_PROVIDES_SM_52 __NV_PROVIDES_SM_52
|
| 225 |
+
#define NV_PROVIDES_SM_53 __NV_PROVIDES_SM_53
|
| 226 |
+
#define NV_PROVIDES_SM_60 __NV_PROVIDES_SM_60
|
| 227 |
+
#define NV_PROVIDES_SM_61 __NV_PROVIDES_SM_61
|
| 228 |
+
#define NV_PROVIDES_SM_62 __NV_PROVIDES_SM_62
|
| 229 |
+
#define NV_PROVIDES_SM_70 __NV_PROVIDES_SM_70
|
| 230 |
+
#define NV_PROVIDES_SM_72 __NV_PROVIDES_SM_72
|
| 231 |
+
#define NV_PROVIDES_SM_75 __NV_PROVIDES_SM_75
|
| 232 |
+
#define NV_PROVIDES_SM_80 __NV_PROVIDES_SM_80
|
| 233 |
+
#define NV_PROVIDES_SM_86 __NV_PROVIDES_SM_86
|
| 234 |
+
#define NV_PROVIDES_SM_87 __NV_PROVIDES_SM_87
|
| 235 |
+
#define NV_PROVIDES_SM_89 __NV_PROVIDES_SM_89
|
| 236 |
+
#define NV_PROVIDES_SM_90 __NV_PROVIDES_SM_90
|
| 237 |
+
#define NV_PROVIDES_SM_100 __NV_PROVIDES_SM_100
|
| 238 |
+
#define NV_PROVIDES_SM_101 __NV_PROVIDES_SM_101
|
| 239 |
+
#define NV_PROVIDES_SM_120 __NV_PROVIDES_SM_120
|
| 240 |
+
|
| 241 |
+
#define NV_IS_EXACTLY_SM_35 __NV_IS_EXACTLY_SM_35
|
| 242 |
+
#define NV_IS_EXACTLY_SM_37 __NV_IS_EXACTLY_SM_37
|
| 243 |
+
#define NV_IS_EXACTLY_SM_50 __NV_IS_EXACTLY_SM_50
|
| 244 |
+
#define NV_IS_EXACTLY_SM_52 __NV_IS_EXACTLY_SM_52
|
| 245 |
+
#define NV_IS_EXACTLY_SM_53 __NV_IS_EXACTLY_SM_53
|
| 246 |
+
#define NV_IS_EXACTLY_SM_60 __NV_IS_EXACTLY_SM_60
|
| 247 |
+
#define NV_IS_EXACTLY_SM_61 __NV_IS_EXACTLY_SM_61
|
| 248 |
+
#define NV_IS_EXACTLY_SM_62 __NV_IS_EXACTLY_SM_62
|
| 249 |
+
#define NV_IS_EXACTLY_SM_70 __NV_IS_EXACTLY_SM_70
|
| 250 |
+
#define NV_IS_EXACTLY_SM_72 __NV_IS_EXACTLY_SM_72
|
| 251 |
+
#define NV_IS_EXACTLY_SM_75 __NV_IS_EXACTLY_SM_75
|
| 252 |
+
#define NV_IS_EXACTLY_SM_80 __NV_IS_EXACTLY_SM_80
|
| 253 |
+
#define NV_IS_EXACTLY_SM_86 __NV_IS_EXACTLY_SM_86
|
| 254 |
+
#define NV_IS_EXACTLY_SM_87 __NV_IS_EXACTLY_SM_87
|
| 255 |
+
#define NV_IS_EXACTLY_SM_89 __NV_IS_EXACTLY_SM_89
|
| 256 |
+
#define NV_IS_EXACTLY_SM_90 __NV_IS_EXACTLY_SM_90
|
| 257 |
+
#define NV_IS_EXACTLY_SM_100 __NV_IS_EXACTLY_SM_100
|
| 258 |
+
#define NV_IS_EXACTLY_SM_101 __NV_IS_EXACTLY_SM_101
|
| 259 |
+
#define NV_IS_EXACTLY_SM_120 __NV_IS_EXACTLY_SM_120
|
| 260 |
+
|
| 261 |
+
// Disable SM_90a support on non-supporting compilers.
|
| 262 |
+
// Will re-enable for nvcc below.
|
| 263 |
+
#define NV_HAS_FEATURE_SM_90a NV_NO_TARGET
|
| 264 |
+
#define NV_HAS_FEATURE_SM_100a NV_NO_TARGET
|
| 265 |
+
#define NV_HAS_FEATURE_SM_101a NV_NO_TARGET
|
| 266 |
+
|
| 267 |
+
#define NV_IS_HOST __NV_IS_HOST
|
| 268 |
+
#define NV_IS_DEVICE __NV_IS_DEVICE
|
| 269 |
+
|
| 270 |
+
#define NV_ANY_TARGET __NV_ANY_TARGET
|
| 271 |
+
#define NV_NO_TARGET __NV_NO_TARGET
|
| 272 |
+
|
| 273 |
+
// Platform invoke mechanisms
|
| 274 |
+
#if defined(_NV_COMPILER_NVCXX) && defined(_NVHPC_CUDA)
|
| 275 |
+
|
| 276 |
+
# define _NV_ARCH_COND(q) (_NV_TARGET_##q)
|
| 277 |
+
|
| 278 |
+
# define _NV_BLOCK_EXPAND(...) _NV_REMOVE_PAREN(__VA_ARGS__)
|
| 279 |
+
|
| 280 |
+
# define _NV_TARGET_IF(cond, t, ...) \
|
| 281 |
+
(if target _NV_ARCH_COND(cond) { _NV_BLOCK_EXPAND(t) } else {_NV_BLOCK_EXPAND(__VA_ARGS__)})
|
| 282 |
+
|
| 283 |
+
#elif defined(_NV_COMPILER_NVCC) || defined(_NV_COMPILER_CLANG_CUDA)
|
| 284 |
+
|
| 285 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_35)
|
| 286 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_35 1
|
| 287 |
+
# else
|
| 288 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_35 0
|
| 289 |
+
# endif
|
| 290 |
+
|
| 291 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_37)
|
| 292 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_37 1
|
| 293 |
+
# else
|
| 294 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_37 0
|
| 295 |
+
# endif
|
| 296 |
+
|
| 297 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_50)
|
| 298 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_50 1
|
| 299 |
+
# else
|
| 300 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_50 0
|
| 301 |
+
# endif
|
| 302 |
+
|
| 303 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_52)
|
| 304 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_52 1
|
| 305 |
+
# else
|
| 306 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_52 0
|
| 307 |
+
# endif
|
| 308 |
+
|
| 309 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_53)
|
| 310 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_53 1
|
| 311 |
+
# else
|
| 312 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_53 0
|
| 313 |
+
# endif
|
| 314 |
+
|
| 315 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_60)
|
| 316 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_60 1
|
| 317 |
+
# else
|
| 318 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_60 0
|
| 319 |
+
# endif
|
| 320 |
+
|
| 321 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_61)
|
| 322 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_61 1
|
| 323 |
+
# else
|
| 324 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_61 0
|
| 325 |
+
# endif
|
| 326 |
+
|
| 327 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_62)
|
| 328 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_62 1
|
| 329 |
+
# else
|
| 330 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_62 0
|
| 331 |
+
# endif
|
| 332 |
+
|
| 333 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_70)
|
| 334 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_70 1
|
| 335 |
+
# else
|
| 336 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_70 0
|
| 337 |
+
# endif
|
| 338 |
+
|
| 339 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_72)
|
| 340 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_72 1
|
| 341 |
+
# else
|
| 342 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_72 0
|
| 343 |
+
# endif
|
| 344 |
+
|
| 345 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_75)
|
| 346 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_75 1
|
| 347 |
+
# else
|
| 348 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_75 0
|
| 349 |
+
# endif
|
| 350 |
+
|
| 351 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_80)
|
| 352 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_80 1
|
| 353 |
+
# else
|
| 354 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_80 0
|
| 355 |
+
# endif
|
| 356 |
+
|
| 357 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_86)
|
| 358 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_86 1
|
| 359 |
+
# else
|
| 360 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_86 0
|
| 361 |
+
# endif
|
| 362 |
+
|
| 363 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_87)
|
| 364 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_87 1
|
| 365 |
+
# else
|
| 366 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_87 0
|
| 367 |
+
# endif
|
| 368 |
+
|
| 369 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_89)
|
| 370 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_89 1
|
| 371 |
+
# else
|
| 372 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_89 0
|
| 373 |
+
# endif
|
| 374 |
+
|
| 375 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_90)
|
| 376 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_90 1
|
| 377 |
+
# else
|
| 378 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_90 0
|
| 379 |
+
# endif
|
| 380 |
+
|
| 381 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_100)
|
| 382 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_100 1
|
| 383 |
+
# else
|
| 384 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_100 0
|
| 385 |
+
# endif
|
| 386 |
+
|
| 387 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_101)
|
| 388 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_101 1
|
| 389 |
+
# else
|
| 390 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_101 0
|
| 391 |
+
# endif
|
| 392 |
+
|
| 393 |
+
# if (_NV_TARGET___NV_IS_EXACTLY_SM_120)
|
| 394 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_120 1
|
| 395 |
+
# else
|
| 396 |
+
# define _NV_TARGET_BOOL___NV_IS_EXACTLY_SM_120 0
|
| 397 |
+
# endif
|
| 398 |
+
|
| 399 |
+
// Re-enable sm_90a support in nvcc.
|
| 400 |
+
# undef NV_HAS_FEATURE_SM_90a
|
| 401 |
+
# define NV_HAS_FEATURE_SM_90a __NV_HAS_FEATURE_SM_90a
|
| 402 |
+
# if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) && defined(__CUDA_ARCH_FEAT_SM90_ALL))
|
| 403 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_90a 1
|
| 404 |
+
# else
|
| 405 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_90a 0
|
| 406 |
+
# endif
|
| 407 |
+
|
| 408 |
+
// Re-enable sm_100a support in nvcc.
|
| 409 |
+
# undef NV_HAS_FEATURE_SM_100a
|
| 410 |
+
# define NV_HAS_FEATURE_SM_100a __NV_HAS_FEATURE_SM_100a
|
| 411 |
+
# if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 1000) && defined(__CUDA_ARCH_FEAT_SM100_ALL))
|
| 412 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_100a 1
|
| 413 |
+
# else
|
| 414 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_100a 0
|
| 415 |
+
# endif
|
| 416 |
+
|
| 417 |
+
// Re-enable sm_101a support in nvcc.
|
| 418 |
+
# undef NV_HAS_FEATURE_SM_101a
|
| 419 |
+
# define NV_HAS_FEATURE_SM_101a __NV_HAS_FEATURE_SM_101a
|
| 420 |
+
# if (defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 1010) && defined(__CUDA_ARCH_FEAT_SM101_ALL))
|
| 421 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_101a 1
|
| 422 |
+
# else
|
| 423 |
+
# define _NV_TARGET_BOOL___NV_HAS_FEATURE_SM_101a 0
|
| 424 |
+
# endif
|
| 425 |
+
|
| 426 |
+
# if (_NV_TARGET_IS_HOST)
|
| 427 |
+
# define _NV_TARGET_BOOL___NV_IS_HOST 1
|
| 428 |
+
# define _NV_TARGET_BOOL___NV_IS_DEVICE 0
|
| 429 |
+
# else
|
| 430 |
+
# define _NV_TARGET_BOOL___NV_IS_HOST 0
|
| 431 |
+
# define _NV_TARGET_BOOL___NV_IS_DEVICE 1
|
| 432 |
+
# endif
|
| 433 |
+
|
| 434 |
+
# define _NV_TARGET_BOOL___NV_ANY_TARGET 1
|
| 435 |
+
# define _NV_TARGET_BOOL___NV_NO_TARGET 0
|
| 436 |
+
|
| 437 |
+
// NVCC Greater than stuff
|
| 438 |
+
|
| 439 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_35)
|
| 440 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_35 1
|
| 441 |
+
# else
|
| 442 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_35 0
|
| 443 |
+
# endif
|
| 444 |
+
|
| 445 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_37)
|
| 446 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_37 1
|
| 447 |
+
# else
|
| 448 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_37 0
|
| 449 |
+
# endif
|
| 450 |
+
|
| 451 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_50)
|
| 452 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_50 1
|
| 453 |
+
# else
|
| 454 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_50 0
|
| 455 |
+
# endif
|
| 456 |
+
|
| 457 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_52)
|
| 458 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_52 1
|
| 459 |
+
# else
|
| 460 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_52 0
|
| 461 |
+
# endif
|
| 462 |
+
|
| 463 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_53)
|
| 464 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_53 1
|
| 465 |
+
# else
|
| 466 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_53 0
|
| 467 |
+
# endif
|
| 468 |
+
|
| 469 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_60)
|
| 470 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_60 1
|
| 471 |
+
# else
|
| 472 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_60 0
|
| 473 |
+
# endif
|
| 474 |
+
|
| 475 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_61)
|
| 476 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_61 1
|
| 477 |
+
# else
|
| 478 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_61 0
|
| 479 |
+
# endif
|
| 480 |
+
|
| 481 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_62)
|
| 482 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_62 1
|
| 483 |
+
# else
|
| 484 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_62 0
|
| 485 |
+
# endif
|
| 486 |
+
|
| 487 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_70)
|
| 488 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_70 1
|
| 489 |
+
# else
|
| 490 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_70 0
|
| 491 |
+
# endif
|
| 492 |
+
|
| 493 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_72)
|
| 494 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_72 1
|
| 495 |
+
# else
|
| 496 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_72 0
|
| 497 |
+
# endif
|
| 498 |
+
|
| 499 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_75)
|
| 500 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_75 1
|
| 501 |
+
# else
|
| 502 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_75 0
|
| 503 |
+
# endif
|
| 504 |
+
|
| 505 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_80)
|
| 506 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_80 1
|
| 507 |
+
# else
|
| 508 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_80 0
|
| 509 |
+
# endif
|
| 510 |
+
|
| 511 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_86)
|
| 512 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_86 1
|
| 513 |
+
# else
|
| 514 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_86 0
|
| 515 |
+
# endif
|
| 516 |
+
|
| 517 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_87)
|
| 518 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_87 1
|
| 519 |
+
# else
|
| 520 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_87 0
|
| 521 |
+
# endif
|
| 522 |
+
|
| 523 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_89)
|
| 524 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_89 1
|
| 525 |
+
# else
|
| 526 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_89 0
|
| 527 |
+
# endif
|
| 528 |
+
|
| 529 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_90)
|
| 530 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_90 1
|
| 531 |
+
# else
|
| 532 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_90 0
|
| 533 |
+
# endif
|
| 534 |
+
|
| 535 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_100)
|
| 536 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_100 1
|
| 537 |
+
# else
|
| 538 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_100 0
|
| 539 |
+
# endif
|
| 540 |
+
|
| 541 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_101)
|
| 542 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_101 1
|
| 543 |
+
# else
|
| 544 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_101 0
|
| 545 |
+
# endif
|
| 546 |
+
|
| 547 |
+
# if (_NV_TARGET___NV_PROVIDES_SM_120)
|
| 548 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_120 1
|
| 549 |
+
# else
|
| 550 |
+
# define _NV_TARGET_BOOL___NV_PROVIDES_SM_120 0
|
| 551 |
+
# endif
|
| 552 |
+
|
| 553 |
+
# define _NV_ARCH_COND_CAT1(cond) _NV_TARGET_BOOL_##cond
|
| 554 |
+
# define _NV_ARCH_COND_CAT(cond) _NV_EVAL(_NV_ARCH_COND_CAT1(cond))
|
| 555 |
+
|
| 556 |
+
# define _NV_TARGET_EMPTY_PARAM ;
|
| 557 |
+
|
| 558 |
+
# if defined(_NV_TARGET_CPP11)
|
| 559 |
+
|
| 560 |
+
# define _NV_BLOCK_EXPAND(...) {_NV_REMOVE_PAREN(__VA_ARGS__)}
|
| 561 |
+
# define _NV_TARGET_IF(cond, t, ...) _NV_IF(_NV_ARCH_COND_CAT(cond), t, __VA_ARGS__)
|
| 562 |
+
|
| 563 |
+
# else // <C++11 fallback
|
| 564 |
+
|
| 565 |
+
# define _NV_BLOCK_EXPAND(x) {x}
|
| 566 |
+
|
| 567 |
+
# define _NV_TARGET_IF(cond, t) _NV_IF(_NV_ARCH_COND_CAT(cond), t, _NV_TARGET_EMPTY_PARAM)
|
| 568 |
+
# define _NV_TARGET_IF_ELSE(cond, t, f) _NV_IF(_NV_ARCH_COND_CAT(cond), t, f)
|
| 569 |
+
|
| 570 |
+
# endif
|
| 571 |
+
|
| 572 |
+
#endif // _NV_COMPILER_NVCC
|
| 573 |
+
|
| 574 |
+
#if defined(_NV_TARGET_CPP11)
|
| 575 |
+
|
| 576 |
+
# define _NV_TARGET_DISPATCH_HANDLE0()
|
| 577 |
+
# define _NV_TARGET_DISPATCH_HANDLE2(q, fn) _NV_TARGET_IF(q, fn)
|
| 578 |
+
# define _NV_TARGET_DISPATCH_HANDLE4(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE2(__VA_ARGS__))
|
| 579 |
+
# define _NV_TARGET_DISPATCH_HANDLE6(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE4(__VA_ARGS__))
|
| 580 |
+
# define _NV_TARGET_DISPATCH_HANDLE8(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE6(__VA_ARGS__))
|
| 581 |
+
# define _NV_TARGET_DISPATCH_HANDLE10(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE8(__VA_ARGS__))
|
| 582 |
+
# define _NV_TARGET_DISPATCH_HANDLE12(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE10(__VA_ARGS__))
|
| 583 |
+
# define _NV_TARGET_DISPATCH_HANDLE14(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE12(__VA_ARGS__))
|
| 584 |
+
# define _NV_TARGET_DISPATCH_HANDLE16(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE14(__VA_ARGS__))
|
| 585 |
+
# define _NV_TARGET_DISPATCH_HANDLE18(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE16(__VA_ARGS__))
|
| 586 |
+
# define _NV_TARGET_DISPATCH_HANDLE20(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE18(__VA_ARGS__))
|
| 587 |
+
# define _NV_TARGET_DISPATCH_HANDLE22(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE20(__VA_ARGS__))
|
| 588 |
+
# define _NV_TARGET_DISPATCH_HANDLE24(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE22(__VA_ARGS__))
|
| 589 |
+
# define _NV_TARGET_DISPATCH_HANDLE26(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE24(__VA_ARGS__))
|
| 590 |
+
# define _NV_TARGET_DISPATCH_HANDLE28(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE26(__VA_ARGS__))
|
| 591 |
+
# define _NV_TARGET_DISPATCH_HANDLE30(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE28(__VA_ARGS__))
|
| 592 |
+
# define _NV_TARGET_DISPATCH_HANDLE32(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE30(__VA_ARGS__))
|
| 593 |
+
# define _NV_TARGET_DISPATCH_HANDLE34(q, fn, ...) _NV_TARGET_IF(q, fn, _NV_TARGET_DISPATCH_HANDLE32(__VA_ARGS__))
|
| 594 |
+
|
| 595 |
+
# define _NV_TARGET_DISPATCH(...) _NV_BLOCK_EXPAND(_NV_DISPATCH_N_ARY(_NV_TARGET_DISPATCH_HANDLE, __VA_ARGS__))
|
| 596 |
+
|
| 597 |
+
// NV_IF_TARGET supports a false statement provided as a variadic macro
|
| 598 |
+
# define NV_IF_TARGET(cond, ...) _NV_BLOCK_EXPAND(_NV_TARGET_IF(cond, __VA_ARGS__))
|
| 599 |
+
# define NV_IF_ELSE_TARGET(cond, t, f) _NV_BLOCK_EXPAND(_NV_TARGET_IF(cond, t, f))
|
| 600 |
+
# define NV_DISPATCH_TARGET(...) _NV_TARGET_DISPATCH(__VA_ARGS__)
|
| 601 |
+
|
| 602 |
+
#else // <C++11 fallback
|
| 603 |
+
|
| 604 |
+
// NV_IF_TARGET does not support a fallback false statement in C++03 or C dialects
|
| 605 |
+
# define NV_IF_TARGET(cond, t) _NV_BLOCK_EXPAND(_NV_TARGET_IF(cond, t))
|
| 606 |
+
# define NV_IF_ELSE_TARGET(cond, t, f) _NV_BLOCK_EXPAND(_NV_TARGET_IF_ELSE(cond, t, f))
|
| 607 |
+
|
| 608 |
+
#endif
|
| 609 |
+
|
| 610 |
+
#endif // _NV__TARGET_MACROS
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/allocator_traits.h
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
// allocator_traits::rebind_alloc and allocator::rebind_traits are from libc++,
|
| 18 |
+
// dual licensed under the MIT and the University of Illinois Open Source
|
| 19 |
+
// Licenses.
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
#include <thrust/detail/config.h>
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
|
| 33 |
+
#include <thrust/detail/memory_wrapper.h>
|
| 34 |
+
#include <thrust/detail/type_traits.h>
|
| 35 |
+
#include <thrust/detail/type_traits/has_member_function.h>
|
| 36 |
+
#include <thrust/detail/type_traits/has_nested_type.h>
|
| 37 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 38 |
+
|
| 39 |
+
THRUST_NAMESPACE_BEGIN
|
| 40 |
+
namespace detail
|
| 41 |
+
{
|
| 42 |
+
|
| 43 |
+
// forward declaration for has_member_system
|
| 44 |
+
template <typename Alloc>
|
| 45 |
+
struct allocator_system;
|
| 46 |
+
|
| 47 |
+
namespace allocator_traits_detail
|
| 48 |
+
{
|
| 49 |
+
|
| 50 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_value_type, value_type)
|
| 51 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_pointer, pointer)
|
| 52 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_const_pointer, const_pointer)
|
| 53 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_reference, reference)
|
| 54 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_const_reference, const_reference)
|
| 55 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_void_pointer, void_pointer)
|
| 56 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_const_void_pointer, const_void_pointer)
|
| 57 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_difference_type, difference_type)
|
| 58 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_size_type, size_type)
|
| 59 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_propagate_on_container_copy_assignment, propagate_on_container_copy_assignment)
|
| 60 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_propagate_on_container_move_assignment, propagate_on_container_move_assignment)
|
| 61 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_propagate_on_container_swap, propagate_on_container_swap)
|
| 62 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_system_type, system_type)
|
| 63 |
+
__THRUST_DEFINE_HAS_NESTED_TYPE(has_is_always_equal, is_always_equal)
|
| 64 |
+
__THRUST_DEFINE_HAS_MEMBER_FUNCTION(has_member_system_impl, system)
|
| 65 |
+
|
| 66 |
+
template <typename Alloc, typename U>
|
| 67 |
+
struct has_rebind
|
| 68 |
+
{
|
| 69 |
+
using yes_type = char;
|
| 70 |
+
using no_type = int;
|
| 71 |
+
|
| 72 |
+
template <typename S>
|
| 73 |
+
static yes_type test(typename S::template rebind<U>::other*);
|
| 74 |
+
template <typename S>
|
| 75 |
+
static no_type test(...);
|
| 76 |
+
|
| 77 |
+
static bool const value = sizeof(test<U>(0)) == sizeof(yes_type);
|
| 78 |
+
|
| 79 |
+
using type = thrust::detail::integral_constant<bool, value>;
|
| 80 |
+
};
|
| 81 |
+
|
| 82 |
+
_CCCL_SUPPRESS_DEPRECATED_PUSH
|
| 83 |
+
|
| 84 |
+
// The following fields of std::allocator have been deprecated (since C++17).
|
| 85 |
+
// There's no way to detect it other than explicit specialization.
|
| 86 |
+
#if _CCCL_STD_VER >= 2017
|
| 87 |
+
# define THRUST_SPECIALIZE_DEPRECATED(trait_name) \
|
| 88 |
+
template <typename T> \
|
| 89 |
+
struct trait_name<std::allocator<T>> : false_type \
|
| 90 |
+
{};
|
| 91 |
+
|
| 92 |
+
THRUST_SPECIALIZE_DEPRECATED(has_is_always_equal)
|
| 93 |
+
THRUST_SPECIALIZE_DEPRECATED(has_pointer)
|
| 94 |
+
THRUST_SPECIALIZE_DEPRECATED(has_const_pointer)
|
| 95 |
+
THRUST_SPECIALIZE_DEPRECATED(has_reference)
|
| 96 |
+
THRUST_SPECIALIZE_DEPRECATED(has_const_reference)
|
| 97 |
+
|
| 98 |
+
# undef THRUST_SPECIALIZE_DEPRECATED
|
| 99 |
+
|
| 100 |
+
template <typename T, typename U>
|
| 101 |
+
struct has_rebind<std::allocator<T>, U> : false_type
|
| 102 |
+
{};
|
| 103 |
+
#endif
|
| 104 |
+
|
| 105 |
+
template <typename T>
|
| 106 |
+
struct nested_pointer
|
| 107 |
+
{
|
| 108 |
+
using type = typename T::pointer;
|
| 109 |
+
};
|
| 110 |
+
|
| 111 |
+
template <typename T>
|
| 112 |
+
struct nested_const_pointer
|
| 113 |
+
{
|
| 114 |
+
using type = typename T::const_pointer;
|
| 115 |
+
};
|
| 116 |
+
|
| 117 |
+
template <typename T>
|
| 118 |
+
struct nested_reference
|
| 119 |
+
{
|
| 120 |
+
using type = typename T::reference;
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
template <typename T>
|
| 124 |
+
struct nested_const_reference
|
| 125 |
+
{
|
| 126 |
+
using type = typename T::const_reference;
|
| 127 |
+
};
|
| 128 |
+
|
| 129 |
+
template <typename T>
|
| 130 |
+
struct nested_void_pointer
|
| 131 |
+
{
|
| 132 |
+
using type = typename T::void_pointer;
|
| 133 |
+
};
|
| 134 |
+
|
| 135 |
+
template <typename T>
|
| 136 |
+
struct nested_const_void_pointer
|
| 137 |
+
{
|
| 138 |
+
using type = typename T::const_void_pointer;
|
| 139 |
+
};
|
| 140 |
+
|
| 141 |
+
template <typename T>
|
| 142 |
+
struct nested_difference_type
|
| 143 |
+
{
|
| 144 |
+
using type = typename T::difference_type;
|
| 145 |
+
};
|
| 146 |
+
|
| 147 |
+
template <typename T>
|
| 148 |
+
struct nested_size_type
|
| 149 |
+
{
|
| 150 |
+
using type = typename T::size_type;
|
| 151 |
+
};
|
| 152 |
+
|
| 153 |
+
template <typename T>
|
| 154 |
+
struct nested_propagate_on_container_copy_assignment
|
| 155 |
+
{
|
| 156 |
+
using type = typename T::propagate_on_container_copy_assignment;
|
| 157 |
+
};
|
| 158 |
+
|
| 159 |
+
template <typename T>
|
| 160 |
+
struct nested_propagate_on_container_move_assignment
|
| 161 |
+
{
|
| 162 |
+
using type = typename T::propagate_on_container_move_assignment;
|
| 163 |
+
};
|
| 164 |
+
|
| 165 |
+
template <typename T>
|
| 166 |
+
struct nested_propagate_on_container_swap
|
| 167 |
+
{
|
| 168 |
+
using type = typename T::propagate_on_container_swap;
|
| 169 |
+
};
|
| 170 |
+
|
| 171 |
+
template <typename T>
|
| 172 |
+
struct nested_is_always_equal
|
| 173 |
+
{
|
| 174 |
+
using type = typename T::is_always_equal;
|
| 175 |
+
};
|
| 176 |
+
|
| 177 |
+
template <typename T>
|
| 178 |
+
struct nested_system_type
|
| 179 |
+
{
|
| 180 |
+
using type = typename T::system_type;
|
| 181 |
+
};
|
| 182 |
+
|
| 183 |
+
template <typename Alloc>
|
| 184 |
+
struct has_member_system
|
| 185 |
+
{
|
| 186 |
+
using system_type = typename allocator_system<Alloc>::type;
|
| 187 |
+
|
| 188 |
+
using type = typename has_member_system_impl<Alloc, system_type&()>::type;
|
| 189 |
+
static const bool value = type::value;
|
| 190 |
+
};
|
| 191 |
+
|
| 192 |
+
_CCCL_SUPPRESS_DEPRECATED_POP
|
| 193 |
+
|
| 194 |
+
template <class Alloc, class U, bool = has_rebind<Alloc, U>::value>
|
| 195 |
+
struct rebind_alloc
|
| 196 |
+
{
|
| 197 |
+
using type = typename Alloc::template rebind<U>::other;
|
| 198 |
+
};
|
| 199 |
+
|
| 200 |
+
template <template <typename, typename...> class Alloc, typename T, typename... Args, typename U>
|
| 201 |
+
struct rebind_alloc<Alloc<T, Args...>, U, true>
|
| 202 |
+
{
|
| 203 |
+
using type = typename Alloc<T, Args...>::template rebind<U>::other;
|
| 204 |
+
};
|
| 205 |
+
|
| 206 |
+
template <template <typename, typename...> class Alloc, typename T, typename... Args, typename U>
|
| 207 |
+
struct rebind_alloc<Alloc<T, Args...>, U, false>
|
| 208 |
+
{
|
| 209 |
+
using type = Alloc<U, Args...>;
|
| 210 |
+
};
|
| 211 |
+
|
| 212 |
+
} // namespace allocator_traits_detail
|
| 213 |
+
|
| 214 |
+
template <typename Alloc>
|
| 215 |
+
struct allocator_traits
|
| 216 |
+
{
|
| 217 |
+
using allocator_type = Alloc;
|
| 218 |
+
|
| 219 |
+
using value_type = typename allocator_type::value_type;
|
| 220 |
+
|
| 221 |
+
using pointer = typename eval_if<allocator_traits_detail::has_pointer<allocator_type>::value,
|
| 222 |
+
allocator_traits_detail::nested_pointer<allocator_type>,
|
| 223 |
+
identity_<value_type*>>::type;
|
| 224 |
+
|
| 225 |
+
private:
|
| 226 |
+
template <typename T>
|
| 227 |
+
struct rebind_pointer
|
| 228 |
+
{
|
| 229 |
+
using type = typename pointer_traits<pointer>::template rebind<T>::other;
|
| 230 |
+
};
|
| 231 |
+
|
| 232 |
+
public:
|
| 233 |
+
using const_pointer =
|
| 234 |
+
typename eval_if<allocator_traits_detail::has_const_pointer<allocator_type>::value,
|
| 235 |
+
allocator_traits_detail::nested_const_pointer<allocator_type>,
|
| 236 |
+
rebind_pointer<const value_type>>::type;
|
| 237 |
+
|
| 238 |
+
using void_pointer =
|
| 239 |
+
typename eval_if<allocator_traits_detail::has_void_pointer<allocator_type>::value,
|
| 240 |
+
allocator_traits_detail::nested_void_pointer<allocator_type>,
|
| 241 |
+
rebind_pointer<void>>::type;
|
| 242 |
+
|
| 243 |
+
using const_void_pointer =
|
| 244 |
+
typename eval_if<allocator_traits_detail::has_const_void_pointer<allocator_type>::value,
|
| 245 |
+
allocator_traits_detail::nested_const_void_pointer<allocator_type>,
|
| 246 |
+
rebind_pointer<const void>>::type;
|
| 247 |
+
|
| 248 |
+
using difference_type =
|
| 249 |
+
typename eval_if<allocator_traits_detail::has_difference_type<allocator_type>::value,
|
| 250 |
+
allocator_traits_detail::nested_difference_type<allocator_type>,
|
| 251 |
+
pointer_difference<pointer>>::type;
|
| 252 |
+
|
| 253 |
+
using size_type = typename eval_if<allocator_traits_detail::has_size_type<allocator_type>::value,
|
| 254 |
+
allocator_traits_detail::nested_size_type<allocator_type>,
|
| 255 |
+
::cuda::std::make_unsigned<difference_type>>::type;
|
| 256 |
+
|
| 257 |
+
using propagate_on_container_copy_assignment =
|
| 258 |
+
typename eval_if<allocator_traits_detail::has_propagate_on_container_copy_assignment<allocator_type>::value,
|
| 259 |
+
allocator_traits_detail::nested_propagate_on_container_copy_assignment<allocator_type>,
|
| 260 |
+
identity_<false_type>>::type;
|
| 261 |
+
|
| 262 |
+
using propagate_on_container_move_assignment =
|
| 263 |
+
typename eval_if<allocator_traits_detail::has_propagate_on_container_move_assignment<allocator_type>::value,
|
| 264 |
+
allocator_traits_detail::nested_propagate_on_container_move_assignment<allocator_type>,
|
| 265 |
+
identity_<false_type>>::type;
|
| 266 |
+
|
| 267 |
+
using propagate_on_container_swap =
|
| 268 |
+
typename eval_if<allocator_traits_detail::has_propagate_on_container_swap<allocator_type>::value,
|
| 269 |
+
allocator_traits_detail::nested_propagate_on_container_swap<allocator_type>,
|
| 270 |
+
identity_<false_type>>::type;
|
| 271 |
+
|
| 272 |
+
using is_always_equal =
|
| 273 |
+
typename eval_if<allocator_traits_detail::has_is_always_equal<allocator_type>::value,
|
| 274 |
+
allocator_traits_detail::nested_is_always_equal<allocator_type>,
|
| 275 |
+
::cuda::std::is_empty<allocator_type>>::type;
|
| 276 |
+
|
| 277 |
+
using system_type =
|
| 278 |
+
typename eval_if<allocator_traits_detail::has_system_type<allocator_type>::value,
|
| 279 |
+
allocator_traits_detail::nested_system_type<allocator_type>,
|
| 280 |
+
thrust::iterator_system<pointer>>::type;
|
| 281 |
+
|
| 282 |
+
// XXX rebind and rebind_traits are alias templates
|
| 283 |
+
// and so are omitted while c++11 is unavailable
|
| 284 |
+
|
| 285 |
+
template <typename U>
|
| 286 |
+
using rebind_alloc = typename allocator_traits_detail::rebind_alloc<allocator_type, U>::type;
|
| 287 |
+
|
| 288 |
+
template <typename U>
|
| 289 |
+
using rebind_traits = allocator_traits<rebind_alloc<U>>;
|
| 290 |
+
|
| 291 |
+
// We define this nested type alias for compatibility with the C++03-style
|
| 292 |
+
// rebind_* mechanisms.
|
| 293 |
+
using other = allocator_traits;
|
| 294 |
+
|
| 295 |
+
// Deprecated std::allocator aliases that we need:
|
| 296 |
+
using reference = typename thrust::detail::pointer_traits<pointer>::reference;
|
| 297 |
+
using const_reference = typename thrust::detail::pointer_traits<const_pointer>::reference;
|
| 298 |
+
|
| 299 |
+
inline _CCCL_HOST_DEVICE static pointer allocate(allocator_type& a, size_type n);
|
| 300 |
+
|
| 301 |
+
inline _CCCL_HOST_DEVICE static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint);
|
| 302 |
+
|
| 303 |
+
inline _CCCL_HOST_DEVICE static void deallocate(allocator_type& a, pointer p, size_type n) noexcept;
|
| 304 |
+
|
| 305 |
+
// XXX should probably change T* to pointer below and then relax later
|
| 306 |
+
|
| 307 |
+
template <typename T>
|
| 308 |
+
inline _CCCL_HOST_DEVICE static void construct(allocator_type& a, T* p);
|
| 309 |
+
|
| 310 |
+
template <typename T, typename Arg1>
|
| 311 |
+
inline _CCCL_HOST_DEVICE static void construct(allocator_type& a, T* p, const Arg1& arg1);
|
| 312 |
+
|
| 313 |
+
template <typename T, typename... Args>
|
| 314 |
+
inline _CCCL_HOST_DEVICE static void construct(allocator_type& a, T* p, Args&&... args);
|
| 315 |
+
|
| 316 |
+
template <typename T>
|
| 317 |
+
inline _CCCL_HOST_DEVICE static void destroy(allocator_type& a, T* p) noexcept;
|
| 318 |
+
|
| 319 |
+
inline _CCCL_HOST_DEVICE static size_type max_size(const allocator_type& a);
|
| 320 |
+
}; // end allocator_traits
|
| 321 |
+
|
| 322 |
+
// we consider a type an allocator if T::value_type exists
|
| 323 |
+
// it doesn't make much sense (containers, which are not allocators, will fulfill this requirement),
|
| 324 |
+
// but allocator_traits is specified to work for any type with that nested alias
|
| 325 |
+
template <typename T>
|
| 326 |
+
struct is_allocator : allocator_traits_detail::has_value_type<T>
|
| 327 |
+
{};
|
| 328 |
+
|
| 329 |
+
// XXX consider moving this non-standard functionality inside allocator_traits
|
| 330 |
+
template <typename Alloc>
|
| 331 |
+
struct allocator_system
|
| 332 |
+
{
|
| 333 |
+
// the type of the allocator's system
|
| 334 |
+
using type = typename eval_if<allocator_traits_detail::has_system_type<Alloc>::value,
|
| 335 |
+
allocator_traits_detail::nested_system_type<Alloc>,
|
| 336 |
+
thrust::iterator_system<typename allocator_traits<Alloc>::pointer>>::type;
|
| 337 |
+
|
| 338 |
+
// the type that get returns
|
| 339 |
+
using get_result_type =
|
| 340 |
+
typename eval_if<allocator_traits_detail::has_member_system<Alloc>::value,
|
| 341 |
+
::cuda::std::add_lvalue_reference<type>,
|
| 342 |
+
identity_<type>>::type;
|
| 343 |
+
|
| 344 |
+
_CCCL_HOST_DEVICE inline static get_result_type get(Alloc& a);
|
| 345 |
+
};
|
| 346 |
+
|
| 347 |
+
} // namespace detail
|
| 348 |
+
THRUST_NAMESPACE_END
|
| 349 |
+
|
| 350 |
+
#include <thrust/detail/allocator/allocator_traits.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/allocator_traits.inl
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 29 |
+
#include <thrust/detail/integer_traits.h>
|
| 30 |
+
#include <thrust/detail/memory_wrapper.h>
|
| 31 |
+
#include <thrust/detail/type_deduction.h>
|
| 32 |
+
#include <thrust/detail/type_traits/is_call_possible.h>
|
| 33 |
+
|
| 34 |
+
#include <new>
|
| 35 |
+
|
| 36 |
+
THRUST_NAMESPACE_BEGIN
|
| 37 |
+
namespace detail
|
| 38 |
+
{
|
| 39 |
+
|
| 40 |
+
// std::allocator's member functions are deprecated in C++17 and removed in
|
| 41 |
+
// C++20, so we can't just use the generic implementation for allocator_traits
|
| 42 |
+
// that calls the allocator's member functions.
|
| 43 |
+
// Instead, specialize allocator_traits for std::allocator and defer to
|
| 44 |
+
// std::allocator_traits<std::allocator> and let the STL do whatever it needs
|
| 45 |
+
// to for the current c++ version. Manually forward the calls to suppress
|
| 46 |
+
// host/device warnings.
|
| 47 |
+
template <typename T>
|
| 48 |
+
struct allocator_traits<std::allocator<T>> : public std::allocator_traits<std::allocator<T>>
|
| 49 |
+
{
|
| 50 |
+
private:
|
| 51 |
+
using superclass = std::allocator_traits<std::allocator<T>>;
|
| 52 |
+
|
| 53 |
+
public:
|
| 54 |
+
using allocator_type = typename superclass::allocator_type;
|
| 55 |
+
using value_type = typename superclass::value_type;
|
| 56 |
+
using pointer = typename superclass::pointer;
|
| 57 |
+
using const_pointer = typename superclass::const_pointer;
|
| 58 |
+
using void_pointer = typename superclass::void_pointer;
|
| 59 |
+
using const_void_pointer = typename superclass::const_void_pointer;
|
| 60 |
+
using difference_type = typename superclass::difference_type;
|
| 61 |
+
using size_type = typename superclass::size_type;
|
| 62 |
+
using propagate_on_container_swap = typename superclass::propagate_on_container_swap;
|
| 63 |
+
using propagate_on_container_copy_assignment = typename superclass::propagate_on_container_copy_assignment;
|
| 64 |
+
using propagate_on_container_move_assignment = typename superclass::propagate_on_container_move_assignment;
|
| 65 |
+
|
| 66 |
+
// std::allocator_traits added this in C++17, but thrust::allocator_traits defines
|
| 67 |
+
// it unconditionally.
|
| 68 |
+
using is_always_equal =
|
| 69 |
+
typename eval_if<allocator_traits_detail::has_is_always_equal<allocator_type>::value,
|
| 70 |
+
allocator_traits_detail::nested_is_always_equal<allocator_type>,
|
| 71 |
+
::cuda::std::is_empty<allocator_type>>::type;
|
| 72 |
+
|
| 73 |
+
// std::allocator_traits doesn't provide these, but
|
| 74 |
+
// thrust::detail::allocator_traits does. These used to be part of the
|
| 75 |
+
// std::allocator API but were deprecated in C++17.
|
| 76 |
+
using reference = typename thrust::detail::pointer_traits<pointer>::reference;
|
| 77 |
+
using const_reference = typename thrust::detail::pointer_traits<const_pointer>::reference;
|
| 78 |
+
|
| 79 |
+
template <typename U>
|
| 80 |
+
using rebind_alloc = std::allocator<U>;
|
| 81 |
+
template <typename U>
|
| 82 |
+
using rebind_traits = allocator_traits<std::allocator<U>>;
|
| 83 |
+
|
| 84 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 85 |
+
_CCCL_HOST_DEVICE static pointer allocate(allocator_type& a, size_type n)
|
| 86 |
+
{
|
| 87 |
+
return superclass::allocate(a, n);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 91 |
+
_CCCL_HOST_DEVICE static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint)
|
| 92 |
+
{
|
| 93 |
+
return superclass::allocate(a, n, hint);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 97 |
+
_CCCL_HOST_DEVICE static void deallocate(allocator_type& a, pointer p, size_type n) noexcept
|
| 98 |
+
{
|
| 99 |
+
superclass::deallocate(a, p, n);
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 103 |
+
template <typename U, typename... Args>
|
| 104 |
+
_CCCL_HOST_DEVICE static void construct(allocator_type& a, U* p, Args&&... args)
|
| 105 |
+
{
|
| 106 |
+
superclass::construct(a, p, THRUST_FWD(args)...);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 110 |
+
template <typename U>
|
| 111 |
+
_CCCL_HOST_DEVICE static void destroy(allocator_type& a, U* p) noexcept
|
| 112 |
+
{
|
| 113 |
+
superclass::destroy(a, p);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 117 |
+
_CCCL_HOST_DEVICE static size_type max_size(const allocator_type& a)
|
| 118 |
+
{
|
| 119 |
+
return superclass::max_size(a);
|
| 120 |
+
}
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
namespace allocator_traits_detail
|
| 124 |
+
{
|
| 125 |
+
|
| 126 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_allocate_with_hint_impl, allocate)
|
| 127 |
+
|
| 128 |
+
template <typename Alloc>
|
| 129 |
+
class has_member_allocate_with_hint
|
| 130 |
+
{
|
| 131 |
+
using pointer = typename allocator_traits<Alloc>::pointer;
|
| 132 |
+
using size_type = typename allocator_traits<Alloc>::size_type;
|
| 133 |
+
using const_void_pointer = typename allocator_traits<Alloc>::const_void_pointer;
|
| 134 |
+
|
| 135 |
+
public:
|
| 136 |
+
using type = typename has_member_allocate_with_hint_impl<Alloc, pointer(size_type, const_void_pointer)>::type;
|
| 137 |
+
static const bool value = type::value;
|
| 138 |
+
};
|
| 139 |
+
|
| 140 |
+
template <typename Alloc>
|
| 141 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_allocate_with_hint<Alloc>::value,
|
| 142 |
+
typename allocator_traits<Alloc>::pointer>
|
| 143 |
+
allocate(Alloc& a,
|
| 144 |
+
typename allocator_traits<Alloc>::size_type n,
|
| 145 |
+
typename allocator_traits<Alloc>::const_void_pointer hint)
|
| 146 |
+
{
|
| 147 |
+
return a.allocate(n, hint);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
template <typename Alloc>
|
| 151 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_allocate_with_hint<Alloc>::value,
|
| 152 |
+
typename allocator_traits<Alloc>::pointer>
|
| 153 |
+
allocate(Alloc& a, typename allocator_traits<Alloc>::size_type n, typename allocator_traits<Alloc>::const_void_pointer)
|
| 154 |
+
{
|
| 155 |
+
return a.allocate(n);
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_construct1_impl, construct)
|
| 159 |
+
|
| 160 |
+
template <typename Alloc, typename T>
|
| 161 |
+
struct has_member_construct1 : has_member_construct1_impl<Alloc, void(T*)>
|
| 162 |
+
{};
|
| 163 |
+
|
| 164 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 165 |
+
template <typename Alloc, typename T>
|
| 166 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_construct1<Alloc, T>::value> construct(Alloc& a, T* p)
|
| 167 |
+
{
|
| 168 |
+
a.construct(p);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 172 |
+
template <typename Alloc, typename T>
|
| 173 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_construct1<Alloc, T>::value> construct(Alloc&, T* p)
|
| 174 |
+
{
|
| 175 |
+
::new (static_cast<void*>(p)) T();
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_construct2_impl, construct)
|
| 179 |
+
|
| 180 |
+
template <typename Alloc, typename T, typename Arg1>
|
| 181 |
+
struct has_member_construct2 : has_member_construct2_impl<Alloc, void(T*, const Arg1&)>
|
| 182 |
+
{};
|
| 183 |
+
|
| 184 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 185 |
+
template <typename Alloc, typename T, typename Arg1>
|
| 186 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_construct2<Alloc, T, Arg1>::value>
|
| 187 |
+
construct(Alloc& a, T* p, const Arg1& arg1)
|
| 188 |
+
{
|
| 189 |
+
a.construct(p, arg1);
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 193 |
+
template <typename Alloc, typename T, typename Arg1>
|
| 194 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_construct2<Alloc, T, Arg1>::value>
|
| 195 |
+
construct(Alloc&, T* p, const Arg1& arg1)
|
| 196 |
+
{
|
| 197 |
+
::new (static_cast<void*>(p)) T(arg1);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_constructN_impl, construct)
|
| 201 |
+
|
| 202 |
+
template <typename Alloc, typename T, typename... Args>
|
| 203 |
+
struct has_member_constructN : has_member_constructN_impl<Alloc, void(T*, Args...)>
|
| 204 |
+
{};
|
| 205 |
+
|
| 206 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 207 |
+
template <typename Alloc, typename T, typename... Args>
|
| 208 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_constructN<Alloc, T, Args...>::value>
|
| 209 |
+
construct(Alloc& a, T* p, Args&&... args)
|
| 210 |
+
{
|
| 211 |
+
a.construct(p, THRUST_FWD(args)...);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 215 |
+
template <typename Alloc, typename T, typename... Args>
|
| 216 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_constructN<Alloc, T, Args...>::value>
|
| 217 |
+
construct(Alloc&, T* p, Args&&... args)
|
| 218 |
+
{
|
| 219 |
+
::new (static_cast<void*>(p)) T(THRUST_FWD(args)...);
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_destroy_impl, destroy)
|
| 223 |
+
|
| 224 |
+
template <typename Alloc, typename T>
|
| 225 |
+
struct has_member_destroy : has_member_destroy_impl<Alloc, void(T*)>
|
| 226 |
+
{};
|
| 227 |
+
|
| 228 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 229 |
+
template <typename Alloc, typename T>
|
| 230 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_destroy<Alloc, T>::value> destroy(Alloc& a, T* p)
|
| 231 |
+
{
|
| 232 |
+
a.destroy(p);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 236 |
+
template <typename Alloc, typename T>
|
| 237 |
+
inline _CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_destroy<Alloc, T>::value> destroy(Alloc&, T* p)
|
| 238 |
+
{
|
| 239 |
+
p->~T();
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
__THRUST_DEFINE_IS_CALL_POSSIBLE(has_member_max_size_impl, max_size)
|
| 243 |
+
|
| 244 |
+
template <typename Alloc>
|
| 245 |
+
class has_member_max_size
|
| 246 |
+
{
|
| 247 |
+
using size_type = typename allocator_traits<Alloc>::size_type;
|
| 248 |
+
|
| 249 |
+
public:
|
| 250 |
+
using type = typename has_member_max_size_impl<Alloc, size_type()>::type;
|
| 251 |
+
static const bool value = type::value;
|
| 252 |
+
};
|
| 253 |
+
|
| 254 |
+
template <typename Alloc>
|
| 255 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_max_size<Alloc>::value, typename allocator_traits<Alloc>::size_type>
|
| 256 |
+
max_size(const Alloc& a)
|
| 257 |
+
{
|
| 258 |
+
return a.max_size();
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
template <typename Alloc>
|
| 262 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_max_size<Alloc>::value,
|
| 263 |
+
typename allocator_traits<Alloc>::size_type>
|
| 264 |
+
max_size(const Alloc&)
|
| 265 |
+
{
|
| 266 |
+
using size_type = typename allocator_traits<Alloc>::size_type;
|
| 267 |
+
return thrust::detail::integer_traits<size_type>::const_max;
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
template <typename Alloc>
|
| 271 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<has_member_system<Alloc>::value, typename allocator_system<Alloc>::type&>
|
| 272 |
+
system(Alloc& a)
|
| 273 |
+
{
|
| 274 |
+
// return the allocator's system
|
| 275 |
+
return a.system();
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
template <typename Alloc>
|
| 279 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<!has_member_system<Alloc>::value, typename allocator_system<Alloc>::type>
|
| 280 |
+
system(Alloc&)
|
| 281 |
+
{
|
| 282 |
+
// return a copy of a value-initialized system
|
| 283 |
+
return typename allocator_system<Alloc>::type();
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
} // namespace allocator_traits_detail
|
| 287 |
+
|
| 288 |
+
template <typename Alloc>
|
| 289 |
+
_CCCL_HOST_DEVICE typename allocator_traits<Alloc>::pointer
|
| 290 |
+
allocator_traits<Alloc>::allocate(Alloc& a, typename allocator_traits<Alloc>::size_type n)
|
| 291 |
+
{
|
| 292 |
+
struct workaround_warnings
|
| 293 |
+
{
|
| 294 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 295 |
+
static _CCCL_HOST_DEVICE typename allocator_traits<Alloc>::pointer
|
| 296 |
+
allocate(Alloc& a, typename allocator_traits<Alloc>::size_type n)
|
| 297 |
+
{
|
| 298 |
+
return a.allocate(n);
|
| 299 |
+
}
|
| 300 |
+
};
|
| 301 |
+
|
| 302 |
+
return workaround_warnings::allocate(a, n);
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
template <typename Alloc>
|
| 306 |
+
_CCCL_HOST_DEVICE typename allocator_traits<Alloc>::pointer allocator_traits<Alloc>::allocate(
|
| 307 |
+
Alloc& a, typename allocator_traits<Alloc>::size_type n, typename allocator_traits<Alloc>::const_void_pointer hint)
|
| 308 |
+
{
|
| 309 |
+
return allocator_traits_detail::allocate(a, n, hint);
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
template <typename Alloc>
|
| 313 |
+
_CCCL_HOST_DEVICE void allocator_traits<Alloc>::deallocate(
|
| 314 |
+
Alloc& a, typename allocator_traits<Alloc>::pointer p, typename allocator_traits<Alloc>::size_type n) noexcept
|
| 315 |
+
{
|
| 316 |
+
struct workaround_warnings
|
| 317 |
+
{
|
| 318 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 319 |
+
static _CCCL_HOST_DEVICE void deallocate(
|
| 320 |
+
Alloc& a, typename allocator_traits<Alloc>::pointer p, typename allocator_traits<Alloc>::size_type n) noexcept
|
| 321 |
+
{
|
| 322 |
+
return a.deallocate(p, n);
|
| 323 |
+
}
|
| 324 |
+
};
|
| 325 |
+
|
| 326 |
+
return workaround_warnings::deallocate(a, p, n);
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
template <typename Alloc>
|
| 330 |
+
template <typename T>
|
| 331 |
+
_CCCL_HOST_DEVICE void allocator_traits<Alloc>::construct(allocator_type& a, T* p)
|
| 332 |
+
{
|
| 333 |
+
return allocator_traits_detail::construct(a, p);
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
template <typename Alloc>
|
| 337 |
+
template <typename T, typename Arg1>
|
| 338 |
+
_CCCL_HOST_DEVICE void allocator_traits<Alloc>::construct(allocator_type& a, T* p, const Arg1& arg1)
|
| 339 |
+
{
|
| 340 |
+
return allocator_traits_detail::construct(a, p, arg1);
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
template <typename Alloc>
|
| 344 |
+
template <typename T, typename... Args>
|
| 345 |
+
_CCCL_HOST_DEVICE void allocator_traits<Alloc>::construct(allocator_type& a, T* p, Args&&... args)
|
| 346 |
+
{
|
| 347 |
+
return allocator_traits_detail::construct(a, p, THRUST_FWD(args)...);
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
template <typename Alloc>
|
| 351 |
+
template <typename T>
|
| 352 |
+
_CCCL_HOST_DEVICE void allocator_traits<Alloc>::destroy(allocator_type& a, T* p) noexcept
|
| 353 |
+
{
|
| 354 |
+
return allocator_traits_detail::destroy(a, p);
|
| 355 |
+
}
|
| 356 |
+
|
| 357 |
+
template <typename Alloc>
|
| 358 |
+
_CCCL_HOST_DEVICE typename allocator_traits<Alloc>::size_type allocator_traits<Alloc>::max_size(const allocator_type& a)
|
| 359 |
+
{
|
| 360 |
+
return allocator_traits_detail::max_size(a);
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
template <typename Alloc>
|
| 364 |
+
_CCCL_HOST_DEVICE typename allocator_system<Alloc>::get_result_type allocator_system<Alloc>::get(Alloc& a)
|
| 365 |
+
{
|
| 366 |
+
return allocator_traits_detail::system(a);
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
} // namespace detail
|
| 370 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/copy_construct_range.h
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/execution_policy.h>
|
| 29 |
+
|
| 30 |
+
THRUST_NAMESPACE_BEGIN
|
| 31 |
+
namespace detail
|
| 32 |
+
{
|
| 33 |
+
|
| 34 |
+
template <typename System, typename Allocator, typename InputIterator, typename Pointer>
|
| 35 |
+
_CCCL_HOST_DEVICE Pointer copy_construct_range(
|
| 36 |
+
thrust::execution_policy<System>& from_system, Allocator& a, InputIterator first, InputIterator last, Pointer result);
|
| 37 |
+
|
| 38 |
+
template <typename System, typename Allocator, typename InputIterator, typename Size, typename Pointer>
|
| 39 |
+
_CCCL_HOST_DEVICE Pointer copy_construct_range_n(
|
| 40 |
+
thrust::execution_policy<System>& from_system, Allocator& a, InputIterator first, Size n, Pointer result);
|
| 41 |
+
|
| 42 |
+
} // namespace detail
|
| 43 |
+
THRUST_NAMESPACE_END
|
| 44 |
+
|
| 45 |
+
#include <thrust/detail/allocator/copy_construct_range.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/copy_construct_range.inl
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/advance.h>
|
| 29 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 30 |
+
#include <thrust/detail/copy.h>
|
| 31 |
+
#include <thrust/detail/memory_wrapper.h>
|
| 32 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 33 |
+
#include <thrust/distance.h>
|
| 34 |
+
#include <thrust/for_each.h>
|
| 35 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 36 |
+
#include <thrust/iterator/zip_iterator.h>
|
| 37 |
+
#include <thrust/tuple.h>
|
| 38 |
+
|
| 39 |
+
THRUST_NAMESPACE_BEGIN
|
| 40 |
+
namespace detail
|
| 41 |
+
{
|
| 42 |
+
namespace allocator_traits_detail
|
| 43 |
+
{
|
| 44 |
+
|
| 45 |
+
template <typename Allocator, typename InputType, typename OutputType>
|
| 46 |
+
struct copy_construct_with_allocator
|
| 47 |
+
{
|
| 48 |
+
Allocator& a;
|
| 49 |
+
|
| 50 |
+
_CCCL_HOST_DEVICE copy_construct_with_allocator(Allocator& a)
|
| 51 |
+
: a(a)
|
| 52 |
+
{}
|
| 53 |
+
|
| 54 |
+
template <typename Tuple>
|
| 55 |
+
inline _CCCL_HOST_DEVICE void operator()(Tuple t)
|
| 56 |
+
{
|
| 57 |
+
const InputType& in = thrust::get<0>(t);
|
| 58 |
+
OutputType& out = thrust::get<1>(t);
|
| 59 |
+
|
| 60 |
+
allocator_traits<Allocator>::construct(a, &out, in);
|
| 61 |
+
}
|
| 62 |
+
};
|
| 63 |
+
|
| 64 |
+
// we need to use allocator_traits<Allocator>::construct() to
|
| 65 |
+
// copy construct a T if either:
|
| 66 |
+
// 1. Allocator has a 2-argument construct() member or
|
| 67 |
+
// 2. T has a non-trivial copy constructor
|
| 68 |
+
template <typename Allocator, typename T>
|
| 69 |
+
struct needs_copy_construct_via_allocator
|
| 70 |
+
: integral_constant<bool,
|
| 71 |
+
(has_member_construct2<Allocator, T, T>::value
|
| 72 |
+
|| !::cuda::std::is_trivially_copy_constructible<T>::value)>
|
| 73 |
+
{};
|
| 74 |
+
|
| 75 |
+
// we know that std::allocator::construct's only effect is to call T's
|
| 76 |
+
// copy constructor, so we needn't consider or use its construct() member for copy construction
|
| 77 |
+
template <typename U, typename T>
|
| 78 |
+
struct needs_copy_construct_via_allocator<std::allocator<U>, T>
|
| 79 |
+
: integral_constant<bool, !::cuda::std::is_trivially_copy_constructible<T>::value>
|
| 80 |
+
{};
|
| 81 |
+
|
| 82 |
+
// XXX it's regrettable that this implementation is copied almost
|
| 83 |
+
// exactly from system::detail::generic::uninitialized_copy
|
| 84 |
+
// perhaps generic::uninitialized_copy could call this routine
|
| 85 |
+
// with a default allocator
|
| 86 |
+
template <typename Allocator, typename FromSystem, typename ToSystem, typename InputIterator, typename Pointer>
|
| 87 |
+
_CCCL_HOST_DEVICE enable_if_convertible_t<FromSystem, ToSystem, Pointer> uninitialized_copy_with_allocator(
|
| 88 |
+
Allocator& a,
|
| 89 |
+
const thrust::execution_policy<FromSystem>&,
|
| 90 |
+
const thrust::execution_policy<ToSystem>& to_system,
|
| 91 |
+
InputIterator first,
|
| 92 |
+
InputIterator last,
|
| 93 |
+
Pointer result)
|
| 94 |
+
{
|
| 95 |
+
// zip up the iterators
|
| 96 |
+
using IteratorTuple = thrust::tuple<InputIterator, Pointer>;
|
| 97 |
+
using ZipIterator = thrust::zip_iterator<IteratorTuple>;
|
| 98 |
+
|
| 99 |
+
ZipIterator begin = thrust::make_zip_iterator(thrust::make_tuple(first, result));
|
| 100 |
+
ZipIterator end = begin;
|
| 101 |
+
|
| 102 |
+
// get a zip_iterator pointing to the end
|
| 103 |
+
const typename thrust::iterator_difference<InputIterator>::type n = thrust::distance(first, last);
|
| 104 |
+
thrust::advance(end, n);
|
| 105 |
+
|
| 106 |
+
// create a functor
|
| 107 |
+
using InputType = typename iterator_traits<InputIterator>::value_type;
|
| 108 |
+
using OutputType = typename iterator_traits<Pointer>::value_type;
|
| 109 |
+
|
| 110 |
+
// do the for_each
|
| 111 |
+
// note we use to_system to dispatch the for_each
|
| 112 |
+
thrust::for_each(to_system, begin, end, copy_construct_with_allocator<Allocator, InputType, OutputType>(a));
|
| 113 |
+
|
| 114 |
+
// return the end of the output range
|
| 115 |
+
return thrust::get<1>(end.get_iterator_tuple());
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
// XXX it's regrettable that this implementation is copied almost
|
| 119 |
+
// exactly from system::detail::generic::uninitialized_copy_n
|
| 120 |
+
// perhaps generic::uninitialized_copy_n could call this routine
|
| 121 |
+
// with a default allocator
|
| 122 |
+
template <typename Allocator, typename FromSystem, typename ToSystem, typename InputIterator, typename Size, typename Pointer>
|
| 123 |
+
_CCCL_HOST_DEVICE enable_if_convertible_t<FromSystem, ToSystem, Pointer> uninitialized_copy_with_allocator_n(
|
| 124 |
+
Allocator& a,
|
| 125 |
+
const thrust::execution_policy<FromSystem>&,
|
| 126 |
+
const thrust::execution_policy<ToSystem>& to_system,
|
| 127 |
+
InputIterator first,
|
| 128 |
+
Size n,
|
| 129 |
+
Pointer result)
|
| 130 |
+
{
|
| 131 |
+
// zip up the iterators
|
| 132 |
+
using IteratorTuple = thrust::tuple<InputIterator, Pointer>;
|
| 133 |
+
using ZipIterator = thrust::zip_iterator<IteratorTuple>;
|
| 134 |
+
|
| 135 |
+
ZipIterator begin = thrust::make_zip_iterator(thrust::make_tuple(first, result));
|
| 136 |
+
|
| 137 |
+
// create a functor
|
| 138 |
+
using InputType = typename iterator_traits<InputIterator>::value_type;
|
| 139 |
+
using OutputType = typename iterator_traits<Pointer>::value_type;
|
| 140 |
+
|
| 141 |
+
// do the for_each_n
|
| 142 |
+
// note we use to_system to dispatch the for_each_n
|
| 143 |
+
ZipIterator end =
|
| 144 |
+
thrust::for_each_n(to_system, begin, n, copy_construct_with_allocator<Allocator, InputType, OutputType>(a));
|
| 145 |
+
|
| 146 |
+
// return the end of the output range
|
| 147 |
+
return thrust::get<1>(end.get_iterator_tuple());
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
template <typename Allocator, typename FromSystem, typename ToSystem, typename InputIterator, typename Pointer>
|
| 151 |
+
_CCCL_HOST_DEVICE typename disable_if_convertible<FromSystem, ToSystem, Pointer>::type uninitialized_copy_with_allocator(
|
| 152 |
+
Allocator&,
|
| 153 |
+
const thrust::execution_policy<FromSystem>& from_system,
|
| 154 |
+
const thrust::execution_policy<ToSystem>& to_system,
|
| 155 |
+
InputIterator first,
|
| 156 |
+
InputIterator last,
|
| 157 |
+
Pointer result)
|
| 158 |
+
{
|
| 159 |
+
// the systems aren't trivially interoperable
|
| 160 |
+
// just call two_system_copy and hope for the best
|
| 161 |
+
return thrust::detail::two_system_copy(from_system, to_system, first, last, result);
|
| 162 |
+
} // end uninitialized_copy_with_allocator()
|
| 163 |
+
|
| 164 |
+
template <typename Allocator, typename FromSystem, typename ToSystem, typename InputIterator, typename Size, typename Pointer>
|
| 165 |
+
_CCCL_HOST_DEVICE typename disable_if_convertible<FromSystem, ToSystem, Pointer>::type
|
| 166 |
+
uninitialized_copy_with_allocator_n(
|
| 167 |
+
Allocator&,
|
| 168 |
+
const thrust::execution_policy<FromSystem>& from_system,
|
| 169 |
+
const thrust::execution_policy<ToSystem>& to_system,
|
| 170 |
+
InputIterator first,
|
| 171 |
+
Size n,
|
| 172 |
+
Pointer result)
|
| 173 |
+
{
|
| 174 |
+
// the systems aren't trivially interoperable
|
| 175 |
+
// just call two_system_copy_n and hope for the best
|
| 176 |
+
return thrust::detail::two_system_copy_n(from_system, to_system, first, n, result);
|
| 177 |
+
} // end uninitialized_copy_with_allocator_n()
|
| 178 |
+
|
| 179 |
+
template <typename FromSystem, typename Allocator, typename InputIterator, typename Pointer>
|
| 180 |
+
_CCCL_HOST_DEVICE
|
| 181 |
+
typename disable_if<needs_copy_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value,
|
| 182 |
+
Pointer>::type
|
| 183 |
+
copy_construct_range(thrust::execution_policy<FromSystem>& from_system,
|
| 184 |
+
Allocator& a,
|
| 185 |
+
InputIterator first,
|
| 186 |
+
InputIterator last,
|
| 187 |
+
Pointer result)
|
| 188 |
+
{
|
| 189 |
+
// just call two_system_copy
|
| 190 |
+
return thrust::detail::two_system_copy(from_system, allocator_system<Allocator>::get(a), first, last, result);
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
template <typename FromSystem, typename Allocator, typename InputIterator, typename Size, typename Pointer>
|
| 194 |
+
_CCCL_HOST_DEVICE
|
| 195 |
+
typename disable_if<needs_copy_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value,
|
| 196 |
+
Pointer>::type
|
| 197 |
+
copy_construct_range_n(
|
| 198 |
+
thrust::execution_policy<FromSystem>& from_system, Allocator& a, InputIterator first, Size n, Pointer result)
|
| 199 |
+
{
|
| 200 |
+
// just call two_system_copy_n
|
| 201 |
+
return thrust::detail::two_system_copy_n(from_system, allocator_system<Allocator>::get(a), first, n, result);
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
template <typename FromSystem, typename Allocator, typename InputIterator, typename Pointer>
|
| 205 |
+
_CCCL_HOST_DEVICE ::cuda::std::
|
| 206 |
+
enable_if_t<needs_copy_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value, Pointer>
|
| 207 |
+
copy_construct_range(thrust::execution_policy<FromSystem>& from_system,
|
| 208 |
+
Allocator& a,
|
| 209 |
+
InputIterator first,
|
| 210 |
+
InputIterator last,
|
| 211 |
+
Pointer result)
|
| 212 |
+
{
|
| 213 |
+
return uninitialized_copy_with_allocator(a, from_system, allocator_system<Allocator>::get(a), first, last, result);
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
template <typename FromSystem, typename Allocator, typename InputIterator, typename Size, typename Pointer>
|
| 217 |
+
_CCCL_HOST_DEVICE ::cuda::std::
|
| 218 |
+
enable_if_t<needs_copy_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value, Pointer>
|
| 219 |
+
copy_construct_range_n(
|
| 220 |
+
thrust::execution_policy<FromSystem>& from_system, Allocator& a, InputIterator first, Size n, Pointer result)
|
| 221 |
+
{
|
| 222 |
+
return uninitialized_copy_with_allocator_n(a, from_system, allocator_system<Allocator>::get(a), first, n, result);
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
} // namespace allocator_traits_detail
|
| 226 |
+
|
| 227 |
+
template <typename System, typename Allocator, typename InputIterator, typename Pointer>
|
| 228 |
+
_CCCL_HOST_DEVICE Pointer copy_construct_range(
|
| 229 |
+
thrust::execution_policy<System>& from_system, Allocator& a, InputIterator first, InputIterator last, Pointer result)
|
| 230 |
+
{
|
| 231 |
+
return allocator_traits_detail::copy_construct_range(from_system, a, first, last, result);
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
template <typename System, typename Allocator, typename InputIterator, typename Size, typename Pointer>
|
| 235 |
+
_CCCL_HOST_DEVICE Pointer copy_construct_range_n(
|
| 236 |
+
thrust::execution_policy<System>& from_system, Allocator& a, InputIterator first, Size n, Pointer result)
|
| 237 |
+
{
|
| 238 |
+
return allocator_traits_detail::copy_construct_range_n(from_system, a, first, n, result);
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
} // namespace detail
|
| 242 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/destroy_range.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
THRUST_NAMESPACE_BEGIN
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 34 |
+
_CCCL_HOST_DEVICE inline void destroy_range(Allocator& a, Pointer p, Size n) noexcept;
|
| 35 |
+
|
| 36 |
+
} // namespace detail
|
| 37 |
+
THRUST_NAMESPACE_END
|
| 38 |
+
|
| 39 |
+
#include <thrust/detail/allocator/destroy_range.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/destroy_range.inl
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 30 |
+
#include <thrust/detail/allocator/destroy_range.h>
|
| 31 |
+
#include <thrust/detail/memory_wrapper.h>
|
| 32 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 33 |
+
#include <thrust/for_each.h>
|
| 34 |
+
|
| 35 |
+
THRUST_NAMESPACE_BEGIN
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
namespace allocator_traits_detail
|
| 39 |
+
{
|
| 40 |
+
|
| 41 |
+
// destroy_range has three cases:
|
| 42 |
+
// if Allocator has an effectful member function destroy:
|
| 43 |
+
// 1. destroy via the allocator
|
| 44 |
+
// else
|
| 45 |
+
// 2. if T has a non-trivial destructor, destroy the range without using the allocator
|
| 46 |
+
// 3. if T has a trivial destructor, do a no-op
|
| 47 |
+
|
| 48 |
+
template <typename Allocator, typename T>
|
| 49 |
+
struct has_effectful_member_destroy : has_member_destroy<Allocator, T>
|
| 50 |
+
{};
|
| 51 |
+
|
| 52 |
+
// std::allocator::destroy's only effect is to invoke its argument's destructor
|
| 53 |
+
template <typename U, typename T>
|
| 54 |
+
struct has_effectful_member_destroy<std::allocator<U>, T> : thrust::detail::false_type
|
| 55 |
+
{};
|
| 56 |
+
|
| 57 |
+
// case 1: Allocator has an effectful 1-argument member function "destroy"
|
| 58 |
+
template <typename Allocator, typename Pointer>
|
| 59 |
+
struct enable_if_destroy_range_case1
|
| 60 |
+
: ::cuda::std::enable_if<has_effectful_member_destroy<Allocator, typename pointer_element<Pointer>::type>::value>
|
| 61 |
+
{};
|
| 62 |
+
|
| 63 |
+
// case 2: Allocator has no member function "destroy", but T has a non-trivial destructor
|
| 64 |
+
template <typename Allocator, typename Pointer>
|
| 65 |
+
struct enable_if_destroy_range_case2
|
| 66 |
+
: ::cuda::std::enable_if<!has_effectful_member_destroy<Allocator, typename pointer_element<Pointer>::type>::value
|
| 67 |
+
&& !::cuda::std::is_trivially_destructible<typename pointer_element<Pointer>::type>::value>
|
| 68 |
+
{};
|
| 69 |
+
|
| 70 |
+
// case 3: Allocator has no member function "destroy", and T has a trivial destructor
|
| 71 |
+
template <typename Allocator, typename Pointer>
|
| 72 |
+
struct enable_if_destroy_range_case3
|
| 73 |
+
: ::cuda::std::enable_if<!has_effectful_member_destroy<Allocator, typename pointer_element<Pointer>::type>::value
|
| 74 |
+
&& ::cuda::std::is_trivially_destructible<typename pointer_element<Pointer>::type>::value>
|
| 75 |
+
{};
|
| 76 |
+
|
| 77 |
+
template <typename Allocator>
|
| 78 |
+
struct destroy_via_allocator
|
| 79 |
+
{
|
| 80 |
+
Allocator& a;
|
| 81 |
+
|
| 82 |
+
_CCCL_HOST_DEVICE destroy_via_allocator(Allocator& a) noexcept
|
| 83 |
+
: a(a)
|
| 84 |
+
{}
|
| 85 |
+
|
| 86 |
+
template <typename T>
|
| 87 |
+
inline _CCCL_HOST_DEVICE void operator()(T& x) noexcept
|
| 88 |
+
{
|
| 89 |
+
allocator_traits<Allocator>::destroy(a, &x);
|
| 90 |
+
}
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
// destroy_range case 1: destroy via allocator
|
| 94 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 95 |
+
_CCCL_HOST_DEVICE typename enable_if_destroy_range_case1<Allocator, Pointer>::type
|
| 96 |
+
destroy_range(Allocator& a, Pointer p, Size n) noexcept
|
| 97 |
+
{
|
| 98 |
+
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, destroy_via_allocator<Allocator>(a));
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
// we must prepare for His coming
|
| 102 |
+
struct gozer
|
| 103 |
+
{
|
| 104 |
+
_CCCL_EXEC_CHECK_DISABLE
|
| 105 |
+
template <typename T>
|
| 106 |
+
inline _CCCL_HOST_DEVICE void operator()(T& x) noexcept
|
| 107 |
+
{
|
| 108 |
+
x.~T();
|
| 109 |
+
}
|
| 110 |
+
};
|
| 111 |
+
|
| 112 |
+
// destroy_range case 2: destroy without the allocator
|
| 113 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 114 |
+
_CCCL_HOST_DEVICE typename enable_if_destroy_range_case2<Allocator, Pointer>::type
|
| 115 |
+
destroy_range(Allocator& a, Pointer p, Size n) noexcept
|
| 116 |
+
{
|
| 117 |
+
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, gozer());
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
// destroy_range case 3: no-op
|
| 121 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 122 |
+
_CCCL_HOST_DEVICE typename enable_if_destroy_range_case3<Allocator, Pointer>::type
|
| 123 |
+
destroy_range(Allocator&, Pointer, Size) noexcept
|
| 124 |
+
{
|
| 125 |
+
// no op
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
} // namespace allocator_traits_detail
|
| 129 |
+
|
| 130 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 131 |
+
_CCCL_HOST_DEVICE void destroy_range(Allocator& a, Pointer p, Size n) noexcept
|
| 132 |
+
{
|
| 133 |
+
return allocator_traits_detail::destroy_range(a, p, n);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
} // namespace detail
|
| 137 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/fill_construct_range.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
THRUST_NAMESPACE_BEGIN
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
template <typename Allocator, typename Pointer, typename Size, typename T>
|
| 34 |
+
_CCCL_HOST_DEVICE inline void fill_construct_range(Allocator& a, Pointer p, Size n, const T& value);
|
| 35 |
+
|
| 36 |
+
} // namespace detail
|
| 37 |
+
THRUST_NAMESPACE_END
|
| 38 |
+
|
| 39 |
+
#include <thrust/detail/allocator/fill_construct_range.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/fill_construct_range.inl
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 29 |
+
#include <thrust/detail/memory_wrapper.h>
|
| 30 |
+
#include <thrust/detail/type_traits.h>
|
| 31 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 32 |
+
#include <thrust/for_each.h>
|
| 33 |
+
#include <thrust/uninitialized_fill.h>
|
| 34 |
+
|
| 35 |
+
THRUST_NAMESPACE_BEGIN
|
| 36 |
+
namespace detail
|
| 37 |
+
{
|
| 38 |
+
namespace allocator_traits_detail
|
| 39 |
+
{
|
| 40 |
+
|
| 41 |
+
// fill_construct_range has 2 cases:
|
| 42 |
+
// if Allocator has an effectful member function construct:
|
| 43 |
+
// 1. construct via the allocator
|
| 44 |
+
// else
|
| 45 |
+
// 2. construct via uninitialized_fill
|
| 46 |
+
|
| 47 |
+
template <typename Allocator, typename T, typename Arg1>
|
| 48 |
+
struct has_effectful_member_construct2 : has_member_construct2<Allocator, T, Arg1>
|
| 49 |
+
{};
|
| 50 |
+
|
| 51 |
+
// std::allocator::construct's only effect is to invoke placement new
|
| 52 |
+
template <typename U, typename T, typename Arg1>
|
| 53 |
+
struct has_effectful_member_construct2<std::allocator<U>, T, Arg1> : thrust::detail::false_type
|
| 54 |
+
{};
|
| 55 |
+
|
| 56 |
+
template <typename Allocator, typename Arg1>
|
| 57 |
+
struct construct2_via_allocator
|
| 58 |
+
{
|
| 59 |
+
Allocator& a;
|
| 60 |
+
Arg1 arg;
|
| 61 |
+
|
| 62 |
+
_CCCL_HOST_DEVICE construct2_via_allocator(Allocator& a, const Arg1& arg)
|
| 63 |
+
: a(a)
|
| 64 |
+
, arg(arg)
|
| 65 |
+
{}
|
| 66 |
+
|
| 67 |
+
template <typename T>
|
| 68 |
+
inline _CCCL_HOST_DEVICE void operator()(T& x)
|
| 69 |
+
{
|
| 70 |
+
allocator_traits<Allocator>::construct(a, &x, arg);
|
| 71 |
+
}
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
template <typename Allocator, typename Pointer, typename Size, typename T>
|
| 75 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<
|
| 76 |
+
has_effectful_member_construct2<Allocator, typename pointer_element<Pointer>::type, T>::value>
|
| 77 |
+
fill_construct_range(Allocator& a, Pointer p, Size n, const T& value)
|
| 78 |
+
{
|
| 79 |
+
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, construct2_via_allocator<Allocator, T>(a, value));
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
template <typename Allocator, typename Pointer, typename Size, typename T>
|
| 83 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<
|
| 84 |
+
!has_effectful_member_construct2<Allocator, typename pointer_element<Pointer>::type, T>::value>
|
| 85 |
+
fill_construct_range(Allocator& a, Pointer p, Size n, const T& value)
|
| 86 |
+
{
|
| 87 |
+
thrust::uninitialized_fill_n(allocator_system<Allocator>::get(a), p, n, value);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
} // namespace allocator_traits_detail
|
| 91 |
+
|
| 92 |
+
template <typename Alloc, typename Pointer, typename Size, typename T>
|
| 93 |
+
_CCCL_HOST_DEVICE void fill_construct_range(Alloc& a, Pointer p, Size n, const T& value)
|
| 94 |
+
{
|
| 95 |
+
return allocator_traits_detail::fill_construct_range(a, p, n, value);
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
} // namespace detail
|
| 99 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/malloc_allocator.h
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/tagged_allocator.h>
|
| 29 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template <typename T, typename System, typename Pointer>
|
| 36 |
+
class malloc_allocator : public thrust::detail::tagged_allocator<T, System, Pointer>
|
| 37 |
+
{
|
| 38 |
+
private:
|
| 39 |
+
using super_t = thrust::detail::tagged_allocator<T, System, Pointer>;
|
| 40 |
+
|
| 41 |
+
public:
|
| 42 |
+
using pointer = typename super_t::pointer;
|
| 43 |
+
using size_type = typename super_t::size_type;
|
| 44 |
+
|
| 45 |
+
pointer allocate(size_type cnt);
|
| 46 |
+
|
| 47 |
+
void deallocate(pointer p, size_type n) noexcept;
|
| 48 |
+
};
|
| 49 |
+
|
| 50 |
+
} // namespace detail
|
| 51 |
+
THRUST_NAMESPACE_END
|
| 52 |
+
|
| 53 |
+
#include <thrust/detail/allocator/malloc_allocator.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/malloc_allocator.inl
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/malloc_allocator.h>
|
| 29 |
+
#include <thrust/detail/malloc_and_free.h>
|
| 30 |
+
#include <thrust/detail/raw_pointer_cast.h>
|
| 31 |
+
#include <thrust/system/detail/bad_alloc.h>
|
| 32 |
+
#include <thrust/system/detail/generic/select_system.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
template <typename T, typename System, typename Pointer>
|
| 39 |
+
typename malloc_allocator<T, System, Pointer>::pointer
|
| 40 |
+
malloc_allocator<T, System, Pointer>::allocate(typename malloc_allocator<T, System, Pointer>::size_type cnt)
|
| 41 |
+
{
|
| 42 |
+
using thrust::system::detail::generic::select_system;
|
| 43 |
+
|
| 44 |
+
// XXX should use a hypothetical thrust::static_pointer_cast here
|
| 45 |
+
System system;
|
| 46 |
+
|
| 47 |
+
pointer result = thrust::malloc<T>(select_system(system), cnt);
|
| 48 |
+
|
| 49 |
+
if (result.get() == 0)
|
| 50 |
+
{
|
| 51 |
+
throw thrust::system::detail::bad_alloc("malloc_allocator::allocate: malloc failed");
|
| 52 |
+
} // end if
|
| 53 |
+
|
| 54 |
+
return result;
|
| 55 |
+
} // end malloc_allocator::allocate()
|
| 56 |
+
|
| 57 |
+
template <typename T, typename System, typename Pointer>
|
| 58 |
+
void malloc_allocator<T, System, Pointer>::deallocate(typename malloc_allocator<T, System, Pointer>::pointer p,
|
| 59 |
+
typename malloc_allocator<T, System, Pointer>::size_type) noexcept
|
| 60 |
+
{
|
| 61 |
+
using thrust::system::detail::generic::select_system;
|
| 62 |
+
|
| 63 |
+
System system;
|
| 64 |
+
thrust::free(select_system(system), p);
|
| 65 |
+
} // end malloc_allocator
|
| 66 |
+
|
| 67 |
+
} // namespace detail
|
| 68 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/no_throw_allocator.h
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#include <nv/target>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template <typename BaseAllocator>
|
| 36 |
+
struct no_throw_allocator : BaseAllocator
|
| 37 |
+
{
|
| 38 |
+
private:
|
| 39 |
+
using super_t = BaseAllocator;
|
| 40 |
+
|
| 41 |
+
public:
|
| 42 |
+
inline _CCCL_HOST_DEVICE no_throw_allocator(const BaseAllocator& other = BaseAllocator())
|
| 43 |
+
: super_t(other)
|
| 44 |
+
{}
|
| 45 |
+
|
| 46 |
+
template <typename U>
|
| 47 |
+
struct rebind
|
| 48 |
+
{
|
| 49 |
+
using other = no_throw_allocator<typename super_t::template rebind<U>::other>;
|
| 50 |
+
}; // end rebind
|
| 51 |
+
|
| 52 |
+
_CCCL_HOST_DEVICE void deallocate(typename super_t::pointer p, typename super_t::size_type n) noexcept
|
| 53 |
+
{
|
| 54 |
+
NV_IF_TARGET(
|
| 55 |
+
NV_IS_HOST,
|
| 56 |
+
(try { super_t::deallocate(p, n); } // end try
|
| 57 |
+
catch (...){
|
| 58 |
+
// catch anything
|
| 59 |
+
} // end catch
|
| 60 |
+
),
|
| 61 |
+
(super_t::deallocate(p, n);));
|
| 62 |
+
} // end deallocate()
|
| 63 |
+
|
| 64 |
+
inline _CCCL_HOST_DEVICE bool operator==(no_throw_allocator const& other)
|
| 65 |
+
{
|
| 66 |
+
return super_t::operator==(other);
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
inline _CCCL_HOST_DEVICE bool operator!=(no_throw_allocator const& other)
|
| 70 |
+
{
|
| 71 |
+
return super_t::operator!=(other);
|
| 72 |
+
}
|
| 73 |
+
}; // end no_throw_allocator
|
| 74 |
+
|
| 75 |
+
} // namespace detail
|
| 76 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/tagged_allocator.h
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 29 |
+
#include <thrust/iterator/iterator_traits.h>
|
| 30 |
+
|
| 31 |
+
THRUST_NAMESPACE_BEGIN
|
| 32 |
+
namespace detail
|
| 33 |
+
{
|
| 34 |
+
|
| 35 |
+
template <typename T, typename Tag, typename Pointer>
|
| 36 |
+
class tagged_allocator;
|
| 37 |
+
|
| 38 |
+
template <typename Tag, typename Pointer>
|
| 39 |
+
class tagged_allocator<void, Tag, Pointer>
|
| 40 |
+
{
|
| 41 |
+
public:
|
| 42 |
+
using value_type = void;
|
| 43 |
+
using pointer = typename thrust::detail::pointer_traits<Pointer>::template rebind<void>::other;
|
| 44 |
+
using const_pointer = typename thrust::detail::pointer_traits<Pointer>::template rebind<const void>::other;
|
| 45 |
+
using size_type = std::size_t;
|
| 46 |
+
using difference_type = typename thrust::detail::pointer_traits<Pointer>::difference_type;
|
| 47 |
+
using system_type = Tag;
|
| 48 |
+
|
| 49 |
+
template <typename U>
|
| 50 |
+
struct rebind
|
| 51 |
+
{
|
| 52 |
+
using other = tagged_allocator<U, Tag, Pointer>;
|
| 53 |
+
}; // end rebind
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
template <typename T, typename Tag, typename Pointer>
|
| 57 |
+
class tagged_allocator
|
| 58 |
+
{
|
| 59 |
+
public:
|
| 60 |
+
using value_type = T;
|
| 61 |
+
using pointer = typename thrust::detail::pointer_traits<Pointer>::template rebind<T>::other;
|
| 62 |
+
using const_pointer = typename thrust::detail::pointer_traits<Pointer>::template rebind<const T>::other;
|
| 63 |
+
using reference = typename thrust::iterator_reference<pointer>::type;
|
| 64 |
+
using const_reference = typename thrust::iterator_reference<const_pointer>::type;
|
| 65 |
+
using size_type = std::size_t;
|
| 66 |
+
using difference_type = typename thrust::detail::pointer_traits<pointer>::difference_type;
|
| 67 |
+
using system_type = Tag;
|
| 68 |
+
|
| 69 |
+
template <typename U>
|
| 70 |
+
struct rebind
|
| 71 |
+
{
|
| 72 |
+
using other = tagged_allocator<U, Tag, Pointer>;
|
| 73 |
+
}; // end rebind
|
| 74 |
+
|
| 75 |
+
_CCCL_HOST_DEVICE inline tagged_allocator();
|
| 76 |
+
|
| 77 |
+
_CCCL_HOST_DEVICE inline tagged_allocator(const tagged_allocator&);
|
| 78 |
+
|
| 79 |
+
template <typename U, typename OtherPointer>
|
| 80 |
+
_CCCL_HOST_DEVICE inline tagged_allocator(const tagged_allocator<U, Tag, OtherPointer>&);
|
| 81 |
+
|
| 82 |
+
_CCCL_HOST_DEVICE inline ~tagged_allocator();
|
| 83 |
+
|
| 84 |
+
_CCCL_HOST_DEVICE pointer address(reference x) const;
|
| 85 |
+
|
| 86 |
+
_CCCL_HOST_DEVICE const_pointer address(const_reference x) const;
|
| 87 |
+
|
| 88 |
+
size_type max_size() const;
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
template <typename T1, typename Pointer1, typename T2, typename Pointer2, typename Tag>
|
| 92 |
+
_CCCL_HOST_DEVICE bool
|
| 93 |
+
operator==(const tagged_allocator<T1, Pointer1, Tag>&, const tagged_allocator<T2, Pointer2, Tag>&);
|
| 94 |
+
|
| 95 |
+
template <typename T1, typename Pointer1, typename T2, typename Pointer2, typename Tag>
|
| 96 |
+
_CCCL_HOST_DEVICE bool
|
| 97 |
+
operator!=(const tagged_allocator<T1, Pointer1, Tag>&, const tagged_allocator<T2, Pointer2, Tag>&);
|
| 98 |
+
|
| 99 |
+
} // namespace detail
|
| 100 |
+
THRUST_NAMESPACE_END
|
| 101 |
+
|
| 102 |
+
#include <thrust/detail/allocator/tagged_allocator.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/tagged_allocator.inl
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/tagged_allocator.h>
|
| 29 |
+
|
| 30 |
+
#include <limits>
|
| 31 |
+
|
| 32 |
+
THRUST_NAMESPACE_BEGIN
|
| 33 |
+
namespace detail
|
| 34 |
+
{
|
| 35 |
+
|
| 36 |
+
template <typename T, typename Tag, typename Pointer>
|
| 37 |
+
_CCCL_HOST_DEVICE tagged_allocator<T, Tag, Pointer>::tagged_allocator()
|
| 38 |
+
{}
|
| 39 |
+
|
| 40 |
+
template <typename T, typename Tag, typename Pointer>
|
| 41 |
+
_CCCL_HOST_DEVICE tagged_allocator<T, Tag, Pointer>::tagged_allocator(const tagged_allocator<T, Tag, Pointer>&)
|
| 42 |
+
{}
|
| 43 |
+
|
| 44 |
+
template <typename T, typename Tag, typename Pointer>
|
| 45 |
+
template <typename U, typename OtherPointer>
|
| 46 |
+
_CCCL_HOST_DEVICE tagged_allocator<T, Tag, Pointer>::tagged_allocator(const tagged_allocator<U, Tag, OtherPointer>&)
|
| 47 |
+
{}
|
| 48 |
+
|
| 49 |
+
template <typename T, typename Tag, typename Pointer>
|
| 50 |
+
_CCCL_HOST_DEVICE tagged_allocator<T, Tag, Pointer>::~tagged_allocator()
|
| 51 |
+
{}
|
| 52 |
+
|
| 53 |
+
template <typename T, typename Tag, typename Pointer>
|
| 54 |
+
_CCCL_HOST_DEVICE typename tagged_allocator<T, Tag, Pointer>::pointer
|
| 55 |
+
tagged_allocator<T, Tag, Pointer>::address(reference x) const
|
| 56 |
+
{
|
| 57 |
+
return &x;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
template <typename T, typename Tag, typename Pointer>
|
| 61 |
+
_CCCL_HOST_DEVICE typename tagged_allocator<T, Tag, Pointer>::const_pointer
|
| 62 |
+
tagged_allocator<T, Tag, Pointer>::address(const_reference x) const
|
| 63 |
+
{
|
| 64 |
+
return &x;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
template <typename T, typename Tag, typename Pointer>
|
| 68 |
+
typename tagged_allocator<T, Tag, Pointer>::size_type tagged_allocator<T, Tag, Pointer>::max_size() const
|
| 69 |
+
{
|
| 70 |
+
return (std::numeric_limits<size_type>::max)() / sizeof(T);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
template <typename T1, typename Pointer1, typename T2, typename Pointer2, typename Tag>
|
| 74 |
+
_CCCL_HOST_DEVICE bool operator==(const tagged_allocator<T1, Pointer1, Tag>&, const tagged_allocator<T2, Pointer2, Tag>&)
|
| 75 |
+
{
|
| 76 |
+
return true;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
template <typename T1, typename Pointer1, typename T2, typename Pointer2, typename Tag>
|
| 80 |
+
_CCCL_HOST_DEVICE bool operator!=(const tagged_allocator<T1, Pointer1, Tag>&, const tagged_allocator<T2, Pointer2, Tag>&)
|
| 81 |
+
{
|
| 82 |
+
return false;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
} // namespace detail
|
| 86 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/temporary_allocator.h
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 29 |
+
#include <thrust/detail/allocator/tagged_allocator.h>
|
| 30 |
+
#include <thrust/detail/execution_policy.h>
|
| 31 |
+
#include <thrust/memory.h>
|
| 32 |
+
#include <thrust/pair.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
|
| 38 |
+
// XXX the pointer parameter given to tagged_allocator should be related to
|
| 39 |
+
// the type of the expression get_temporary_buffer(system, n).first
|
| 40 |
+
// without decltype, compromise on pointer<T,System>
|
| 41 |
+
template <typename T, typename System>
|
| 42 |
+
class temporary_allocator : public thrust::detail::tagged_allocator<T, System, thrust::pointer<T, System>>
|
| 43 |
+
{
|
| 44 |
+
private:
|
| 45 |
+
using super_t = thrust::detail::tagged_allocator<T, System, thrust::pointer<T, System>>;
|
| 46 |
+
|
| 47 |
+
System& m_system;
|
| 48 |
+
|
| 49 |
+
public:
|
| 50 |
+
using pointer = typename super_t::pointer;
|
| 51 |
+
using size_type = typename super_t::size_type;
|
| 52 |
+
|
| 53 |
+
inline _CCCL_HOST_DEVICE temporary_allocator(const temporary_allocator& other)
|
| 54 |
+
: super_t()
|
| 55 |
+
, m_system(other.m_system)
|
| 56 |
+
{}
|
| 57 |
+
|
| 58 |
+
inline _CCCL_HOST_DEVICE explicit temporary_allocator(thrust::execution_policy<System>& system)
|
| 59 |
+
: super_t()
|
| 60 |
+
, m_system(thrust::detail::derived_cast(system))
|
| 61 |
+
{}
|
| 62 |
+
|
| 63 |
+
_CCCL_HOST_DEVICE pointer allocate(size_type cnt);
|
| 64 |
+
|
| 65 |
+
_CCCL_HOST_DEVICE void deallocate(pointer p, size_type n) noexcept;
|
| 66 |
+
|
| 67 |
+
_CCCL_HOST_DEVICE inline System& system()
|
| 68 |
+
{
|
| 69 |
+
return m_system;
|
| 70 |
+
} // end system()
|
| 71 |
+
|
| 72 |
+
private:
|
| 73 |
+
using pointer_and_size = thrust::pair<pointer, size_type>;
|
| 74 |
+
}; // end temporary_allocator
|
| 75 |
+
|
| 76 |
+
} // namespace detail
|
| 77 |
+
THRUST_NAMESPACE_END
|
| 78 |
+
|
| 79 |
+
#include <thrust/detail/allocator/temporary_allocator.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/temporary_allocator.inl
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/temporary_allocator.h>
|
| 29 |
+
#include <thrust/detail/temporary_buffer.h>
|
| 30 |
+
#include <thrust/system/detail/bad_alloc.h>
|
| 31 |
+
|
| 32 |
+
#include <cassert>
|
| 33 |
+
|
| 34 |
+
#include <nv/target>
|
| 35 |
+
|
| 36 |
+
#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
|
| 37 |
+
# if (defined(_NVHPC_CUDA) || defined(__CUDA_ARCH__))
|
| 38 |
+
# include <thrust/system/cuda/detail/terminate.h>
|
| 39 |
+
# endif // NVCC device pass or NVC++
|
| 40 |
+
#endif // CUDA
|
| 41 |
+
|
| 42 |
+
THRUST_NAMESPACE_BEGIN
|
| 43 |
+
namespace detail
|
| 44 |
+
{
|
| 45 |
+
|
| 46 |
+
template <typename T, typename System>
|
| 47 |
+
_CCCL_HOST_DEVICE typename temporary_allocator<T, System>::pointer
|
| 48 |
+
temporary_allocator<T, System>::allocate(typename temporary_allocator<T, System>::size_type cnt)
|
| 49 |
+
{
|
| 50 |
+
pointer_and_size result = thrust::get_temporary_buffer<T>(system(), cnt);
|
| 51 |
+
|
| 52 |
+
// handle failure
|
| 53 |
+
if (result.second < cnt)
|
| 54 |
+
{
|
| 55 |
+
// deallocate and throw
|
| 56 |
+
// note that we pass cnt to deallocate, not a value derived from result.second
|
| 57 |
+
deallocate(result.first, cnt);
|
| 58 |
+
|
| 59 |
+
#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
|
| 60 |
+
NV_IF_TARGET(NV_IS_HOST,
|
| 61 |
+
(throw thrust::system::detail::bad_alloc("temporary_buffer::allocate: get_temporary_buffer failed");),
|
| 62 |
+
( // NV_IS_DEVICE
|
| 63 |
+
thrust::system::cuda::detail::terminate_with_message("temporary_buffer::allocate: "
|
| 64 |
+
"get_temporary_buffer failed");));
|
| 65 |
+
#else
|
| 66 |
+
throw thrust::system::detail::bad_alloc("temporary_buffer::allocate: get_temporary_buffer failed");
|
| 67 |
+
#endif
|
| 68 |
+
} // end if
|
| 69 |
+
|
| 70 |
+
return result.first;
|
| 71 |
+
} // end temporary_allocator::allocate()
|
| 72 |
+
|
| 73 |
+
template <typename T, typename System>
|
| 74 |
+
_CCCL_HOST_DEVICE void temporary_allocator<T, System>::deallocate(
|
| 75 |
+
typename temporary_allocator<T, System>::pointer p, typename temporary_allocator<T, System>::size_type n) noexcept
|
| 76 |
+
{
|
| 77 |
+
return thrust::return_temporary_buffer(system(), p, n);
|
| 78 |
+
} // end temporary_allocator
|
| 79 |
+
|
| 80 |
+
} // namespace detail
|
| 81 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/value_initialize_range.h
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
THRUST_NAMESPACE_BEGIN
|
| 30 |
+
namespace detail
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 34 |
+
_CCCL_HOST_DEVICE inline void value_initialize_range(Allocator& a, Pointer p, Size n);
|
| 35 |
+
|
| 36 |
+
} // namespace detail
|
| 37 |
+
THRUST_NAMESPACE_END
|
| 38 |
+
|
| 39 |
+
#include <thrust/detail/allocator/value_initialize_range.inl>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/allocator/value_initialize_range.inl
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
#include <thrust/detail/allocator/allocator_traits.h>
|
| 29 |
+
#include <thrust/detail/type_traits.h>
|
| 30 |
+
#include <thrust/detail/type_traits/pointer_traits.h>
|
| 31 |
+
#include <thrust/for_each.h>
|
| 32 |
+
#include <thrust/uninitialized_fill.h>
|
| 33 |
+
|
| 34 |
+
THRUST_NAMESPACE_BEGIN
|
| 35 |
+
namespace detail
|
| 36 |
+
{
|
| 37 |
+
namespace allocator_traits_detail
|
| 38 |
+
{
|
| 39 |
+
|
| 40 |
+
template <typename Allocator>
|
| 41 |
+
struct construct1_via_allocator
|
| 42 |
+
{
|
| 43 |
+
Allocator& a;
|
| 44 |
+
|
| 45 |
+
_CCCL_HOST_DEVICE construct1_via_allocator(Allocator& a)
|
| 46 |
+
: a(a)
|
| 47 |
+
{}
|
| 48 |
+
|
| 49 |
+
template <typename T>
|
| 50 |
+
inline _CCCL_HOST_DEVICE void operator()(T& x)
|
| 51 |
+
{
|
| 52 |
+
allocator_traits<Allocator>::construct(a, &x);
|
| 53 |
+
}
|
| 54 |
+
};
|
| 55 |
+
|
| 56 |
+
// we need to construct T via the allocator if...
|
| 57 |
+
template <typename Allocator, typename T>
|
| 58 |
+
struct needs_default_construct_via_allocator
|
| 59 |
+
: ::cuda::std::disjunction<has_member_construct1<Allocator, T>, // if the Allocator does something interesting
|
| 60 |
+
// or if T's default constructor does something
|
| 61 |
+
// interesting
|
| 62 |
+
thrust::detail::not_<::cuda::std::is_trivially_default_constructible<T>>>
|
| 63 |
+
{};
|
| 64 |
+
|
| 65 |
+
// we know that std::allocator::construct's only effect is to call T's
|
| 66 |
+
// default constructor, so we needn't use it for default construction
|
| 67 |
+
// unless T's constructor does something interesting
|
| 68 |
+
template <typename U, typename T>
|
| 69 |
+
struct needs_default_construct_via_allocator<std::allocator<U>, T>
|
| 70 |
+
: thrust::detail::not_<::cuda::std::is_trivially_default_constructible<T>>
|
| 71 |
+
{};
|
| 72 |
+
|
| 73 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 74 |
+
_CCCL_HOST_DEVICE ::cuda::std::enable_if_t<
|
| 75 |
+
needs_default_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value>
|
| 76 |
+
value_initialize_range(Allocator& a, Pointer p, Size n)
|
| 77 |
+
{
|
| 78 |
+
thrust::for_each_n(allocator_system<Allocator>::get(a), p, n, construct1_via_allocator<Allocator>(a));
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 82 |
+
_CCCL_HOST_DEVICE
|
| 83 |
+
typename disable_if<needs_default_construct_via_allocator<Allocator, typename pointer_element<Pointer>::type>::value>::type
|
| 84 |
+
value_initialize_range(Allocator& a, Pointer p, Size n)
|
| 85 |
+
{
|
| 86 |
+
thrust::uninitialized_fill_n(allocator_system<Allocator>::get(a), p, n, typename pointer_element<Pointer>::type());
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
} // namespace allocator_traits_detail
|
| 90 |
+
|
| 91 |
+
template <typename Allocator, typename Pointer, typename Size>
|
| 92 |
+
_CCCL_HOST_DEVICE void value_initialize_range(Allocator& a, Pointer p, Size n)
|
| 93 |
+
{
|
| 94 |
+
return allocator_traits_detail::value_initialize_range(a, p, n);
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
} // namespace detail
|
| 98 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/arithmetic.h
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
|
| 22 |
+
#include <thrust/complex.h>
|
| 23 |
+
#include <thrust/detail/complex/c99math.h>
|
| 24 |
+
|
| 25 |
+
#include <cfloat>
|
| 26 |
+
#include <cmath>
|
| 27 |
+
|
| 28 |
+
THRUST_NAMESPACE_BEGIN
|
| 29 |
+
|
| 30 |
+
/* --- Binary Arithmetic Operators --- */
|
| 31 |
+
|
| 32 |
+
template <typename T0, typename T1>
|
| 33 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator+(const complex<T0>& x, const complex<T1>& y)
|
| 34 |
+
{
|
| 35 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 36 |
+
return complex<T>(x.real() + y.real(), x.imag() + y.imag());
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
template <typename T0, typename T1>
|
| 40 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator+(const complex<T0>& x, const T1& y)
|
| 41 |
+
{
|
| 42 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 43 |
+
return complex<T>(x.real() + y, x.imag());
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
template <typename T0, typename T1>
|
| 47 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator+(const T0& x, const complex<T1>& y)
|
| 48 |
+
{
|
| 49 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 50 |
+
return complex<T>(x + y.real(), y.imag());
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
template <typename T0, typename T1>
|
| 54 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator-(const complex<T0>& x, const complex<T1>& y)
|
| 55 |
+
{
|
| 56 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 57 |
+
return complex<T>(x.real() - y.real(), x.imag() - y.imag());
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
template <typename T0, typename T1>
|
| 61 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator-(const complex<T0>& x, const T1& y)
|
| 62 |
+
{
|
| 63 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 64 |
+
return complex<T>(x.real() - y, x.imag());
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
template <typename T0, typename T1>
|
| 68 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator-(const T0& x, const complex<T1>& y)
|
| 69 |
+
{
|
| 70 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 71 |
+
return complex<T>(x - y.real(), -y.imag());
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
template <typename T0, typename T1>
|
| 75 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator*(const complex<T0>& x, const complex<T1>& y)
|
| 76 |
+
{
|
| 77 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 78 |
+
return complex<T>(x.real() * y.real() - x.imag() * y.imag(), x.real() * y.imag() + x.imag() * y.real());
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
template <typename T0, typename T1>
|
| 82 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator*(const complex<T0>& x, const T1& y)
|
| 83 |
+
{
|
| 84 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 85 |
+
return complex<T>(x.real() * y, x.imag() * y);
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
template <typename T0, typename T1>
|
| 89 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator*(const T0& x, const complex<T1>& y)
|
| 90 |
+
{
|
| 91 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 92 |
+
return complex<T>(x * y.real(), x * y.imag());
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
template <typename T0, typename T1>
|
| 96 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator/(const complex<T0>& x, const complex<T1>& y)
|
| 97 |
+
{
|
| 98 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 99 |
+
|
| 100 |
+
// Find `abs` by ADL.
|
| 101 |
+
using std::abs;
|
| 102 |
+
|
| 103 |
+
T s = abs(y.real()) + abs(y.imag());
|
| 104 |
+
|
| 105 |
+
T oos = T(1.0) / s;
|
| 106 |
+
|
| 107 |
+
T ars = x.real() * oos;
|
| 108 |
+
T ais = x.imag() * oos;
|
| 109 |
+
T brs = y.real() * oos;
|
| 110 |
+
T bis = y.imag() * oos;
|
| 111 |
+
|
| 112 |
+
s = (brs * brs) + (bis * bis);
|
| 113 |
+
|
| 114 |
+
oos = T(1.0) / s;
|
| 115 |
+
|
| 116 |
+
complex<T> quot(((ars * brs) + (ais * bis)) * oos, ((ais * brs) - (ars * bis)) * oos);
|
| 117 |
+
return quot;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
template <typename T0, typename T1>
|
| 121 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator/(const complex<T0>& x, const T1& y)
|
| 122 |
+
{
|
| 123 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 124 |
+
return complex<T>(x.real() / y, x.imag() / y);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
template <typename T0, typename T1>
|
| 128 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> operator/(const T0& x, const complex<T1>& y)
|
| 129 |
+
{
|
| 130 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 131 |
+
return complex<T>(x) / y;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/* --- Unary Arithmetic Operators --- */
|
| 135 |
+
|
| 136 |
+
template <typename T>
|
| 137 |
+
_CCCL_HOST_DEVICE complex<T> operator+(const complex<T>& y)
|
| 138 |
+
{
|
| 139 |
+
return y;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
template <typename T>
|
| 143 |
+
_CCCL_HOST_DEVICE complex<T> operator-(const complex<T>& y)
|
| 144 |
+
{
|
| 145 |
+
return y * -T(1);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/* --- Other Basic Arithmetic Functions --- */
|
| 149 |
+
|
| 150 |
+
// As std::hypot is only C++11 we have to use the C interface
|
| 151 |
+
template <typename T>
|
| 152 |
+
_CCCL_HOST_DEVICE T abs(const complex<T>& z)
|
| 153 |
+
{
|
| 154 |
+
return hypot(z.real(), z.imag());
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
// XXX Why are we specializing here?
|
| 158 |
+
namespace detail
|
| 159 |
+
{
|
| 160 |
+
namespace complex
|
| 161 |
+
{
|
| 162 |
+
|
| 163 |
+
_CCCL_HOST_DEVICE inline float abs(const thrust::complex<float>& z)
|
| 164 |
+
{
|
| 165 |
+
return hypotf(z.real(), z.imag());
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
_CCCL_HOST_DEVICE inline double abs(const thrust::complex<double>& z)
|
| 169 |
+
{
|
| 170 |
+
return hypot(z.real(), z.imag());
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
} // end namespace complex
|
| 174 |
+
} // end namespace detail
|
| 175 |
+
|
| 176 |
+
template <>
|
| 177 |
+
_CCCL_HOST_DEVICE inline float abs(const complex<float>& z)
|
| 178 |
+
{
|
| 179 |
+
return detail::complex::abs(z);
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
template <>
|
| 183 |
+
_CCCL_HOST_DEVICE inline double abs(const complex<double>& z)
|
| 184 |
+
{
|
| 185 |
+
return detail::complex::abs(z);
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
template <typename T>
|
| 189 |
+
_CCCL_HOST_DEVICE T arg(const complex<T>& z)
|
| 190 |
+
{
|
| 191 |
+
// Find `atan2` by ADL.
|
| 192 |
+
using std::atan2;
|
| 193 |
+
return atan2(z.imag(), z.real());
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
template <typename T>
|
| 197 |
+
_CCCL_HOST_DEVICE complex<T> conj(const complex<T>& z)
|
| 198 |
+
{
|
| 199 |
+
return complex<T>(z.real(), -z.imag());
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
template <typename T>
|
| 203 |
+
_CCCL_HOST_DEVICE T norm(const complex<T>& z)
|
| 204 |
+
{
|
| 205 |
+
return z.real() * z.real() + z.imag() * z.imag();
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
// XXX Why specialize these, we could just rely on ADL.
|
| 209 |
+
template <>
|
| 210 |
+
_CCCL_HOST_DEVICE inline float norm(const complex<float>& z)
|
| 211 |
+
{
|
| 212 |
+
// Find `abs` and `sqrt` by ADL.
|
| 213 |
+
using std::abs;
|
| 214 |
+
using std::sqrt;
|
| 215 |
+
|
| 216 |
+
if (abs(z.real()) < sqrt(FLT_MIN) && abs(z.imag()) < sqrt(FLT_MIN))
|
| 217 |
+
{
|
| 218 |
+
float a = z.real() * 4.0f;
|
| 219 |
+
float b = z.imag() * 4.0f;
|
| 220 |
+
return (a * a + b * b) / 16.0f;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
return z.real() * z.real() + z.imag() * z.imag();
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
template <>
|
| 227 |
+
_CCCL_HOST_DEVICE inline double norm(const complex<double>& z)
|
| 228 |
+
{
|
| 229 |
+
// Find `abs` and `sqrt` by ADL.
|
| 230 |
+
using std::abs;
|
| 231 |
+
using std::sqrt;
|
| 232 |
+
|
| 233 |
+
if (abs(z.real()) < sqrt(DBL_MIN) && abs(z.imag()) < sqrt(DBL_MIN))
|
| 234 |
+
{
|
| 235 |
+
double a = z.real() * 4.0;
|
| 236 |
+
double b = z.imag() * 4.0;
|
| 237 |
+
return (a * a + b * b) / 16.0;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
return z.real() * z.real() + z.imag() * z.imag();
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
template <typename T0, typename T1>
|
| 244 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> polar(const T0& m, const T1& theta)
|
| 245 |
+
{
|
| 246 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 247 |
+
|
| 248 |
+
// Find `cos` and `sin` by ADL.
|
| 249 |
+
using std::cos;
|
| 250 |
+
using std::sin;
|
| 251 |
+
|
| 252 |
+
return complex<T>(m * cos(theta), m * sin(theta));
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/c99math.h
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#include <thrust/detail/complex/math_private.h>
|
| 22 |
+
|
| 23 |
+
#include <cmath>
|
| 24 |
+
|
| 25 |
+
#include <math.h>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
namespace complex
|
| 31 |
+
{
|
| 32 |
+
|
| 33 |
+
// Define basic arithmetic functions so we can use them without explicit scope
|
| 34 |
+
// keeping the code as close as possible to FreeBSDs for ease of maintenance.
|
| 35 |
+
// It also provides an easy way to support compilers with missing C99 functions.
|
| 36 |
+
// When possible, just use the names in the global scope.
|
| 37 |
+
// Some platforms define these as macros, others as free functions.
|
| 38 |
+
// Avoid using the std:: form of these as nvcc may treat std::foo() as __host__ functions.
|
| 39 |
+
|
| 40 |
+
using ::acos;
|
| 41 |
+
using ::asin;
|
| 42 |
+
using ::atan;
|
| 43 |
+
using ::cos;
|
| 44 |
+
using ::cosh;
|
| 45 |
+
using ::exp;
|
| 46 |
+
using ::log;
|
| 47 |
+
using ::sin;
|
| 48 |
+
using ::sinh;
|
| 49 |
+
using ::sqrt;
|
| 50 |
+
using ::tan;
|
| 51 |
+
|
| 52 |
+
template <typename T>
|
| 53 |
+
inline _CCCL_HOST_DEVICE T infinity();
|
| 54 |
+
|
| 55 |
+
template <>
|
| 56 |
+
inline _CCCL_HOST_DEVICE float infinity<float>()
|
| 57 |
+
{
|
| 58 |
+
float res;
|
| 59 |
+
set_float_word(res, 0x7f800000);
|
| 60 |
+
return res;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
template <>
|
| 64 |
+
inline _CCCL_HOST_DEVICE double infinity<double>()
|
| 65 |
+
{
|
| 66 |
+
double res;
|
| 67 |
+
insert_words(res, 0x7ff00000, 0);
|
| 68 |
+
return res;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
#if defined _MSC_VER
|
| 72 |
+
_CCCL_HOST_DEVICE inline int isinf(float x)
|
| 73 |
+
{
|
| 74 |
+
return std::abs(x) == infinity<float>();
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
_CCCL_HOST_DEVICE inline int isinf(double x)
|
| 78 |
+
{
|
| 79 |
+
return std::abs(x) == infinity<double>();
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
_CCCL_HOST_DEVICE inline int isnan(float x)
|
| 83 |
+
{
|
| 84 |
+
return x != x;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
_CCCL_HOST_DEVICE inline int isnan(double x)
|
| 88 |
+
{
|
| 89 |
+
return x != x;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
_CCCL_HOST_DEVICE inline int signbit(float x)
|
| 93 |
+
{
|
| 94 |
+
return ((*((uint32_t*) &x)) & 0x80000000) != 0 ? 1 : 0;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
_CCCL_HOST_DEVICE inline int signbit(double x)
|
| 98 |
+
{
|
| 99 |
+
return ((*((uint64_t*) &x)) & 0x8000000000000000) != 0ull ? 1 : 0;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
_CCCL_HOST_DEVICE inline int isfinite(float x)
|
| 103 |
+
{
|
| 104 |
+
return !isnan(x) && !isinf(x);
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
_CCCL_HOST_DEVICE inline int isfinite(double x)
|
| 108 |
+
{
|
| 109 |
+
return !isnan(x) && !isinf(x);
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
#else
|
| 113 |
+
|
| 114 |
+
# if defined(__CUDACC__) && !(defined(__CUDA__) && defined(__clang__)) && !defined(_NVHPC_CUDA)
|
| 115 |
+
// NVCC implements at least some signature of these as functions not macros.
|
| 116 |
+
using ::isfinite;
|
| 117 |
+
using ::isinf;
|
| 118 |
+
using ::isnan;
|
| 119 |
+
using ::signbit;
|
| 120 |
+
# else
|
| 121 |
+
// Some compilers do not provide these in the global scope, because they are
|
| 122 |
+
// supposed to be macros. The versions in `std` are supposed to be functions.
|
| 123 |
+
// Since we're not compiling with nvcc, it's safe to use the functions in std::
|
| 124 |
+
using std::isfinite;
|
| 125 |
+
using std::isinf;
|
| 126 |
+
using std::isnan;
|
| 127 |
+
using std::signbit;
|
| 128 |
+
# endif // __CUDACC__
|
| 129 |
+
#endif // _MSC_VER
|
| 130 |
+
|
| 131 |
+
using ::atanh;
|
| 132 |
+
|
| 133 |
+
#if defined _MSC_VER
|
| 134 |
+
|
| 135 |
+
_CCCL_HOST_DEVICE inline double copysign(double x, double y)
|
| 136 |
+
{
|
| 137 |
+
uint32_t hx, hy;
|
| 138 |
+
get_high_word(hx, x);
|
| 139 |
+
get_high_word(hy, y);
|
| 140 |
+
set_high_word(x, (hx & 0x7fffffff) | (hy & 0x80000000));
|
| 141 |
+
return x;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
_CCCL_HOST_DEVICE inline float copysignf(float x, float y)
|
| 145 |
+
{
|
| 146 |
+
uint32_t ix, iy;
|
| 147 |
+
get_float_word(ix, x);
|
| 148 |
+
get_float_word(iy, y);
|
| 149 |
+
set_float_word(x, (ix & 0x7fffffff) | (iy & 0x80000000));
|
| 150 |
+
return x;
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
# if !defined(__CUDACC__) && !defined(_NVHPC_CUDA)
|
| 154 |
+
|
| 155 |
+
// Simple approximation to log1p as Visual Studio is lacking one
|
| 156 |
+
inline double log1p(double x)
|
| 157 |
+
{
|
| 158 |
+
double u = 1.0 + x;
|
| 159 |
+
if (u == 1.0)
|
| 160 |
+
{
|
| 161 |
+
return x;
|
| 162 |
+
}
|
| 163 |
+
else
|
| 164 |
+
{
|
| 165 |
+
if (u > 2.0)
|
| 166 |
+
{
|
| 167 |
+
// Use normal log for large arguments
|
| 168 |
+
return log(u);
|
| 169 |
+
}
|
| 170 |
+
else
|
| 171 |
+
{
|
| 172 |
+
return log(u) * (x / (u - 1.0));
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
inline float log1pf(float x)
|
| 178 |
+
{
|
| 179 |
+
float u = 1.0f + x;
|
| 180 |
+
if (u == 1.0f)
|
| 181 |
+
{
|
| 182 |
+
return x;
|
| 183 |
+
}
|
| 184 |
+
else
|
| 185 |
+
{
|
| 186 |
+
if (u > 2.0f)
|
| 187 |
+
{
|
| 188 |
+
// Use normal log for large arguments
|
| 189 |
+
return logf(u);
|
| 190 |
+
}
|
| 191 |
+
else
|
| 192 |
+
{
|
| 193 |
+
return logf(u) * (x / (u - 1.0f));
|
| 194 |
+
}
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
# if _MSV_VER <= 1500
|
| 199 |
+
# include <complex>
|
| 200 |
+
|
| 201 |
+
inline float hypotf(float x, float y)
|
| 202 |
+
{
|
| 203 |
+
return abs(std::complex<float>(x, y));
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
inline double hypot(double x, double y)
|
| 207 |
+
{
|
| 208 |
+
return _hypot(x, y);
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
# endif // _MSC_VER <= 1500
|
| 212 |
+
|
| 213 |
+
# endif // __CUDACC__
|
| 214 |
+
|
| 215 |
+
#endif // _MSC_VER
|
| 216 |
+
|
| 217 |
+
} // namespace complex
|
| 218 |
+
|
| 219 |
+
} // namespace detail
|
| 220 |
+
|
| 221 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/catrig.h
ADDED
|
@@ -0,0 +1,875 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia <filipe.c.maia@gmail.com>:
|
| 46 |
+
* freebsd/lib/msun/src/catrig.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#pragma once
|
| 50 |
+
|
| 51 |
+
#include <thrust/detail/config.h>
|
| 52 |
+
|
| 53 |
+
#include <thrust/complex.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
#include <cfloat>
|
| 57 |
+
#include <cmath>
|
| 58 |
+
|
| 59 |
+
THRUST_NAMESPACE_BEGIN
|
| 60 |
+
namespace detail
|
| 61 |
+
{
|
| 62 |
+
namespace complex
|
| 63 |
+
{
|
| 64 |
+
|
| 65 |
+
using thrust::complex;
|
| 66 |
+
|
| 67 |
+
_CCCL_HOST_DEVICE inline void raise_inexact()
|
| 68 |
+
{
|
| 69 |
+
const volatile float tiny = 7.888609052210118054117286e-31; /* 0x1p-100; */
|
| 70 |
+
// needs the volatile to prevent compiler from ignoring it
|
| 71 |
+
volatile float junk = 1 + tiny;
|
| 72 |
+
(void) junk;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
_CCCL_HOST_DEVICE inline complex<double> clog_for_large_values(complex<double> z);
|
| 76 |
+
|
| 77 |
+
/*
|
| 78 |
+
* Testing indicates that all these functions are accurate up to 4 ULP.
|
| 79 |
+
* The functions casin(h) and cacos(h) are about 2.5 times slower than asinh.
|
| 80 |
+
* The functions catan(h) are a little under 2 times slower than atanh.
|
| 81 |
+
*
|
| 82 |
+
* The code for casinh, casin, cacos, and cacosh comes first. The code is
|
| 83 |
+
* rather complicated, and the four functions are highly interdependent.
|
| 84 |
+
*
|
| 85 |
+
* The code for catanh and catan comes at the end. It is much simpler than
|
| 86 |
+
* the other functions, and the code for these can be disconnected from the
|
| 87 |
+
* rest of the code.
|
| 88 |
+
*/
|
| 89 |
+
|
| 90 |
+
/*
|
| 91 |
+
* ================================
|
| 92 |
+
* | casinh, casin, cacos, cacosh |
|
| 93 |
+
* ================================
|
| 94 |
+
*/
|
| 95 |
+
|
| 96 |
+
/*
|
| 97 |
+
* The algorithm is very close to that in "Implementing the complex arcsine
|
| 98 |
+
* and arccosine functions using exception handling" by T. E. Hull, Thomas F.
|
| 99 |
+
* Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
|
| 100 |
+
* Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
|
| 101 |
+
* http://dl.acm.org/citation.cfm?id=275324.
|
| 102 |
+
*
|
| 103 |
+
* Throughout we use the convention z = x + I*y.
|
| 104 |
+
*
|
| 105 |
+
* casinh(z) = sign(x)*log(A+sqrt(A*A-1)) + I*asin(B)
|
| 106 |
+
* where
|
| 107 |
+
* A = (|z+I| + |z-I|) / 2
|
| 108 |
+
* B = (|z+I| - |z-I|) / 2 = y/A
|
| 109 |
+
*
|
| 110 |
+
* These formulas become numerically unstable:
|
| 111 |
+
* (a) for Re(casinh(z)) when z is close to the line segment [-I, I] (that
|
| 112 |
+
* is, Re(casinh(z)) is close to 0);
|
| 113 |
+
* (b) for Im(casinh(z)) when z is close to either of the intervals
|
| 114 |
+
* [I, I*infinity) or (-I*infinity, -I] (that is, |Im(casinh(z))| is
|
| 115 |
+
* close to PI/2).
|
| 116 |
+
*
|
| 117 |
+
* These numerical problems are overcome by defining
|
| 118 |
+
* f(a, b) = (hypot(a, b) - b) / 2 = a*a / (hypot(a, b) + b) / 2
|
| 119 |
+
* Then if A < A_crossover, we use
|
| 120 |
+
* log(A + sqrt(A*A-1)) = log1p((A-1) + sqrt((A-1)*(A+1)))
|
| 121 |
+
* A-1 = f(x, 1+y) + f(x, 1-y)
|
| 122 |
+
* and if B > B_crossover, we use
|
| 123 |
+
* asin(B) = atan2(y, sqrt(A*A - y*y)) = atan2(y, sqrt((A+y)*(A-y)))
|
| 124 |
+
* A-y = f(x, y+1) + f(x, y-1)
|
| 125 |
+
* where without loss of generality we have assumed that x and y are
|
| 126 |
+
* non-negative.
|
| 127 |
+
*
|
| 128 |
+
* Much of the difficulty comes because the intermediate computations may
|
| 129 |
+
* produce overflows or underflows. This is dealt with in the paper by Hull
|
| 130 |
+
* et al by using exception handling. We do this by detecting when
|
| 131 |
+
* computations risk underflow or overflow. The hardest part is handling the
|
| 132 |
+
* underflows when computing f(a, b).
|
| 133 |
+
*
|
| 134 |
+
* Note that the function f(a, b) does not appear explicitly in the paper by
|
| 135 |
+
* Hull et al, but the idea may be found on pages 308 and 309. Introducing the
|
| 136 |
+
* function f(a, b) allows us to concentrate many of the clever tricks in this
|
| 137 |
+
* paper into one function.
|
| 138 |
+
*/
|
| 139 |
+
|
| 140 |
+
/*
|
| 141 |
+
* Function f(a, b, hypot_a_b) = (hypot(a, b) - b) / 2.
|
| 142 |
+
* Pass hypot(a, b) as the third argument.
|
| 143 |
+
*/
|
| 144 |
+
_CCCL_HOST_DEVICE inline double f(double a, double b, double hypot_a_b)
|
| 145 |
+
{
|
| 146 |
+
if (b < 0)
|
| 147 |
+
{
|
| 148 |
+
return ((hypot_a_b - b) / 2);
|
| 149 |
+
}
|
| 150 |
+
if (b == 0)
|
| 151 |
+
{
|
| 152 |
+
return (a / 2);
|
| 153 |
+
}
|
| 154 |
+
return (a * a / (hypot_a_b + b) / 2);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
/*
|
| 158 |
+
* All the hard work is contained in this function.
|
| 159 |
+
* x and y are assumed positive or zero, and less than RECIP_EPSILON.
|
| 160 |
+
* Upon return:
|
| 161 |
+
* rx = Re(casinh(z)) = -Im(cacos(y + I*x)).
|
| 162 |
+
* B_is_usable is set to 1 if the value of B is usable.
|
| 163 |
+
* If B_is_usable is set to 0, sqrt_A2my2 = sqrt(A*A - y*y), and new_y = y.
|
| 164 |
+
* If returning sqrt_A2my2 has potential to result in an underflow, it is
|
| 165 |
+
* rescaled, and new_y is similarly rescaled.
|
| 166 |
+
*/
|
| 167 |
+
_CCCL_HOST_DEVICE inline void
|
| 168 |
+
do_hard_work(double x, double y, double* rx, int* B_is_usable, double* B, double* sqrt_A2my2, double* new_y)
|
| 169 |
+
{
|
| 170 |
+
double R, S, A; /* A, B, R, and S are as in Hull et al. */
|
| 171 |
+
double Am1, Amy; /* A-1, A-y. */
|
| 172 |
+
const double A_crossover = 10; /* Hull et al suggest 1.5, but 10 works better */
|
| 173 |
+
const double FOUR_SQRT_MIN = 5.966672584960165394632772e-154; /* =0x1p-509; >= 4 * sqrt(DBL_MIN) */
|
| 174 |
+
const double B_crossover = 0.6417; /* suggested by Hull et al */
|
| 175 |
+
|
| 176 |
+
R = hypot(x, y + 1); /* |z+I| */
|
| 177 |
+
S = hypot(x, y - 1); /* |z-I| */
|
| 178 |
+
|
| 179 |
+
/* A = (|z+I| + |z-I|) / 2 */
|
| 180 |
+
A = (R + S) / 2;
|
| 181 |
+
/*
|
| 182 |
+
* Mathematically A >= 1. There is a small chance that this will not
|
| 183 |
+
* be so because of rounding errors. So we will make certain it is
|
| 184 |
+
* so.
|
| 185 |
+
*/
|
| 186 |
+
if (A < 1)
|
| 187 |
+
{
|
| 188 |
+
A = 1;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
if (A < A_crossover)
|
| 192 |
+
{
|
| 193 |
+
/*
|
| 194 |
+
* Am1 = fp + fm, where fp = f(x, 1+y), and fm = f(x, 1-y).
|
| 195 |
+
* rx = log1p(Am1 + sqrt(Am1*(A+1)))
|
| 196 |
+
*/
|
| 197 |
+
if (y == 1 && x < DBL_EPSILON * DBL_EPSILON / 128)
|
| 198 |
+
{
|
| 199 |
+
/*
|
| 200 |
+
* fp is of order x^2, and fm = x/2.
|
| 201 |
+
* A = 1 (inexactly).
|
| 202 |
+
*/
|
| 203 |
+
*rx = sqrt(x);
|
| 204 |
+
}
|
| 205 |
+
else if (x >= DBL_EPSILON * fabs(y - 1))
|
| 206 |
+
{
|
| 207 |
+
/*
|
| 208 |
+
* Underflow will not occur because
|
| 209 |
+
* x >= DBL_EPSILON^2/128 >= FOUR_SQRT_MIN
|
| 210 |
+
*/
|
| 211 |
+
Am1 = f(x, 1 + y, R) + f(x, 1 - y, S);
|
| 212 |
+
*rx = log1p(Am1 + sqrt(Am1 * (A + 1)));
|
| 213 |
+
}
|
| 214 |
+
else if (y < 1)
|
| 215 |
+
{
|
| 216 |
+
/*
|
| 217 |
+
* fp = x*x/(1+y)/4, fm = x*x/(1-y)/4, and
|
| 218 |
+
* A = 1 (inexactly).
|
| 219 |
+
*/
|
| 220 |
+
*rx = x / sqrt((1 - y) * (1 + y));
|
| 221 |
+
}
|
| 222 |
+
else
|
| 223 |
+
{ /* if (y > 1) */
|
| 224 |
+
/*
|
| 225 |
+
* A-1 = y-1 (inexactly).
|
| 226 |
+
*/
|
| 227 |
+
*rx = log1p((y - 1) + sqrt((y - 1) * (y + 1)));
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
else
|
| 231 |
+
{
|
| 232 |
+
*rx = log(A + sqrt(A * A - 1));
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
*new_y = y;
|
| 236 |
+
|
| 237 |
+
if (y < FOUR_SQRT_MIN)
|
| 238 |
+
{
|
| 239 |
+
/*
|
| 240 |
+
* Avoid a possible underflow caused by y/A. For casinh this
|
| 241 |
+
* would be legitimate, but will be picked up by invoking atan2
|
| 242 |
+
* later on. For cacos this would not be legitimate.
|
| 243 |
+
*/
|
| 244 |
+
*B_is_usable = 0;
|
| 245 |
+
*sqrt_A2my2 = A * (2 / DBL_EPSILON);
|
| 246 |
+
*new_y = y * (2 / DBL_EPSILON);
|
| 247 |
+
return;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
/* B = (|z+I| - |z-I|) / 2 = y/A */
|
| 251 |
+
*B = y / A;
|
| 252 |
+
*B_is_usable = 1;
|
| 253 |
+
|
| 254 |
+
if (*B > B_crossover)
|
| 255 |
+
{
|
| 256 |
+
*B_is_usable = 0;
|
| 257 |
+
/*
|
| 258 |
+
* Amy = fp + fm, where fp = f(x, y+1), and fm = f(x, y-1).
|
| 259 |
+
* sqrt_A2my2 = sqrt(Amy*(A+y))
|
| 260 |
+
*/
|
| 261 |
+
if (y == 1 && x < DBL_EPSILON / 128)
|
| 262 |
+
{
|
| 263 |
+
/*
|
| 264 |
+
* fp is of order x^2, and fm = x/2.
|
| 265 |
+
* A = 1 (inexactly).
|
| 266 |
+
*/
|
| 267 |
+
*sqrt_A2my2 = sqrt(x) * sqrt((A + y) / 2);
|
| 268 |
+
}
|
| 269 |
+
else if (x >= DBL_EPSILON * fabs(y - 1))
|
| 270 |
+
{
|
| 271 |
+
/*
|
| 272 |
+
* Underflow will not occur because
|
| 273 |
+
* x >= DBL_EPSILON/128 >= FOUR_SQRT_MIN
|
| 274 |
+
* and
|
| 275 |
+
* x >= DBL_EPSILON^2 >= FOUR_SQRT_MIN
|
| 276 |
+
*/
|
| 277 |
+
Amy = f(x, y + 1, R) + f(x, y - 1, S);
|
| 278 |
+
*sqrt_A2my2 = sqrt(Amy * (A + y));
|
| 279 |
+
}
|
| 280 |
+
else if (y > 1)
|
| 281 |
+
{
|
| 282 |
+
/*
|
| 283 |
+
* fp = x*x/(y+1)/4, fm = x*x/(y-1)/4, and
|
| 284 |
+
* A = y (inexactly).
|
| 285 |
+
*
|
| 286 |
+
* y < RECIP_EPSILON. So the following
|
| 287 |
+
* scaling should avoid any underflow problems.
|
| 288 |
+
*/
|
| 289 |
+
*sqrt_A2my2 = x * (4 / DBL_EPSILON / DBL_EPSILON) * y / sqrt((y + 1) * (y - 1));
|
| 290 |
+
*new_y = y * (4 / DBL_EPSILON / DBL_EPSILON);
|
| 291 |
+
}
|
| 292 |
+
else
|
| 293 |
+
{ /* if (y < 1) */
|
| 294 |
+
/*
|
| 295 |
+
* fm = 1-y >= DBL_EPSILON, fp is of order x^2, and
|
| 296 |
+
* A = 1 (inexactly).
|
| 297 |
+
*/
|
| 298 |
+
*sqrt_A2my2 = sqrt((1 - y) * (1 + y));
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
/*
|
| 304 |
+
* casinh(z) = z + O(z^3) as z -> 0
|
| 305 |
+
*
|
| 306 |
+
* casinh(z) = sign(x)*clog(sign(x)*z) + O(1/z^2) as z -> infinity
|
| 307 |
+
* The above formula works for the imaginary part as well, because
|
| 308 |
+
* Im(casinh(z)) = sign(x)*atan2(sign(x)*y, fabs(x)) + O(y/z^3)
|
| 309 |
+
* as z -> infinity, uniformly in y
|
| 310 |
+
*/
|
| 311 |
+
_CCCL_HOST_DEVICE inline complex<double> casinh(complex<double> z)
|
| 312 |
+
{
|
| 313 |
+
double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
|
| 314 |
+
int B_is_usable;
|
| 315 |
+
complex<double> w;
|
| 316 |
+
const double RECIP_EPSILON = 1.0 / DBL_EPSILON;
|
| 317 |
+
const double m_ln2 = 6.9314718055994531e-1; /* 0x162e42fefa39ef.0p-53 */
|
| 318 |
+
x = z.real();
|
| 319 |
+
y = z.imag();
|
| 320 |
+
ax = fabs(x);
|
| 321 |
+
ay = fabs(y);
|
| 322 |
+
|
| 323 |
+
if (isnan(x) || isnan(y))
|
| 324 |
+
{
|
| 325 |
+
/* casinh(+-Inf + I*NaN) = +-Inf + I*NaN */
|
| 326 |
+
if (isinf(x))
|
| 327 |
+
{
|
| 328 |
+
return (complex<double>(x, y + y));
|
| 329 |
+
}
|
| 330 |
+
/* casinh(NaN + I*+-Inf) = opt(+-)Inf + I*NaN */
|
| 331 |
+
if (isinf(y))
|
| 332 |
+
{
|
| 333 |
+
return (complex<double>(y, x + x));
|
| 334 |
+
}
|
| 335 |
+
/* casinh(NaN + I*0) = NaN + I*0 */
|
| 336 |
+
if (y == 0)
|
| 337 |
+
{
|
| 338 |
+
return (complex<double>(x + x, y));
|
| 339 |
+
}
|
| 340 |
+
/*
|
| 341 |
+
* All other cases involving NaN return NaN + I*NaN.
|
| 342 |
+
* C99 leaves it optional whether to raise invalid if one of
|
| 343 |
+
* the arguments is not NaN, so we opt not to raise it.
|
| 344 |
+
*/
|
| 345 |
+
return (complex<double>(x + 0.0 + (y + 0.0), x + 0.0 + (y + 0.0)));
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 349 |
+
{
|
| 350 |
+
/* clog...() will raise inexact unless x or y is infinite. */
|
| 351 |
+
if (signbit(x) == 0)
|
| 352 |
+
{
|
| 353 |
+
w = clog_for_large_values(z) + m_ln2;
|
| 354 |
+
}
|
| 355 |
+
else
|
| 356 |
+
{
|
| 357 |
+
w = clog_for_large_values(-z) + m_ln2;
|
| 358 |
+
}
|
| 359 |
+
return (complex<double>(copysign(w.real(), x), copysign(w.imag(), y)));
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
/* Avoid spuriously raising inexact for z = 0. */
|
| 363 |
+
if (x == 0 && y == 0)
|
| 364 |
+
{
|
| 365 |
+
return (z);
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
/* All remaining cases are inexact. */
|
| 369 |
+
raise_inexact();
|
| 370 |
+
|
| 371 |
+
const double SQRT_6_EPSILON = 3.6500241499888571e-8; /* 0x13988e1409212e.0p-77 */
|
| 372 |
+
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
|
| 373 |
+
{
|
| 374 |
+
return (z);
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
|
| 378 |
+
if (B_is_usable)
|
| 379 |
+
{
|
| 380 |
+
ry = asin(B);
|
| 381 |
+
}
|
| 382 |
+
else
|
| 383 |
+
{
|
| 384 |
+
ry = atan2(new_y, sqrt_A2my2);
|
| 385 |
+
}
|
| 386 |
+
return (complex<double>(copysign(rx, x), copysign(ry, y)));
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
/*
|
| 390 |
+
* casin(z) = reverse(casinh(reverse(z)))
|
| 391 |
+
* where reverse(x + I*y) = y + I*x = I*conj(z).
|
| 392 |
+
*/
|
| 393 |
+
_CCCL_HOST_DEVICE inline complex<double> casin(complex<double> z)
|
| 394 |
+
{
|
| 395 |
+
complex<double> w = casinh(complex<double>(z.imag(), z.real()));
|
| 396 |
+
|
| 397 |
+
return (complex<double>(w.imag(), w.real()));
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
/*
|
| 401 |
+
* cacos(z) = PI/2 - casin(z)
|
| 402 |
+
* but do the computation carefully so cacos(z) is accurate when z is
|
| 403 |
+
* close to 1.
|
| 404 |
+
*
|
| 405 |
+
* cacos(z) = PI/2 - z + O(z^3) as z -> 0
|
| 406 |
+
*
|
| 407 |
+
* cacos(z) = -sign(y)*I*clog(z) + O(1/z^2) as z -> infinity
|
| 408 |
+
* The above formula works for the real part as well, because
|
| 409 |
+
* Re(cacos(z)) = atan2(fabs(y), x) + O(y/z^3)
|
| 410 |
+
* as z -> infinity, uniformly in y
|
| 411 |
+
*/
|
| 412 |
+
_CCCL_HOST_DEVICE inline complex<double> cacos(complex<double> z)
|
| 413 |
+
{
|
| 414 |
+
double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
|
| 415 |
+
int sx, sy;
|
| 416 |
+
int B_is_usable;
|
| 417 |
+
complex<double> w;
|
| 418 |
+
const double pio2_hi = 1.5707963267948966e0; /* 0x1921fb54442d18.0p-52 */
|
| 419 |
+
const volatile double pio2_lo = 6.1232339957367659e-17; /* 0x11a62633145c07.0p-106 */
|
| 420 |
+
const double m_ln2 = 6.9314718055994531e-1; /* 0x162e42fefa39ef.0p-53 */
|
| 421 |
+
|
| 422 |
+
x = z.real();
|
| 423 |
+
y = z.imag();
|
| 424 |
+
sx = signbit(x);
|
| 425 |
+
sy = signbit(y);
|
| 426 |
+
ax = fabs(x);
|
| 427 |
+
ay = fabs(y);
|
| 428 |
+
|
| 429 |
+
if (isnan(x) || isnan(y))
|
| 430 |
+
{
|
| 431 |
+
/* cacos(+-Inf + I*NaN) = NaN + I*opt(-)Inf */
|
| 432 |
+
if (isinf(x))
|
| 433 |
+
{
|
| 434 |
+
return (complex<double>(y + y, -infinity<double>()));
|
| 435 |
+
}
|
| 436 |
+
/* cacos(NaN + I*+-Inf) = NaN + I*-+Inf */
|
| 437 |
+
if (isinf(y))
|
| 438 |
+
{
|
| 439 |
+
return (complex<double>(x + x, -y));
|
| 440 |
+
}
|
| 441 |
+
/* cacos(0 + I*NaN) = PI/2 + I*NaN with inexact */
|
| 442 |
+
if (x == 0)
|
| 443 |
+
{
|
| 444 |
+
return (complex<double>(pio2_hi + pio2_lo, y + y));
|
| 445 |
+
}
|
| 446 |
+
/*
|
| 447 |
+
* All other cases involving NaN return NaN + I*NaN.
|
| 448 |
+
* C99 leaves it optional whether to raise invalid if one of
|
| 449 |
+
* the arguments is not NaN, so we opt not to raise it.
|
| 450 |
+
*/
|
| 451 |
+
return (complex<double>(x + 0.0 + (y + 0), x + 0.0 + (y + 0)));
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
const double RECIP_EPSILON = 1.0 / DBL_EPSILON;
|
| 455 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 456 |
+
{
|
| 457 |
+
/* clog...() will raise inexact unless x or y is infinite. */
|
| 458 |
+
w = clog_for_large_values(z);
|
| 459 |
+
rx = fabs(w.imag());
|
| 460 |
+
ry = w.real() + m_ln2;
|
| 461 |
+
if (sy == 0)
|
| 462 |
+
{
|
| 463 |
+
ry = -ry;
|
| 464 |
+
}
|
| 465 |
+
return (complex<double>(rx, ry));
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
/* Avoid spuriously raising inexact for z = 1. */
|
| 469 |
+
if (x == 1.0 && y == 0.0)
|
| 470 |
+
{
|
| 471 |
+
return (complex<double>(0, -y));
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
/* All remaining cases are inexact. */
|
| 475 |
+
raise_inexact();
|
| 476 |
+
|
| 477 |
+
const double SQRT_6_EPSILON = 3.6500241499888571e-8; /* 0x13988e1409212e.0p-77 */
|
| 478 |
+
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
|
| 479 |
+
{
|
| 480 |
+
return (complex<double>(pio2_hi - (x - pio2_lo), -y));
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
|
| 484 |
+
if (B_is_usable)
|
| 485 |
+
{
|
| 486 |
+
if (sx == 0)
|
| 487 |
+
{
|
| 488 |
+
rx = acos(B);
|
| 489 |
+
}
|
| 490 |
+
else
|
| 491 |
+
{
|
| 492 |
+
rx = acos(-B);
|
| 493 |
+
}
|
| 494 |
+
}
|
| 495 |
+
else
|
| 496 |
+
{
|
| 497 |
+
if (sx == 0)
|
| 498 |
+
{
|
| 499 |
+
rx = atan2(sqrt_A2mx2, new_x);
|
| 500 |
+
}
|
| 501 |
+
else
|
| 502 |
+
{
|
| 503 |
+
rx = atan2(sqrt_A2mx2, -new_x);
|
| 504 |
+
}
|
| 505 |
+
}
|
| 506 |
+
if (sy == 0)
|
| 507 |
+
{
|
| 508 |
+
ry = -ry;
|
| 509 |
+
}
|
| 510 |
+
return (complex<double>(rx, ry));
|
| 511 |
+
}
|
| 512 |
+
|
| 513 |
+
/*
|
| 514 |
+
* cacosh(z) = I*cacos(z) or -I*cacos(z)
|
| 515 |
+
* where the sign is chosen so Re(cacosh(z)) >= 0.
|
| 516 |
+
*/
|
| 517 |
+
_CCCL_HOST_DEVICE inline complex<double> cacosh(complex<double> z)
|
| 518 |
+
{
|
| 519 |
+
complex<double> w;
|
| 520 |
+
double rx, ry;
|
| 521 |
+
|
| 522 |
+
w = cacos(z);
|
| 523 |
+
rx = w.real();
|
| 524 |
+
ry = w.imag();
|
| 525 |
+
/* cacosh(NaN + I*NaN) = NaN + I*NaN */
|
| 526 |
+
if (isnan(rx) && isnan(ry))
|
| 527 |
+
{
|
| 528 |
+
return (complex<double>(ry, rx));
|
| 529 |
+
}
|
| 530 |
+
/* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */
|
| 531 |
+
/* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */
|
| 532 |
+
if (isnan(rx))
|
| 533 |
+
{
|
| 534 |
+
return (complex<double>(fabs(ry), rx));
|
| 535 |
+
}
|
| 536 |
+
/* cacosh(0 + I*NaN) = NaN + I*NaN */
|
| 537 |
+
if (isnan(ry))
|
| 538 |
+
{
|
| 539 |
+
return (complex<double>(ry, ry));
|
| 540 |
+
}
|
| 541 |
+
return (complex<double>(fabs(ry), copysign(rx, z.imag())));
|
| 542 |
+
}
|
| 543 |
+
|
| 544 |
+
/*
|
| 545 |
+
* Optimized version of clog() for |z| finite and larger than ~RECIP_EPSILON.
|
| 546 |
+
*/
|
| 547 |
+
_CCCL_HOST_DEVICE inline complex<double> clog_for_large_values(complex<double> z)
|
| 548 |
+
{
|
| 549 |
+
double x, y;
|
| 550 |
+
double ax, ay, t;
|
| 551 |
+
const double m_e = 2.7182818284590452e0; /* 0x15bf0a8b145769.0p-51 */
|
| 552 |
+
|
| 553 |
+
x = z.real();
|
| 554 |
+
y = z.imag();
|
| 555 |
+
ax = fabs(x);
|
| 556 |
+
ay = fabs(y);
|
| 557 |
+
if (ax < ay)
|
| 558 |
+
{
|
| 559 |
+
t = ax;
|
| 560 |
+
ax = ay;
|
| 561 |
+
ay = t;
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
/*
|
| 565 |
+
* Avoid overflow in hypot() when x and y are both very large.
|
| 566 |
+
* Divide x and y by E, and then add 1 to the logarithm. This depends
|
| 567 |
+
* on E being larger than sqrt(2).
|
| 568 |
+
* Dividing by E causes an insignificant loss of accuracy; however
|
| 569 |
+
* this method is still poor since it is unnecessarily slow.
|
| 570 |
+
*/
|
| 571 |
+
if (ax > DBL_MAX / 2)
|
| 572 |
+
{
|
| 573 |
+
return (complex<double>(log(hypot(x / m_e, y / m_e)) + 1, atan2(y, x)));
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
/*
|
| 577 |
+
* Avoid overflow when x or y is large. Avoid underflow when x or
|
| 578 |
+
* y is small.
|
| 579 |
+
*/
|
| 580 |
+
const double QUARTER_SQRT_MAX = 5.966672584960165394632772e-154; /* = 0x1p509; <= sqrt(DBL_MAX) / 4 */
|
| 581 |
+
const double SQRT_MIN = 1.491668146240041348658193e-154; /* = 0x1p-511; >= sqrt(DBL_MIN) */
|
| 582 |
+
if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
|
| 583 |
+
{
|
| 584 |
+
return (complex<double>(log(hypot(x, y)), atan2(y, x)));
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
return (complex<double>(log(ax * ax + ay * ay) / 2, atan2(y, x)));
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
/*
|
| 591 |
+
* =================
|
| 592 |
+
* | catanh, catan |
|
| 593 |
+
* =================
|
| 594 |
+
*/
|
| 595 |
+
|
| 596 |
+
/*
|
| 597 |
+
* sum_squares(x,y) = x*x + y*y (or just x*x if y*y would underflow).
|
| 598 |
+
* Assumes x*x and y*y will not overflow.
|
| 599 |
+
* Assumes x and y are finite.
|
| 600 |
+
* Assumes y is non-negative.
|
| 601 |
+
* Assumes fabs(x) >= DBL_EPSILON.
|
| 602 |
+
*/
|
| 603 |
+
_CCCL_HOST_DEVICE inline double sum_squares(double x, double y)
|
| 604 |
+
{
|
| 605 |
+
const double SQRT_MIN = 1.491668146240041348658193e-154; /* = 0x1p-511; >= sqrt(DBL_MIN) */
|
| 606 |
+
/* Avoid underflow when y is small. */
|
| 607 |
+
if (y < SQRT_MIN)
|
| 608 |
+
{
|
| 609 |
+
return (x * x);
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
return (x * x + y * y);
|
| 613 |
+
}
|
| 614 |
+
|
| 615 |
+
/*
|
| 616 |
+
* real_part_reciprocal(x, y) = Re(1/(x+I*y)) = x/(x*x + y*y).
|
| 617 |
+
* Assumes x and y are not NaN, and one of x and y is larger than
|
| 618 |
+
* RECIP_EPSILON. We avoid unwarranted underflow. It is important to not use
|
| 619 |
+
* the code creal(1/z), because the imaginary part may produce an unwanted
|
| 620 |
+
* underflow.
|
| 621 |
+
* This is only called in a context where inexact is always raised before
|
| 622 |
+
* the call, so no effort is made to avoid or force inexact.
|
| 623 |
+
*/
|
| 624 |
+
_CCCL_HOST_DEVICE inline double real_part_reciprocal(double x, double y)
|
| 625 |
+
{
|
| 626 |
+
double scale;
|
| 627 |
+
uint32_t hx, hy;
|
| 628 |
+
int32_t ix, iy;
|
| 629 |
+
|
| 630 |
+
/*
|
| 631 |
+
* This code is inspired by the C99 document n1124.pdf, Section G.5.1,
|
| 632 |
+
* example 2.
|
| 633 |
+
*/
|
| 634 |
+
get_high_word(hx, x);
|
| 635 |
+
ix = hx & 0x7ff00000;
|
| 636 |
+
get_high_word(hy, y);
|
| 637 |
+
iy = hy & 0x7ff00000;
|
| 638 |
+
// #define BIAS (DBL_MAX_EXP - 1)
|
| 639 |
+
const int BIAS = DBL_MAX_EXP - 1;
|
| 640 |
+
/* XXX more guard digits are useful iff there is extra precision. */
|
| 641 |
+
// #define CUTOFF (DBL_MANT_DIG / 2 + 1) /* just half or 1 guard digit */
|
| 642 |
+
const int CUTOFF = (DBL_MANT_DIG / 2 + 1);
|
| 643 |
+
if (ix - iy >= CUTOFF << 20 || isinf(x))
|
| 644 |
+
{
|
| 645 |
+
return (1 / x); /* +-Inf -> +-0 is special */
|
| 646 |
+
}
|
| 647 |
+
if (iy - ix >= CUTOFF << 20)
|
| 648 |
+
{
|
| 649 |
+
return (x / y / y); /* should avoid double div, but hard */
|
| 650 |
+
}
|
| 651 |
+
if (ix <= (BIAS + DBL_MAX_EXP / 2 - CUTOFF) << 20)
|
| 652 |
+
{
|
| 653 |
+
return (x / (x * x + y * y));
|
| 654 |
+
}
|
| 655 |
+
scale = 1;
|
| 656 |
+
set_high_word(scale, 0x7ff00000 - ix); /* 2**(1-ilogb(x)) */
|
| 657 |
+
x *= scale;
|
| 658 |
+
y *= scale;
|
| 659 |
+
return (x / (x * x + y * y) * scale);
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
/*
|
| 663 |
+
* catanh(z) = log((1+z)/(1-z)) / 2
|
| 664 |
+
* = log1p(4*x / |z-1|^2) / 4
|
| 665 |
+
* + I * atan2(2*y, (1-x)*(1+x)-y*y) / 2
|
| 666 |
+
*
|
| 667 |
+
* catanh(z) = z + O(z^3) as z -> 0
|
| 668 |
+
*
|
| 669 |
+
* catanh(z) = 1/z + sign(y)*I*PI/2 + O(1/z^3) as z -> infinity
|
| 670 |
+
* The above formula works for the real part as well, because
|
| 671 |
+
* Re(catanh(z)) = x/|z|^2 + O(x/z^4)
|
| 672 |
+
* as z -> infinity, uniformly in x
|
| 673 |
+
*/
|
| 674 |
+
_CCCL_HOST_DEVICE inline complex<double> catanh(complex<double> z)
|
| 675 |
+
{
|
| 676 |
+
double x, y, ax, ay, rx, ry;
|
| 677 |
+
const volatile double pio2_lo = 6.1232339957367659e-17; /* 0x11a62633145c07.0p-106 */
|
| 678 |
+
const double pio2_hi = 1.5707963267948966e0; /* 0x1921fb54442d18.0p-52 */
|
| 679 |
+
|
| 680 |
+
x = z.real();
|
| 681 |
+
y = z.imag();
|
| 682 |
+
ax = fabs(x);
|
| 683 |
+
ay = fabs(y);
|
| 684 |
+
|
| 685 |
+
/* This helps handle many cases. */
|
| 686 |
+
if (y == 0 && ax <= 1)
|
| 687 |
+
{
|
| 688 |
+
return (complex<double>(atanh(x), y));
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
/* To ensure the same accuracy as atan(), and to filter out z = 0. */
|
| 692 |
+
if (x == 0)
|
| 693 |
+
{
|
| 694 |
+
return (complex<double>(x, atan(y)));
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
if (isnan(x) || isnan(y))
|
| 698 |
+
{
|
| 699 |
+
/* catanh(+-Inf + I*NaN) = +-0 + I*NaN */
|
| 700 |
+
if (isinf(x))
|
| 701 |
+
{
|
| 702 |
+
return (complex<double>(copysign(0.0, x), y + y));
|
| 703 |
+
}
|
| 704 |
+
/* catanh(NaN + I*+-Inf) = sign(NaN)0 + I*+-PI/2 */
|
| 705 |
+
if (isinf(y))
|
| 706 |
+
{
|
| 707 |
+
return (complex<double>(copysign(0.0, x), copysign(pio2_hi + pio2_lo, y)));
|
| 708 |
+
}
|
| 709 |
+
/*
|
| 710 |
+
* All other cases involving NaN return NaN + I*NaN.
|
| 711 |
+
* C99 leaves it optional whether to raise invalid if one of
|
| 712 |
+
* the arguments is not NaN, so we opt not to raise it.
|
| 713 |
+
*/
|
| 714 |
+
return (complex<double>(x + 0.0 + (y + 0), x + 0.0 + (y + 0)));
|
| 715 |
+
}
|
| 716 |
+
|
| 717 |
+
const double RECIP_EPSILON = 1.0 / DBL_EPSILON;
|
| 718 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 719 |
+
{
|
| 720 |
+
return (complex<double>(real_part_reciprocal(x, y), copysign(pio2_hi + pio2_lo, y)));
|
| 721 |
+
}
|
| 722 |
+
|
| 723 |
+
const double SQRT_3_EPSILON = 2.5809568279517849e-8; /* 0x1bb67ae8584caa.0p-78 */
|
| 724 |
+
if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2)
|
| 725 |
+
{
|
| 726 |
+
/*
|
| 727 |
+
* z = 0 was filtered out above. All other cases must raise
|
| 728 |
+
* inexact, but this is the only only that needs to do it
|
| 729 |
+
* explicitly.
|
| 730 |
+
*/
|
| 731 |
+
raise_inexact();
|
| 732 |
+
return (z);
|
| 733 |
+
}
|
| 734 |
+
|
| 735 |
+
const double m_ln2 = 6.9314718055994531e-1; /* 0x162e42fefa39ef.0p-53 */
|
| 736 |
+
if (ax == 1 && ay < DBL_EPSILON)
|
| 737 |
+
{
|
| 738 |
+
rx = (m_ln2 - log(ay)) / 2;
|
| 739 |
+
}
|
| 740 |
+
else
|
| 741 |
+
{
|
| 742 |
+
rx = log1p(4 * ax / sum_squares(ax - 1, ay)) / 4;
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
if (ax == 1)
|
| 746 |
+
{
|
| 747 |
+
ry = atan2(2.0, -ay) / 2;
|
| 748 |
+
}
|
| 749 |
+
else if (ay < DBL_EPSILON)
|
| 750 |
+
{
|
| 751 |
+
ry = atan2(2 * ay, (1 - ax) * (1 + ax)) / 2;
|
| 752 |
+
}
|
| 753 |
+
else
|
| 754 |
+
{
|
| 755 |
+
ry = atan2(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
return (complex<double>(copysign(rx, x), copysign(ry, y)));
|
| 759 |
+
}
|
| 760 |
+
|
| 761 |
+
/*
|
| 762 |
+
* catan(z) = reverse(catanh(reverse(z)))
|
| 763 |
+
* where reverse(x + I*y) = y + I*x = I*conj(z).
|
| 764 |
+
*/
|
| 765 |
+
_CCCL_HOST_DEVICE inline complex<double> catan(complex<double> z)
|
| 766 |
+
{
|
| 767 |
+
complex<double> w = catanh(complex<double>(z.imag(), z.real()));
|
| 768 |
+
return (complex<double>(w.imag(), w.real()));
|
| 769 |
+
}
|
| 770 |
+
|
| 771 |
+
} // namespace complex
|
| 772 |
+
|
| 773 |
+
} // namespace detail
|
| 774 |
+
|
| 775 |
+
template <typename ValueType>
|
| 776 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> acos(const complex<ValueType>& z)
|
| 777 |
+
{
|
| 778 |
+
const complex<ValueType> ret = thrust::asin(z);
|
| 779 |
+
const ValueType pi = ValueType(3.14159265358979323846);
|
| 780 |
+
return complex<ValueType>(pi / 2 - ret.real(), -ret.imag());
|
| 781 |
+
}
|
| 782 |
+
|
| 783 |
+
template <typename ValueType>
|
| 784 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> asin(const complex<ValueType>& z)
|
| 785 |
+
{
|
| 786 |
+
const complex<ValueType> i(0, 1);
|
| 787 |
+
return -i * asinh(i * z);
|
| 788 |
+
}
|
| 789 |
+
|
| 790 |
+
template <typename ValueType>
|
| 791 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> atan(const complex<ValueType>& z)
|
| 792 |
+
{
|
| 793 |
+
const complex<ValueType> i(0, 1);
|
| 794 |
+
return -i * thrust::atanh(i * z);
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
template <typename ValueType>
|
| 798 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> acosh(const complex<ValueType>& z)
|
| 799 |
+
{
|
| 800 |
+
thrust::complex<ValueType> ret(
|
| 801 |
+
(z.real() - z.imag()) * (z.real() + z.imag()) - ValueType(1.0), ValueType(2.0) * z.real() * z.imag());
|
| 802 |
+
ret = thrust::sqrt(ret);
|
| 803 |
+
if (z.real() < ValueType(0.0))
|
| 804 |
+
{
|
| 805 |
+
ret = -ret;
|
| 806 |
+
}
|
| 807 |
+
ret += z;
|
| 808 |
+
ret = thrust::log(ret);
|
| 809 |
+
if (ret.real() < ValueType(0.0))
|
| 810 |
+
{
|
| 811 |
+
ret = -ret;
|
| 812 |
+
}
|
| 813 |
+
return ret;
|
| 814 |
+
}
|
| 815 |
+
|
| 816 |
+
template <typename ValueType>
|
| 817 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> asinh(const complex<ValueType>& z)
|
| 818 |
+
{
|
| 819 |
+
return thrust::log(thrust::sqrt(z * z + ValueType(1)) + z);
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
template <typename ValueType>
|
| 823 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> atanh(const complex<ValueType>& z)
|
| 824 |
+
{
|
| 825 |
+
ValueType imag2 = z.imag() * z.imag();
|
| 826 |
+
ValueType n = ValueType(1.0) + z.real();
|
| 827 |
+
n = imag2 + n * n;
|
| 828 |
+
|
| 829 |
+
ValueType d = ValueType(1.0) - z.real();
|
| 830 |
+
d = imag2 + d * d;
|
| 831 |
+
complex<ValueType> ret(ValueType(0.25) * (std::log(n) - std::log(d)), 0);
|
| 832 |
+
|
| 833 |
+
d = ValueType(1.0) - z.real() * z.real() - imag2;
|
| 834 |
+
|
| 835 |
+
ret.imag(ValueType(0.5) * std::atan2(ValueType(2.0) * z.imag(), d));
|
| 836 |
+
return ret;
|
| 837 |
+
}
|
| 838 |
+
|
| 839 |
+
template <>
|
| 840 |
+
_CCCL_HOST_DEVICE inline complex<double> acos(const complex<double>& z)
|
| 841 |
+
{
|
| 842 |
+
return detail::complex::cacos(z);
|
| 843 |
+
}
|
| 844 |
+
|
| 845 |
+
template <>
|
| 846 |
+
_CCCL_HOST_DEVICE inline complex<double> asin(const complex<double>& z)
|
| 847 |
+
{
|
| 848 |
+
return detail::complex::casin(z);
|
| 849 |
+
}
|
| 850 |
+
|
| 851 |
+
template <>
|
| 852 |
+
_CCCL_HOST_DEVICE inline complex<double> atan(const complex<double>& z)
|
| 853 |
+
{
|
| 854 |
+
return detail::complex::catan(z);
|
| 855 |
+
}
|
| 856 |
+
|
| 857 |
+
template <>
|
| 858 |
+
_CCCL_HOST_DEVICE inline complex<double> acosh(const complex<double>& z)
|
| 859 |
+
{
|
| 860 |
+
return detail::complex::cacosh(z);
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
template <>
|
| 864 |
+
_CCCL_HOST_DEVICE inline complex<double> asinh(const complex<double>& z)
|
| 865 |
+
{
|
| 866 |
+
return detail::complex::casinh(z);
|
| 867 |
+
}
|
| 868 |
+
|
| 869 |
+
template <>
|
| 870 |
+
_CCCL_HOST_DEVICE inline complex<double> atanh(const complex<double>& z)
|
| 871 |
+
{
|
| 872 |
+
return detail::complex::catanh(z);
|
| 873 |
+
}
|
| 874 |
+
|
| 875 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/catrigf.h
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia <filipe.c.maia@gmail.com>:
|
| 46 |
+
* freebsd/lib/msun/src/catrig.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#pragma once
|
| 50 |
+
|
| 51 |
+
#include <thrust/detail/config.h>
|
| 52 |
+
|
| 53 |
+
#include <thrust/complex.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
#include <cfloat>
|
| 57 |
+
#include <cmath>
|
| 58 |
+
|
| 59 |
+
THRUST_NAMESPACE_BEGIN
|
| 60 |
+
namespace detail
|
| 61 |
+
{
|
| 62 |
+
namespace complex
|
| 63 |
+
{
|
| 64 |
+
|
| 65 |
+
using thrust::complex;
|
| 66 |
+
|
| 67 |
+
_CCCL_HOST_DEVICE inline complex<float> clog_for_large_values(complex<float> z);
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
+
* The algorithm is very close to that in "Implementing the complex arcsine
|
| 71 |
+
* and arccosine functions using exception handling" by T. E. Hull, Thomas F.
|
| 72 |
+
* Fairgrieve, and Ping Tak Peter Tang, published in ACM Transactions on
|
| 73 |
+
* Mathematical Software, Volume 23 Issue 3, 1997, Pages 299-335,
|
| 74 |
+
* http://dl.acm.org/citation.cfm?id=275324.
|
| 75 |
+
*
|
| 76 |
+
* See catrig.c for complete comments.
|
| 77 |
+
*
|
| 78 |
+
* XXX comments were removed automatically, and even short ones on the right
|
| 79 |
+
* of statements were removed (all of them), contrary to normal style. Only
|
| 80 |
+
* a few comments on the right of declarations remain.
|
| 81 |
+
*/
|
| 82 |
+
|
| 83 |
+
_CCCL_HOST_DEVICE inline float f(float a, float b, float hypot_a_b)
|
| 84 |
+
{
|
| 85 |
+
if (b < 0.0f)
|
| 86 |
+
{
|
| 87 |
+
return ((hypot_a_b - b) / 2.0f);
|
| 88 |
+
}
|
| 89 |
+
if (b == 0.0f)
|
| 90 |
+
{
|
| 91 |
+
return (a / 2.0f);
|
| 92 |
+
}
|
| 93 |
+
return (a * a / (hypot_a_b + b) / 2.0f);
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
/*
|
| 97 |
+
* All the hard work is contained in this function.
|
| 98 |
+
* x and y are assumed positive or zero, and less than RECIP_EPSILON.
|
| 99 |
+
* Upon return:
|
| 100 |
+
* rx = Re(casinh(z)) = -Im(cacos(y + I*x)).
|
| 101 |
+
* B_is_usable is set to 1 if the value of B is usable.
|
| 102 |
+
* If B_is_usable is set to 0, sqrt_A2my2 = sqrt(A*A - y*y), and new_y = y.
|
| 103 |
+
* If returning sqrt_A2my2 has potential to result in an underflow, it is
|
| 104 |
+
* rescaled, and new_y is similarly rescaled.
|
| 105 |
+
*/
|
| 106 |
+
_CCCL_HOST_DEVICE inline void
|
| 107 |
+
do_hard_work(float x, float y, float* rx, int* B_is_usable, float* B, float* sqrt_A2my2, float* new_y)
|
| 108 |
+
{
|
| 109 |
+
float R, S, A; /* A, B, R, and S are as in Hull et al. */
|
| 110 |
+
float Am1, Amy; /* A-1, A-y. */
|
| 111 |
+
const float A_crossover = 10; /* Hull et al suggest 1.5, but 10 works better */
|
| 112 |
+
const float FOUR_SQRT_MIN = 4.336808689942017736029811e-19f;
|
| 113 |
+
; /* =0x1p-61; >= 4 * sqrt(FLT_MIN) */
|
| 114 |
+
const float B_crossover = 0.6417f; /* suggested by Hull et al */
|
| 115 |
+
R = hypotf(x, y + 1);
|
| 116 |
+
S = hypotf(x, y - 1);
|
| 117 |
+
|
| 118 |
+
A = (R + S) / 2;
|
| 119 |
+
if (A < 1)
|
| 120 |
+
{
|
| 121 |
+
A = 1;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
if (A < A_crossover)
|
| 125 |
+
{
|
| 126 |
+
if (y == 1 && x < FLT_EPSILON * FLT_EPSILON / 128)
|
| 127 |
+
{
|
| 128 |
+
*rx = sqrtf(x);
|
| 129 |
+
}
|
| 130 |
+
else if (x >= FLT_EPSILON * fabsf(y - 1))
|
| 131 |
+
{
|
| 132 |
+
Am1 = f(x, 1 + y, R) + f(x, 1 - y, S);
|
| 133 |
+
*rx = log1pf(Am1 + sqrtf(Am1 * (A + 1)));
|
| 134 |
+
}
|
| 135 |
+
else if (y < 1)
|
| 136 |
+
{
|
| 137 |
+
*rx = x / sqrtf((1 - y) * (1 + y));
|
| 138 |
+
}
|
| 139 |
+
else
|
| 140 |
+
{
|
| 141 |
+
*rx = log1pf((y - 1) + sqrtf((y - 1) * (y + 1)));
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
else
|
| 145 |
+
{
|
| 146 |
+
*rx = logf(A + sqrtf(A * A - 1));
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
*new_y = y;
|
| 150 |
+
|
| 151 |
+
if (y < FOUR_SQRT_MIN)
|
| 152 |
+
{
|
| 153 |
+
*B_is_usable = 0;
|
| 154 |
+
*sqrt_A2my2 = A * (2 / FLT_EPSILON);
|
| 155 |
+
*new_y = y * (2 / FLT_EPSILON);
|
| 156 |
+
return;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
*B = y / A;
|
| 160 |
+
*B_is_usable = 1;
|
| 161 |
+
|
| 162 |
+
if (*B > B_crossover)
|
| 163 |
+
{
|
| 164 |
+
*B_is_usable = 0;
|
| 165 |
+
if (y == 1 && x < FLT_EPSILON / 128)
|
| 166 |
+
{
|
| 167 |
+
*sqrt_A2my2 = sqrtf(x) * sqrtf((A + y) / 2);
|
| 168 |
+
}
|
| 169 |
+
else if (x >= FLT_EPSILON * fabsf(y - 1))
|
| 170 |
+
{
|
| 171 |
+
Amy = f(x, y + 1, R) + f(x, y - 1, S);
|
| 172 |
+
*sqrt_A2my2 = sqrtf(Amy * (A + y));
|
| 173 |
+
}
|
| 174 |
+
else if (y > 1)
|
| 175 |
+
{
|
| 176 |
+
*sqrt_A2my2 = x * (4 / FLT_EPSILON / FLT_EPSILON) * y / sqrtf((y + 1) * (y - 1));
|
| 177 |
+
*new_y = y * (4 / FLT_EPSILON / FLT_EPSILON);
|
| 178 |
+
}
|
| 179 |
+
else
|
| 180 |
+
{
|
| 181 |
+
*sqrt_A2my2 = sqrtf((1 - y) * (1 + y));
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
_CCCL_HOST_DEVICE inline complex<float> casinhf(complex<float> z)
|
| 187 |
+
{
|
| 188 |
+
float x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
|
| 189 |
+
int B_is_usable;
|
| 190 |
+
complex<float> w;
|
| 191 |
+
const float RECIP_EPSILON = 1.0f / FLT_EPSILON;
|
| 192 |
+
const float m_ln2 = 6.9314718055994531e-1f; /* 0x162e42fefa39ef.0p-53 */
|
| 193 |
+
x = z.real();
|
| 194 |
+
y = z.imag();
|
| 195 |
+
ax = fabsf(x);
|
| 196 |
+
ay = fabsf(y);
|
| 197 |
+
|
| 198 |
+
if (isnan(x) || isnan(y))
|
| 199 |
+
{
|
| 200 |
+
if (isinf(x))
|
| 201 |
+
{
|
| 202 |
+
return (complex<float>(x, y + y));
|
| 203 |
+
}
|
| 204 |
+
if (isinf(y))
|
| 205 |
+
{
|
| 206 |
+
return (complex<float>(y, x + x));
|
| 207 |
+
}
|
| 208 |
+
if (y == 0)
|
| 209 |
+
{
|
| 210 |
+
return (complex<float>(x + x, y));
|
| 211 |
+
}
|
| 212 |
+
return (complex<float>(x + 0.0f + (y + 0), x + 0.0f + (y + 0)));
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 216 |
+
{
|
| 217 |
+
if (signbit(x) == 0)
|
| 218 |
+
{
|
| 219 |
+
w = clog_for_large_values(z) + m_ln2;
|
| 220 |
+
}
|
| 221 |
+
else
|
| 222 |
+
{
|
| 223 |
+
w = clog_for_large_values(-z) + m_ln2;
|
| 224 |
+
}
|
| 225 |
+
return (complex<float>(copysignf(w.real(), x), copysignf(w.imag(), y)));
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
if (x == 0 && y == 0)
|
| 229 |
+
{
|
| 230 |
+
return (z);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
raise_inexact();
|
| 234 |
+
|
| 235 |
+
const float SQRT_6_EPSILON = 8.4572793338e-4f; /* 0xddb3d7.0p-34 */
|
| 236 |
+
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
|
| 237 |
+
{
|
| 238 |
+
return (z);
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
|
| 242 |
+
if (B_is_usable)
|
| 243 |
+
{
|
| 244 |
+
ry = asinf(B);
|
| 245 |
+
}
|
| 246 |
+
else
|
| 247 |
+
{
|
| 248 |
+
ry = atan2f(new_y, sqrt_A2my2);
|
| 249 |
+
}
|
| 250 |
+
return (complex<float>(copysignf(rx, x), copysignf(ry, y)));
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
_CCCL_HOST_DEVICE inline complex<float> casinf(complex<float> z)
|
| 254 |
+
{
|
| 255 |
+
complex<float> w = casinhf(complex<float>(z.imag(), z.real()));
|
| 256 |
+
|
| 257 |
+
return (complex<float>(w.imag(), w.real()));
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
_CCCL_HOST_DEVICE inline complex<float> cacosf(complex<float> z)
|
| 261 |
+
{
|
| 262 |
+
float x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
|
| 263 |
+
int sx, sy;
|
| 264 |
+
int B_is_usable;
|
| 265 |
+
complex<float> w;
|
| 266 |
+
const float pio2_hi = 1.5707963267948966e0f; /* 0x1921fb54442d18.0p-52 */
|
| 267 |
+
const volatile float pio2_lo = 6.1232339957367659e-17f; /* 0x11a62633145c07.0p-106 */
|
| 268 |
+
const float m_ln2 = 6.9314718055994531e-1f; /* 0x162e42fefa39ef.0p-53 */
|
| 269 |
+
|
| 270 |
+
x = z.real();
|
| 271 |
+
y = z.imag();
|
| 272 |
+
sx = signbit(x);
|
| 273 |
+
sy = signbit(y);
|
| 274 |
+
ax = fabsf(x);
|
| 275 |
+
ay = fabsf(y);
|
| 276 |
+
|
| 277 |
+
if (isnan(x) || isnan(y))
|
| 278 |
+
{
|
| 279 |
+
if (isinf(x))
|
| 280 |
+
{
|
| 281 |
+
return (complex<float>(y + y, -infinity<float>()));
|
| 282 |
+
}
|
| 283 |
+
if (isinf(y))
|
| 284 |
+
{
|
| 285 |
+
return (complex<float>(x + x, -y));
|
| 286 |
+
}
|
| 287 |
+
if (x == 0)
|
| 288 |
+
{
|
| 289 |
+
return (complex<float>(pio2_hi + pio2_lo, y + y));
|
| 290 |
+
}
|
| 291 |
+
return (complex<float>(x + 0.0f + (y + 0), x + 0.0f + (y + 0)));
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
const float RECIP_EPSILON = 1.0f / FLT_EPSILON;
|
| 295 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 296 |
+
{
|
| 297 |
+
w = clog_for_large_values(z);
|
| 298 |
+
rx = fabsf(w.imag());
|
| 299 |
+
ry = w.real() + m_ln2;
|
| 300 |
+
if (sy == 0)
|
| 301 |
+
{
|
| 302 |
+
ry = -ry;
|
| 303 |
+
}
|
| 304 |
+
return (complex<float>(rx, ry));
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
if (x == 1 && y == 0)
|
| 308 |
+
{
|
| 309 |
+
return (complex<float>(0, -y));
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
raise_inexact();
|
| 313 |
+
|
| 314 |
+
const float SQRT_6_EPSILON = 8.4572793338e-4f; /* 0xddb3d7.0p-34 */
|
| 315 |
+
if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
|
| 316 |
+
{
|
| 317 |
+
return (complex<float>(pio2_hi - (x - pio2_lo), -y));
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
|
| 321 |
+
if (B_is_usable)
|
| 322 |
+
{
|
| 323 |
+
if (sx == 0)
|
| 324 |
+
{
|
| 325 |
+
rx = acosf(B);
|
| 326 |
+
}
|
| 327 |
+
else
|
| 328 |
+
{
|
| 329 |
+
rx = acosf(-B);
|
| 330 |
+
}
|
| 331 |
+
}
|
| 332 |
+
else
|
| 333 |
+
{
|
| 334 |
+
if (sx == 0)
|
| 335 |
+
{
|
| 336 |
+
rx = atan2f(sqrt_A2mx2, new_x);
|
| 337 |
+
}
|
| 338 |
+
else
|
| 339 |
+
{
|
| 340 |
+
rx = atan2f(sqrt_A2mx2, -new_x);
|
| 341 |
+
}
|
| 342 |
+
}
|
| 343 |
+
if (sy == 0)
|
| 344 |
+
{
|
| 345 |
+
ry = -ry;
|
| 346 |
+
}
|
| 347 |
+
return (complex<float>(rx, ry));
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
_CCCL_HOST_DEVICE inline complex<float> cacoshf(complex<float> z)
|
| 351 |
+
{
|
| 352 |
+
complex<float> w;
|
| 353 |
+
float rx, ry;
|
| 354 |
+
|
| 355 |
+
w = cacosf(z);
|
| 356 |
+
rx = w.real();
|
| 357 |
+
ry = w.imag();
|
| 358 |
+
/* cacosh(NaN + I*NaN) = NaN + I*NaN */
|
| 359 |
+
if (isnan(rx) && isnan(ry))
|
| 360 |
+
{
|
| 361 |
+
return (complex<float>(ry, rx));
|
| 362 |
+
}
|
| 363 |
+
/* cacosh(NaN + I*+-Inf) = +Inf + I*NaN */
|
| 364 |
+
/* cacosh(+-Inf + I*NaN) = +Inf + I*NaN */
|
| 365 |
+
if (isnan(rx))
|
| 366 |
+
{
|
| 367 |
+
return (complex<float>(fabsf(ry), rx));
|
| 368 |
+
}
|
| 369 |
+
/* cacosh(0 + I*NaN) = NaN + I*NaN */
|
| 370 |
+
if (isnan(ry))
|
| 371 |
+
{
|
| 372 |
+
return (complex<float>(ry, ry));
|
| 373 |
+
}
|
| 374 |
+
return (complex<float>(fabsf(ry), copysignf(rx, z.imag())));
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
/*
|
| 378 |
+
* Optimized version of clog() for |z| finite and larger than ~RECIP_EPSILON.
|
| 379 |
+
*/
|
| 380 |
+
_CCCL_HOST_DEVICE inline complex<float> clog_for_large_values(complex<float> z)
|
| 381 |
+
{
|
| 382 |
+
float x, y;
|
| 383 |
+
float ax, ay, t;
|
| 384 |
+
const float m_e = 2.7182818284590452e0f; /* 0x15bf0a8b145769.0p-51 */
|
| 385 |
+
|
| 386 |
+
x = z.real();
|
| 387 |
+
y = z.imag();
|
| 388 |
+
ax = fabsf(x);
|
| 389 |
+
ay = fabsf(y);
|
| 390 |
+
if (ax < ay)
|
| 391 |
+
{
|
| 392 |
+
t = ax;
|
| 393 |
+
ax = ay;
|
| 394 |
+
ay = t;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
if (ax > FLT_MAX / 2)
|
| 398 |
+
{
|
| 399 |
+
return (complex<float>(logf(hypotf(x / m_e, y / m_e)) + 1, atan2f(y, x)));
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
const float QUARTER_SQRT_MAX = 2.3058430092136939520000000e+18f; /* = 0x1p61; <= sqrt(FLT_MAX) / 4 */
|
| 403 |
+
const float SQRT_MIN = 1.084202172485504434007453e-19f; /* 0x1p-63; >= sqrt(FLT_MIN) */
|
| 404 |
+
if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
|
| 405 |
+
{
|
| 406 |
+
return (complex<float>(logf(hypotf(x, y)), atan2f(y, x)));
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
return (complex<float>(logf(ax * ax + ay * ay) / 2, atan2f(y, x)));
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
/*
|
| 413 |
+
* =================
|
| 414 |
+
* | catanh, catan |
|
| 415 |
+
* =================
|
| 416 |
+
*/
|
| 417 |
+
|
| 418 |
+
/*
|
| 419 |
+
* sum_squares(x,y) = x*x + y*y (or just x*x if y*y would underflow).
|
| 420 |
+
* Assumes x*x and y*y will not overflow.
|
| 421 |
+
* Assumes x and y are finite.
|
| 422 |
+
* Assumes y is non-negative.
|
| 423 |
+
* Assumes fabsf(x) >= FLT_EPSILON.
|
| 424 |
+
*/
|
| 425 |
+
_CCCL_HOST_DEVICE inline float sum_squares(float x, float y)
|
| 426 |
+
{
|
| 427 |
+
const float SQRT_MIN = 1.084202172485504434007453e-19f; /* 0x1p-63; >= sqrt(FLT_MIN) */
|
| 428 |
+
/* Avoid underflow when y is small. */
|
| 429 |
+
if (y < SQRT_MIN)
|
| 430 |
+
{
|
| 431 |
+
return (x * x);
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
return (x * x + y * y);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
_CCCL_HOST_DEVICE inline float real_part_reciprocal(float x, float y)
|
| 438 |
+
{
|
| 439 |
+
float scale;
|
| 440 |
+
uint32_t hx, hy;
|
| 441 |
+
int32_t ix, iy;
|
| 442 |
+
|
| 443 |
+
get_float_word(hx, x);
|
| 444 |
+
ix = hx & 0x7f800000;
|
| 445 |
+
get_float_word(hy, y);
|
| 446 |
+
iy = hy & 0x7f800000;
|
| 447 |
+
// #define BIAS (FLT_MAX_EXP - 1)
|
| 448 |
+
const int BIAS = FLT_MAX_EXP - 1;
|
| 449 |
+
// #define CUTOFF (FLT_MANT_DIG / 2 + 1)
|
| 450 |
+
const int CUTOFF = (FLT_MANT_DIG / 2 + 1);
|
| 451 |
+
if (ix - iy >= CUTOFF << 23 || isinf(x))
|
| 452 |
+
{
|
| 453 |
+
return (1 / x);
|
| 454 |
+
}
|
| 455 |
+
if (iy - ix >= CUTOFF << 23)
|
| 456 |
+
{
|
| 457 |
+
return (x / y / y);
|
| 458 |
+
}
|
| 459 |
+
if (ix <= (BIAS + FLT_MAX_EXP / 2 - CUTOFF) << 23)
|
| 460 |
+
{
|
| 461 |
+
return (x / (x * x + y * y));
|
| 462 |
+
}
|
| 463 |
+
set_float_word(scale, 0x7f800000 - ix);
|
| 464 |
+
x *= scale;
|
| 465 |
+
y *= scale;
|
| 466 |
+
return (x / (x * x + y * y) * scale);
|
| 467 |
+
}
|
| 468 |
+
|
| 469 |
+
_CCCL_HOST_DEVICE inline complex<float> catanhf(complex<float> z)
|
| 470 |
+
{
|
| 471 |
+
float x, y, ax, ay, rx, ry;
|
| 472 |
+
const volatile float pio2_lo = 6.1232339957367659e-17f; /* 0x11a62633145c07.0p-106 */
|
| 473 |
+
const float pio2_hi = 1.5707963267948966e0f; /* 0x1921fb54442d18.0p-52 */
|
| 474 |
+
|
| 475 |
+
x = z.real();
|
| 476 |
+
y = z.imag();
|
| 477 |
+
ax = fabsf(x);
|
| 478 |
+
ay = fabsf(y);
|
| 479 |
+
|
| 480 |
+
if (y == 0 && ax <= 1)
|
| 481 |
+
{
|
| 482 |
+
return (complex<float>(atanhf(x), y));
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
if (x == 0)
|
| 486 |
+
{
|
| 487 |
+
return (complex<float>(x, atanf(y)));
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
if (isnan(x) || isnan(y))
|
| 491 |
+
{
|
| 492 |
+
if (isinf(x))
|
| 493 |
+
{
|
| 494 |
+
return (complex<float>(copysignf(0, x), y + y));
|
| 495 |
+
}
|
| 496 |
+
if (isinf(y))
|
| 497 |
+
{
|
| 498 |
+
return (complex<float>(copysignf(0, x), copysignf(pio2_hi + pio2_lo, y)));
|
| 499 |
+
}
|
| 500 |
+
return (complex<float>(x + 0.0f + (y + 0.0f), x + 0.0f + (y + 0.0f)));
|
| 501 |
+
}
|
| 502 |
+
|
| 503 |
+
const float RECIP_EPSILON = 1.0f / FLT_EPSILON;
|
| 504 |
+
if (ax > RECIP_EPSILON || ay > RECIP_EPSILON)
|
| 505 |
+
{
|
| 506 |
+
return (complex<float>(real_part_reciprocal(x, y), copysignf(pio2_hi + pio2_lo, y)));
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
const float SQRT_3_EPSILON = 5.9801995673e-4f; /* 0x9cc471.0p-34 */
|
| 510 |
+
if (ax < SQRT_3_EPSILON / 2 && ay < SQRT_3_EPSILON / 2)
|
| 511 |
+
{
|
| 512 |
+
raise_inexact();
|
| 513 |
+
return (z);
|
| 514 |
+
}
|
| 515 |
+
|
| 516 |
+
const float m_ln2 = 6.9314718056e-1f; /* 0xb17218.0p-24 */
|
| 517 |
+
if (ax == 1 && ay < FLT_EPSILON)
|
| 518 |
+
{
|
| 519 |
+
rx = (m_ln2 - logf(ay)) / 2;
|
| 520 |
+
}
|
| 521 |
+
else
|
| 522 |
+
{
|
| 523 |
+
rx = log1pf(4 * ax / sum_squares(ax - 1, ay)) / 4;
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
if (ax == 1)
|
| 527 |
+
{
|
| 528 |
+
ry = atan2f(2, -ay) / 2;
|
| 529 |
+
}
|
| 530 |
+
else if (ay < FLT_EPSILON)
|
| 531 |
+
{
|
| 532 |
+
ry = atan2f(2 * ay, (1 - ax) * (1 + ax)) / 2;
|
| 533 |
+
}
|
| 534 |
+
else
|
| 535 |
+
{
|
| 536 |
+
ry = atan2f(2 * ay, (1 - ax) * (1 + ax) - ay * ay) / 2;
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
return (complex<float>(copysignf(rx, x), copysignf(ry, y)));
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
_CCCL_HOST_DEVICE inline complex<float> catanf(complex<float> z)
|
| 543 |
+
{
|
| 544 |
+
complex<float> w = catanhf(complex<float>(z.imag(), z.real()));
|
| 545 |
+
return (complex<float>(w.imag(), w.real()));
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
} // namespace complex
|
| 549 |
+
|
| 550 |
+
} // namespace detail
|
| 551 |
+
|
| 552 |
+
template <>
|
| 553 |
+
_CCCL_HOST_DEVICE inline complex<float> acos(const complex<float>& z)
|
| 554 |
+
{
|
| 555 |
+
return detail::complex::cacosf(z);
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
template <>
|
| 559 |
+
_CCCL_HOST_DEVICE inline complex<float> asin(const complex<float>& z)
|
| 560 |
+
{
|
| 561 |
+
return detail::complex::casinf(z);
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
template <>
|
| 565 |
+
_CCCL_HOST_DEVICE inline complex<float> atan(const complex<float>& z)
|
| 566 |
+
{
|
| 567 |
+
return detail::complex::catanf(z);
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
template <>
|
| 571 |
+
_CCCL_HOST_DEVICE inline complex<float> acosh(const complex<float>& z)
|
| 572 |
+
{
|
| 573 |
+
return detail::complex::cacoshf(z);
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
template <>
|
| 577 |
+
_CCCL_HOST_DEVICE inline complex<float> asinh(const complex<float>& z)
|
| 578 |
+
{
|
| 579 |
+
return detail::complex::casinhf(z);
|
| 580 |
+
}
|
| 581 |
+
|
| 582 |
+
template <>
|
| 583 |
+
_CCCL_HOST_DEVICE inline complex<float> atanh(const complex<float>& z)
|
| 584 |
+
{
|
| 585 |
+
return detail::complex::catanhf(z);
|
| 586 |
+
}
|
| 587 |
+
|
| 588 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ccosh.h
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_ccosh.c
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#pragma once
|
| 49 |
+
|
| 50 |
+
#include <thrust/detail/config.h>
|
| 51 |
+
|
| 52 |
+
#include <thrust/complex.h>
|
| 53 |
+
#include <thrust/detail/complex/cexp.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
THRUST_NAMESPACE_BEGIN
|
| 57 |
+
namespace detail
|
| 58 |
+
{
|
| 59 |
+
namespace complex
|
| 60 |
+
{
|
| 61 |
+
|
| 62 |
+
/*
|
| 63 |
+
* Hyperbolic cosine of a complex argument z = x + i y.
|
| 64 |
+
*
|
| 65 |
+
* cosh(z) = cosh(x+iy)
|
| 66 |
+
* = cosh(x) cos(y) + i sinh(x) sin(y).
|
| 67 |
+
*
|
| 68 |
+
* Exceptional values are noted in the comments within the source code.
|
| 69 |
+
* These values and the return value were taken from n1124.pdf.
|
| 70 |
+
*/
|
| 71 |
+
|
| 72 |
+
_CCCL_HOST_DEVICE inline thrust::complex<double> ccosh(const thrust::complex<double>& z)
|
| 73 |
+
{
|
| 74 |
+
const double huge = 8.98846567431157953864652595395e+307; // 0x1p1023
|
| 75 |
+
double x, y, h;
|
| 76 |
+
uint32_t hx, hy, ix, iy, lx, ly;
|
| 77 |
+
|
| 78 |
+
x = z.real();
|
| 79 |
+
y = z.imag();
|
| 80 |
+
|
| 81 |
+
extract_words(hx, lx, x);
|
| 82 |
+
extract_words(hy, ly, y);
|
| 83 |
+
|
| 84 |
+
ix = 0x7fffffff & hx;
|
| 85 |
+
iy = 0x7fffffff & hy;
|
| 86 |
+
|
| 87 |
+
/* Handle the nearly-non-exceptional cases where x and y are finite. */
|
| 88 |
+
if (ix < 0x7ff00000 && iy < 0x7ff00000)
|
| 89 |
+
{
|
| 90 |
+
if ((iy | ly) == 0)
|
| 91 |
+
{
|
| 92 |
+
return (thrust::complex<double>(::cosh(x), x * y));
|
| 93 |
+
}
|
| 94 |
+
if (ix < 0x40360000) /* small x: normal case */
|
| 95 |
+
{
|
| 96 |
+
return (thrust::complex<double>(::cosh(x) * ::cos(y), ::sinh(x) * ::sin(y)));
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
|
| 100 |
+
if (ix < 0x40862e42)
|
| 101 |
+
{
|
| 102 |
+
/* x < 710: exp(|x|) won't overflow */
|
| 103 |
+
h = ::exp(::fabs(x)) * 0.5;
|
| 104 |
+
return (thrust::complex<double>(h * cos(y), copysign(h, x) * sin(y)));
|
| 105 |
+
}
|
| 106 |
+
else if (ix < 0x4096bbaa)
|
| 107 |
+
{
|
| 108 |
+
/* x < 1455: scale to avoid overflow */
|
| 109 |
+
thrust::complex<double> z_;
|
| 110 |
+
z_ = ldexp_cexp(thrust::complex<double>(fabs(x), y), -1);
|
| 111 |
+
return (thrust::complex<double>(z_.real(), z_.imag() * copysign(1.0, x)));
|
| 112 |
+
}
|
| 113 |
+
else
|
| 114 |
+
{
|
| 115 |
+
/* x >= 1455: the result always overflows */
|
| 116 |
+
h = huge * x;
|
| 117 |
+
return (thrust::complex<double>(h * h * cos(y), h * sin(y)));
|
| 118 |
+
}
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/*
|
| 122 |
+
* cosh(+-0 +- I Inf) = dNaN + I sign(d(+-0, dNaN))0.
|
| 123 |
+
* The sign of 0 in the result is unspecified. Choice = normally
|
| 124 |
+
* the same as dNaN. Raise the invalid floating-point exception.
|
| 125 |
+
*
|
| 126 |
+
* cosh(+-0 +- I NaN) = d(NaN) + I sign(d(+-0, NaN))0.
|
| 127 |
+
* The sign of 0 in the result is unspecified. Choice = normally
|
| 128 |
+
* the same as d(NaN).
|
| 129 |
+
*/
|
| 130 |
+
if ((ix | lx) == 0 && iy >= 0x7ff00000)
|
| 131 |
+
{
|
| 132 |
+
return (thrust::complex<double>(y - y, copysign(0.0, x * (y - y))));
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/*
|
| 136 |
+
* cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0.
|
| 137 |
+
*
|
| 138 |
+
* cosh(NaN +- I 0) = d(NaN) + I sign(d(NaN, +-0))0.
|
| 139 |
+
* The sign of 0 in the result is unspecified.
|
| 140 |
+
*/
|
| 141 |
+
if ((iy | ly) == 0 && ix >= 0x7ff00000)
|
| 142 |
+
{
|
| 143 |
+
if (((hx & 0xfffff) | lx) == 0)
|
| 144 |
+
{
|
| 145 |
+
return (thrust::complex<double>(x * x, copysign(0.0, x) * y));
|
| 146 |
+
}
|
| 147 |
+
return (thrust::complex<double>(x * x, copysign(0.0, (x + x) * y)));
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
/*
|
| 151 |
+
* cosh(x +- I Inf) = dNaN + I dNaN.
|
| 152 |
+
* Raise the invalid floating-point exception for finite nonzero x.
|
| 153 |
+
*
|
| 154 |
+
* cosh(x + I NaN) = d(NaN) + I d(NaN).
|
| 155 |
+
* Optionally raises the invalid floating-point exception for finite
|
| 156 |
+
* nonzero x. Choice = don't raise (except for signaling NaNs).
|
| 157 |
+
*/
|
| 158 |
+
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
|
| 159 |
+
{
|
| 160 |
+
return (thrust::complex<double>(y - y, x * (y - y)));
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
/*
|
| 164 |
+
* cosh(+-Inf + I NaN) = +Inf + I d(NaN).
|
| 165 |
+
*
|
| 166 |
+
* cosh(+-Inf +- I Inf) = +Inf + I dNaN.
|
| 167 |
+
* The sign of Inf in the result is unspecified. Choice = always +.
|
| 168 |
+
* Raise the invalid floating-point exception.
|
| 169 |
+
*
|
| 170 |
+
* cosh(+-Inf + I y) = +Inf cos(y) +- I Inf sin(y)
|
| 171 |
+
*/
|
| 172 |
+
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0)
|
| 173 |
+
{
|
| 174 |
+
if (iy >= 0x7ff00000)
|
| 175 |
+
{
|
| 176 |
+
return (thrust::complex<double>(x * x, x * (y - y)));
|
| 177 |
+
}
|
| 178 |
+
return (thrust::complex<double>((x * x) * cos(y), x * sin(y)));
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/*
|
| 182 |
+
* cosh(NaN + I NaN) = d(NaN) + I d(NaN).
|
| 183 |
+
*
|
| 184 |
+
* cosh(NaN +- I Inf) = d(NaN) + I d(NaN).
|
| 185 |
+
* Optionally raises the invalid floating-point exception.
|
| 186 |
+
* Choice = raise.
|
| 187 |
+
*
|
| 188 |
+
* cosh(NaN + I y) = d(NaN) + I d(NaN).
|
| 189 |
+
* Optionally raises the invalid floating-point exception for finite
|
| 190 |
+
* nonzero y. Choice = don't raise (except for signaling NaNs).
|
| 191 |
+
*/
|
| 192 |
+
return (thrust::complex<double>((x * x) * (y - y), (x + x) * (y - y)));
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
_CCCL_HOST_DEVICE inline thrust::complex<double> ccos(const thrust::complex<double>& z)
|
| 196 |
+
{
|
| 197 |
+
/* ccos(z) = ccosh(I * z) */
|
| 198 |
+
return (ccosh(thrust::complex<double>(-z.imag(), z.real())));
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
} // namespace complex
|
| 202 |
+
|
| 203 |
+
} // namespace detail
|
| 204 |
+
|
| 205 |
+
template <typename ValueType>
|
| 206 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> cos(const complex<ValueType>& z)
|
| 207 |
+
{
|
| 208 |
+
const ValueType re = z.real();
|
| 209 |
+
const ValueType im = z.imag();
|
| 210 |
+
return complex<ValueType>(std::cos(re) * std::cosh(im), -std::sin(re) * std::sinh(im));
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
template <typename ValueType>
|
| 214 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> cosh(const complex<ValueType>& z)
|
| 215 |
+
{
|
| 216 |
+
const ValueType re = z.real();
|
| 217 |
+
const ValueType im = z.imag();
|
| 218 |
+
return complex<ValueType>(std::cosh(re) * std::cos(im), std::sinh(re) * std::sin(im));
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
template <>
|
| 222 |
+
_CCCL_HOST_DEVICE inline thrust::complex<double> cos(const thrust::complex<double>& z)
|
| 223 |
+
{
|
| 224 |
+
return detail::complex::ccos(z);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
template <>
|
| 228 |
+
_CCCL_HOST_DEVICE inline thrust::complex<double> cosh(const thrust::complex<double>& z)
|
| 229 |
+
{
|
| 230 |
+
return detail::complex::ccosh(z);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ccoshf.h
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_ccoshf.c
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#pragma once
|
| 49 |
+
|
| 50 |
+
#include <thrust/detail/config.h>
|
| 51 |
+
|
| 52 |
+
#include <thrust/complex.h>
|
| 53 |
+
#include <thrust/detail/complex/cexp.h>
|
| 54 |
+
#include <thrust/detail/complex/cexpf.h>
|
| 55 |
+
#include <thrust/detail/complex/math_private.h>
|
| 56 |
+
|
| 57 |
+
THRUST_NAMESPACE_BEGIN
|
| 58 |
+
namespace detail
|
| 59 |
+
{
|
| 60 |
+
namespace complex
|
| 61 |
+
{
|
| 62 |
+
|
| 63 |
+
using thrust::complex;
|
| 64 |
+
|
| 65 |
+
_CCCL_HOST_DEVICE inline complex<float> ccoshf(const complex<float>& z)
|
| 66 |
+
{
|
| 67 |
+
float x, y, h;
|
| 68 |
+
uint32_t hx, hy, ix, iy;
|
| 69 |
+
const float huge = 1.70141183460469231731687303716e+38; // 0x1p127;
|
| 70 |
+
|
| 71 |
+
x = z.real();
|
| 72 |
+
y = z.imag();
|
| 73 |
+
|
| 74 |
+
get_float_word(hx, x);
|
| 75 |
+
get_float_word(hy, y);
|
| 76 |
+
|
| 77 |
+
ix = 0x7fffffff & hx;
|
| 78 |
+
iy = 0x7fffffff & hy;
|
| 79 |
+
if (ix < 0x7f800000 && iy < 0x7f800000)
|
| 80 |
+
{
|
| 81 |
+
if (iy == 0)
|
| 82 |
+
{
|
| 83 |
+
return (complex<float>(coshf(x), x * y));
|
| 84 |
+
}
|
| 85 |
+
if (ix < 0x41100000)
|
| 86 |
+
{ /* small x: normal case */
|
| 87 |
+
return (complex<float>(coshf(x) * cosf(y), sinhf(x) * sinf(y)));
|
| 88 |
+
}
|
| 89 |
+
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
|
| 90 |
+
if (ix < 0x42b17218)
|
| 91 |
+
{
|
| 92 |
+
/* x < 88.7: expf(|x|) won't overflow */
|
| 93 |
+
h = expf(fabsf(x)) * 0.5f;
|
| 94 |
+
return (complex<float>(h * cosf(y), copysignf(h, x) * sinf(y)));
|
| 95 |
+
}
|
| 96 |
+
else if (ix < 0x4340b1e7)
|
| 97 |
+
{
|
| 98 |
+
/* x < 192.7: scale to avoid overflow */
|
| 99 |
+
thrust::complex<float> z_;
|
| 100 |
+
z_ = ldexp_cexpf(complex<float>(fabsf(x), y), -1);
|
| 101 |
+
return (complex<float>(z_.real(), z_.imag() * copysignf(1.0f, x)));
|
| 102 |
+
}
|
| 103 |
+
else
|
| 104 |
+
{
|
| 105 |
+
/* x >= 192.7: the result always overflows */
|
| 106 |
+
h = huge * x;
|
| 107 |
+
return (complex<float>(h * h * cosf(y), h * sinf(y)));
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
if (ix == 0 && iy >= 0x7f800000)
|
| 112 |
+
{
|
| 113 |
+
return (complex<float>(y - y, copysignf(0.0f, x * (y - y))));
|
| 114 |
+
}
|
| 115 |
+
if (iy == 0 && ix >= 0x7f800000)
|
| 116 |
+
{
|
| 117 |
+
if ((hx & 0x7fffff) == 0)
|
| 118 |
+
{
|
| 119 |
+
return (complex<float>(x * x, copysignf(0.0f, x) * y));
|
| 120 |
+
}
|
| 121 |
+
return (complex<float>(x * x, copysignf(0.0f, (x + x) * y)));
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
if (ix < 0x7f800000 && iy >= 0x7f800000)
|
| 125 |
+
{
|
| 126 |
+
return (complex<float>(y - y, x * (y - y)));
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0)
|
| 130 |
+
{
|
| 131 |
+
if (iy >= 0x7f800000)
|
| 132 |
+
{
|
| 133 |
+
return (complex<float>(x * x, x * (y - y)));
|
| 134 |
+
}
|
| 135 |
+
return (complex<float>((x * x) * cosf(y), x * sinf(y)));
|
| 136 |
+
}
|
| 137 |
+
return (complex<float>((x * x) * (y - y), (x + x) * (y - y)));
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
_CCCL_HOST_DEVICE inline complex<float> ccosf(const complex<float>& z)
|
| 141 |
+
{
|
| 142 |
+
return (ccoshf(complex<float>(-z.imag(), z.real())));
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
} // namespace complex
|
| 146 |
+
|
| 147 |
+
} // namespace detail
|
| 148 |
+
|
| 149 |
+
template <>
|
| 150 |
+
_CCCL_HOST_DEVICE inline complex<float> cos(const complex<float>& z)
|
| 151 |
+
{
|
| 152 |
+
return detail::complex::ccosf(z);
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
template <>
|
| 156 |
+
_CCCL_HOST_DEVICE inline complex<float> cosh(const complex<float>& z)
|
| 157 |
+
{
|
| 158 |
+
return detail::complex::ccoshf(z);
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cexp.h
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_cexp.c
|
| 46 |
+
* lib/msun/src/k_exp.c
|
| 47 |
+
*
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#pragma once
|
| 51 |
+
|
| 52 |
+
#include <thrust/detail/config.h>
|
| 53 |
+
|
| 54 |
+
#include <thrust/complex.h>
|
| 55 |
+
#include <thrust/detail/complex/math_private.h>
|
| 56 |
+
|
| 57 |
+
THRUST_NAMESPACE_BEGIN
|
| 58 |
+
namespace detail
|
| 59 |
+
{
|
| 60 |
+
namespace complex
|
| 61 |
+
{
|
| 62 |
+
/*
|
| 63 |
+
* Compute exp(x), scaled to avoid spurious overflow. An exponent is
|
| 64 |
+
* returned separately in 'expt'.
|
| 65 |
+
*
|
| 66 |
+
* Input: ln(DBL_MAX) <= x < ln(2 * DBL_MAX / DBL_MIN_DENORM) ~= 1454.91
|
| 67 |
+
* Output: 2**1023 <= y < 2**1024
|
| 68 |
+
*/
|
| 69 |
+
_CCCL_HOST_DEVICE inline double frexp_exp(double x, int* expt)
|
| 70 |
+
{
|
| 71 |
+
const uint32_t k = 1799; /* constant for reduction */
|
| 72 |
+
const double kln2 = 1246.97177782734161156; /* k * ln2 */
|
| 73 |
+
|
| 74 |
+
double exp_x;
|
| 75 |
+
uint32_t hx;
|
| 76 |
+
|
| 77 |
+
/*
|
| 78 |
+
* We use exp(x) = exp(x - kln2) * 2**k, carefully chosen to
|
| 79 |
+
* minimize |exp(kln2) - 2**k|. We also scale the exponent of
|
| 80 |
+
* exp_x to MAX_EXP so that the result can be multiplied by
|
| 81 |
+
* a tiny number without losing accuracy due to denormalization.
|
| 82 |
+
*/
|
| 83 |
+
exp_x = exp(x - kln2);
|
| 84 |
+
get_high_word(hx, exp_x);
|
| 85 |
+
*expt = (hx >> 20) - (0x3ff + 1023) + k;
|
| 86 |
+
set_high_word(exp_x, (hx & 0xfffff) | ((0x3ff + 1023) << 20));
|
| 87 |
+
return (exp_x);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
_CCCL_HOST_DEVICE inline complex<double> ldexp_cexp(complex<double> z, int expt)
|
| 91 |
+
{
|
| 92 |
+
double x, y, exp_x, scale1, scale2;
|
| 93 |
+
int ex_expt, half_expt;
|
| 94 |
+
|
| 95 |
+
x = z.real();
|
| 96 |
+
y = z.imag();
|
| 97 |
+
exp_x = frexp_exp(x, &ex_expt);
|
| 98 |
+
expt += ex_expt;
|
| 99 |
+
|
| 100 |
+
/*
|
| 101 |
+
* Arrange so that scale1 * scale2 == 2**expt. We use this to
|
| 102 |
+
* compensate for scalbn being horrendously slow.
|
| 103 |
+
*/
|
| 104 |
+
half_expt = expt / 2;
|
| 105 |
+
insert_words(scale1, (0x3ff + half_expt) << 20, 0);
|
| 106 |
+
half_expt = expt - half_expt;
|
| 107 |
+
insert_words(scale2, (0x3ff + half_expt) << 20, 0);
|
| 108 |
+
|
| 109 |
+
return (complex<double>(cos(y) * exp_x * scale1 * scale2, sin(y) * exp_x * scale1 * scale2));
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
_CCCL_HOST_DEVICE inline complex<double> cexp(const complex<double>& z)
|
| 113 |
+
{
|
| 114 |
+
double x, y, exp_x;
|
| 115 |
+
uint32_t hx, hy, lx, ly;
|
| 116 |
+
|
| 117 |
+
const uint32_t exp_ovfl = 0x40862e42, /* high bits of MAX_EXP * ln2 ~= 710 */
|
| 118 |
+
cexp_ovfl = 0x4096b8e4; /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */
|
| 119 |
+
|
| 120 |
+
x = z.real();
|
| 121 |
+
y = z.imag();
|
| 122 |
+
|
| 123 |
+
extract_words(hy, ly, y);
|
| 124 |
+
hy &= 0x7fffffff;
|
| 125 |
+
|
| 126 |
+
/* cexp(x + I 0) = exp(x) + I 0 */
|
| 127 |
+
if ((hy | ly) == 0)
|
| 128 |
+
{
|
| 129 |
+
return (complex<double>(exp(x), y));
|
| 130 |
+
}
|
| 131 |
+
extract_words(hx, lx, x);
|
| 132 |
+
/* cexp(0 + I y) = cos(y) + I sin(y) */
|
| 133 |
+
if (((hx & 0x7fffffff) | lx) == 0)
|
| 134 |
+
{
|
| 135 |
+
return (complex<double>(cos(y), sin(y)));
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
if (hy >= 0x7ff00000)
|
| 139 |
+
{
|
| 140 |
+
if (lx != 0 || (hx & 0x7fffffff) != 0x7ff00000)
|
| 141 |
+
{
|
| 142 |
+
/* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */
|
| 143 |
+
return (complex<double>(y - y, y - y));
|
| 144 |
+
}
|
| 145 |
+
else if (hx & 0x80000000)
|
| 146 |
+
{
|
| 147 |
+
/* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */
|
| 148 |
+
return (complex<double>(0.0, 0.0));
|
| 149 |
+
}
|
| 150 |
+
else
|
| 151 |
+
{
|
| 152 |
+
/* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */
|
| 153 |
+
return (complex<double>(x, y - y));
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
if (hx >= exp_ovfl && hx <= cexp_ovfl)
|
| 158 |
+
{
|
| 159 |
+
/*
|
| 160 |
+
* x is between 709.7 and 1454.3, so we must scale to avoid
|
| 161 |
+
* overflow in exp(x).
|
| 162 |
+
*/
|
| 163 |
+
return (ldexp_cexp(z, 0));
|
| 164 |
+
}
|
| 165 |
+
else
|
| 166 |
+
{
|
| 167 |
+
/*
|
| 168 |
+
* Cases covered here:
|
| 169 |
+
* - x < exp_ovfl and exp(x) won't overflow (common case)
|
| 170 |
+
* - x > cexp_ovfl, so exp(x) * s overflows for all s > 0
|
| 171 |
+
* - x = +-Inf (generated by exp())
|
| 172 |
+
* - x = NaN (spurious inexact exception from y)
|
| 173 |
+
*/
|
| 174 |
+
exp_x = std::exp(x);
|
| 175 |
+
return (complex<double>(exp_x * cos(y), exp_x * sin(y)));
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
} // namespace complex
|
| 180 |
+
|
| 181 |
+
} // namespace detail
|
| 182 |
+
|
| 183 |
+
template <typename ValueType>
|
| 184 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> exp(const complex<ValueType>& z)
|
| 185 |
+
{
|
| 186 |
+
return polar(std::exp(z.real()), z.imag());
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
template <>
|
| 190 |
+
_CCCL_HOST_DEVICE inline complex<double> exp(const complex<double>& z)
|
| 191 |
+
{
|
| 192 |
+
return detail::complex::cexp(z);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cexpf.h
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2011 David Schultz <das@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_cexpf.c
|
| 46 |
+
* lib/msun/src/k_exp.c
|
| 47 |
+
*
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#pragma once
|
| 51 |
+
|
| 52 |
+
#include <thrust/detail/config.h>
|
| 53 |
+
|
| 54 |
+
#include <thrust/complex.h>
|
| 55 |
+
#include <thrust/detail/complex/math_private.h>
|
| 56 |
+
|
| 57 |
+
THRUST_NAMESPACE_BEGIN
|
| 58 |
+
namespace detail
|
| 59 |
+
{
|
| 60 |
+
namespace complex
|
| 61 |
+
{
|
| 62 |
+
|
| 63 |
+
_CCCL_HOST_DEVICE inline float frexp_expf(float x, int* expt)
|
| 64 |
+
{
|
| 65 |
+
const uint32_t k = 235; /* constant for reduction */
|
| 66 |
+
const float kln2 = 162.88958740F; /* k * ln2 */
|
| 67 |
+
|
| 68 |
+
// should this be a double instead?
|
| 69 |
+
float exp_x;
|
| 70 |
+
uint32_t hx;
|
| 71 |
+
|
| 72 |
+
exp_x = expf(x - kln2);
|
| 73 |
+
get_float_word(hx, exp_x);
|
| 74 |
+
*expt = (hx >> 23) - (0x7f + 127) + k;
|
| 75 |
+
set_float_word(exp_x, (hx & 0x7fffff) | ((0x7f + 127) << 23));
|
| 76 |
+
return (exp_x);
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
_CCCL_HOST_DEVICE inline complex<float> ldexp_cexpf(complex<float> z, int expt)
|
| 80 |
+
{
|
| 81 |
+
float x, y, exp_x, scale1, scale2;
|
| 82 |
+
int ex_expt, half_expt;
|
| 83 |
+
|
| 84 |
+
x = z.real();
|
| 85 |
+
y = z.imag();
|
| 86 |
+
exp_x = frexp_expf(x, &ex_expt);
|
| 87 |
+
expt += ex_expt;
|
| 88 |
+
|
| 89 |
+
half_expt = expt / 2;
|
| 90 |
+
set_float_word(scale1, (0x7f + half_expt) << 23);
|
| 91 |
+
half_expt = expt - half_expt;
|
| 92 |
+
set_float_word(scale2, (0x7f + half_expt) << 23);
|
| 93 |
+
|
| 94 |
+
return (complex<float>(std::cos(y) * exp_x * scale1 * scale2, std::sin(y) * exp_x * scale1 * scale2));
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
_CCCL_HOST_DEVICE inline complex<float> cexpf(const complex<float>& z)
|
| 98 |
+
{
|
| 99 |
+
float x, y, exp_x;
|
| 100 |
+
uint32_t hx, hy;
|
| 101 |
+
|
| 102 |
+
const uint32_t exp_ovfl = 0x42b17218, /* MAX_EXP * ln2 ~= 88.722839355 */
|
| 103 |
+
cexp_ovfl = 0x43400074; /* (MAX_EXP - MIN_DENORM_EXP) * ln2 */
|
| 104 |
+
|
| 105 |
+
x = z.real();
|
| 106 |
+
y = z.imag();
|
| 107 |
+
|
| 108 |
+
get_float_word(hy, y);
|
| 109 |
+
hy &= 0x7fffffff;
|
| 110 |
+
|
| 111 |
+
/* cexp(x + I 0) = exp(x) + I 0 */
|
| 112 |
+
if (hy == 0)
|
| 113 |
+
{
|
| 114 |
+
return (complex<float>(std::exp(x), y));
|
| 115 |
+
}
|
| 116 |
+
get_float_word(hx, x);
|
| 117 |
+
/* cexp(0 + I y) = cos(y) + I sin(y) */
|
| 118 |
+
if ((hx & 0x7fffffff) == 0)
|
| 119 |
+
{
|
| 120 |
+
return (complex<float>(std::cos(y), std::sin(y)));
|
| 121 |
+
}
|
| 122 |
+
if (hy >= 0x7f800000)
|
| 123 |
+
{
|
| 124 |
+
if ((hx & 0x7fffffff) != 0x7f800000)
|
| 125 |
+
{
|
| 126 |
+
/* cexp(finite|NaN +- I Inf|NaN) = NaN + I NaN */
|
| 127 |
+
return (complex<float>(y - y, y - y));
|
| 128 |
+
}
|
| 129 |
+
else if (hx & 0x80000000)
|
| 130 |
+
{
|
| 131 |
+
/* cexp(-Inf +- I Inf|NaN) = 0 + I 0 */
|
| 132 |
+
return (complex<float>(0.0, 0.0));
|
| 133 |
+
}
|
| 134 |
+
else
|
| 135 |
+
{
|
| 136 |
+
/* cexp(+Inf +- I Inf|NaN) = Inf + I NaN */
|
| 137 |
+
return (complex<float>(x, y - y));
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
if (hx >= exp_ovfl && hx <= cexp_ovfl)
|
| 142 |
+
{
|
| 143 |
+
/*
|
| 144 |
+
* x is between 88.7 and 192, so we must scale to avoid
|
| 145 |
+
* overflow in expf(x).
|
| 146 |
+
*/
|
| 147 |
+
return (ldexp_cexpf(z, 0));
|
| 148 |
+
}
|
| 149 |
+
else
|
| 150 |
+
{
|
| 151 |
+
/*
|
| 152 |
+
* Cases covered here:
|
| 153 |
+
* - x < exp_ovfl and exp(x) won't overflow (common case)
|
| 154 |
+
* - x > cexp_ovfl, so exp(x) * s overflows for all s > 0
|
| 155 |
+
* - x = +-Inf (generated by exp())
|
| 156 |
+
* - x = NaN (spurious inexact exception from y)
|
| 157 |
+
*/
|
| 158 |
+
exp_x = std::exp(x);
|
| 159 |
+
return (complex<float>(exp_x * std::cos(y), exp_x * std::sin(y)));
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
} // namespace complex
|
| 164 |
+
|
| 165 |
+
} // namespace detail
|
| 166 |
+
|
| 167 |
+
template <>
|
| 168 |
+
_CCCL_HOST_DEVICE inline complex<float> exp(const complex<float>& z)
|
| 169 |
+
{
|
| 170 |
+
return detail::complex::cexpf(z);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/clog.h
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSDs msun:*/
|
| 45 |
+
|
| 46 |
+
#pragma once
|
| 47 |
+
|
| 48 |
+
#include <thrust/detail/config.h>
|
| 49 |
+
|
| 50 |
+
#include <thrust/complex.h>
|
| 51 |
+
#include <thrust/detail/complex/math_private.h>
|
| 52 |
+
|
| 53 |
+
THRUST_NAMESPACE_BEGIN
|
| 54 |
+
namespace detail
|
| 55 |
+
{
|
| 56 |
+
namespace complex
|
| 57 |
+
{
|
| 58 |
+
|
| 59 |
+
using thrust::complex;
|
| 60 |
+
|
| 61 |
+
/* round down to 18 = 54/3 bits */
|
| 62 |
+
_CCCL_HOST_DEVICE inline double trim(double x)
|
| 63 |
+
{
|
| 64 |
+
uint32_t hi;
|
| 65 |
+
get_high_word(hi, x);
|
| 66 |
+
insert_words(x, hi & 0xfffffff8, 0);
|
| 67 |
+
return x;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
_CCCL_HOST_DEVICE inline complex<double> clog(const complex<double>& z)
|
| 71 |
+
{
|
| 72 |
+
// Adapted from FreeBSDs msun
|
| 73 |
+
double x, y;
|
| 74 |
+
double ax, ay;
|
| 75 |
+
double x0, y0, x1, y1, x2, y2, t, hm1;
|
| 76 |
+
double val[12];
|
| 77 |
+
int i, sorted;
|
| 78 |
+
const double e = 2.7182818284590452354;
|
| 79 |
+
|
| 80 |
+
x = z.real();
|
| 81 |
+
y = z.imag();
|
| 82 |
+
|
| 83 |
+
/* Handle NaNs using the general formula to mix them right. */
|
| 84 |
+
if (x != x || y != y)
|
| 85 |
+
{
|
| 86 |
+
return (complex<double>(std::log(norm(z)), std::atan2(y, x)));
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
ax = std::abs(x);
|
| 90 |
+
ay = std::abs(y);
|
| 91 |
+
if (ax < ay)
|
| 92 |
+
{
|
| 93 |
+
t = ax;
|
| 94 |
+
ax = ay;
|
| 95 |
+
ay = t;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/*
|
| 99 |
+
* To avoid unnecessary overflow, if x and y are very large, divide x
|
| 100 |
+
* and y by M_E, and then add 1 to the logarithm. This depends on
|
| 101 |
+
* M_E being larger than sqrt(2).
|
| 102 |
+
* There is a potential loss of accuracy caused by dividing by M_E,
|
| 103 |
+
* but this case should happen extremely rarely.
|
| 104 |
+
*/
|
| 105 |
+
// if (ay > 5e307){
|
| 106 |
+
// For high values of ay -> hypotf(DBL_MAX,ay) = inf
|
| 107 |
+
// We expect that for values at or below ay = 5e307 this should not happen
|
| 108 |
+
if (ay > 5e307)
|
| 109 |
+
{
|
| 110 |
+
return (complex<double>(std::log(hypot(x / e, y / e)) + 1.0, std::atan2(y, x)));
|
| 111 |
+
}
|
| 112 |
+
if (ax == 1.)
|
| 113 |
+
{
|
| 114 |
+
if (ay < 1e-150)
|
| 115 |
+
{
|
| 116 |
+
return (complex<double>((ay * 0.5) * ay, std::atan2(y, x)));
|
| 117 |
+
}
|
| 118 |
+
return (complex<double>(log1p(ay * ay) * 0.5, std::atan2(y, x)));
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/*
|
| 122 |
+
* Because atan2 and hypot conform to C99, this also covers all the
|
| 123 |
+
* edge cases when x or y are 0 or infinite.
|
| 124 |
+
*/
|
| 125 |
+
if (ax < 1e-50 || ay < 1e-50 || ax > 1e50 || ay > 1e50)
|
| 126 |
+
{
|
| 127 |
+
return (complex<double>(std::log(hypot(x, y)), std::atan2(y, x)));
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
/*
|
| 131 |
+
* From this point on, we don't need to worry about underflow or
|
| 132 |
+
* overflow in calculating ax*ax or ay*ay.
|
| 133 |
+
*/
|
| 134 |
+
|
| 135 |
+
/* Some easy cases. */
|
| 136 |
+
|
| 137 |
+
if (ax >= 1.0)
|
| 138 |
+
{
|
| 139 |
+
return (complex<double>(log1p((ax - 1) * (ax + 1) + ay * ay) * 0.5, atan2(y, x)));
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
if (ax * ax + ay * ay <= 0.7)
|
| 143 |
+
{
|
| 144 |
+
return (complex<double>(std::log(ax * ax + ay * ay) * 0.5, std::atan2(y, x)));
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
/*
|
| 148 |
+
* Take extra care so that ULP of real part is small if hypot(x,y) is
|
| 149 |
+
* moderately close to 1.
|
| 150 |
+
*/
|
| 151 |
+
|
| 152 |
+
x0 = trim(ax);
|
| 153 |
+
ax = ax - x0;
|
| 154 |
+
x1 = trim(ax);
|
| 155 |
+
x2 = ax - x1;
|
| 156 |
+
y0 = trim(ay);
|
| 157 |
+
ay = ay - y0;
|
| 158 |
+
y1 = trim(ay);
|
| 159 |
+
y2 = ay - y1;
|
| 160 |
+
|
| 161 |
+
val[0] = x0 * x0;
|
| 162 |
+
val[1] = y0 * y0;
|
| 163 |
+
val[2] = 2 * x0 * x1;
|
| 164 |
+
val[3] = 2 * y0 * y1;
|
| 165 |
+
val[4] = x1 * x1;
|
| 166 |
+
val[5] = y1 * y1;
|
| 167 |
+
val[6] = 2 * x0 * x2;
|
| 168 |
+
val[7] = 2 * y0 * y2;
|
| 169 |
+
val[8] = 2 * x1 * x2;
|
| 170 |
+
val[9] = 2 * y1 * y2;
|
| 171 |
+
val[10] = x2 * x2;
|
| 172 |
+
val[11] = y2 * y2;
|
| 173 |
+
|
| 174 |
+
/* Bubble sort. */
|
| 175 |
+
|
| 176 |
+
do
|
| 177 |
+
{
|
| 178 |
+
sorted = 1;
|
| 179 |
+
for (i = 0; i < 11; i++)
|
| 180 |
+
{
|
| 181 |
+
if (val[i] < val[i + 1])
|
| 182 |
+
{
|
| 183 |
+
sorted = 0;
|
| 184 |
+
t = val[i];
|
| 185 |
+
val[i] = val[i + 1];
|
| 186 |
+
val[i + 1] = t;
|
| 187 |
+
}
|
| 188 |
+
}
|
| 189 |
+
} while (!sorted);
|
| 190 |
+
|
| 191 |
+
hm1 = -1;
|
| 192 |
+
for (i = 0; i < 12; i++)
|
| 193 |
+
{
|
| 194 |
+
hm1 += val[i];
|
| 195 |
+
}
|
| 196 |
+
return (complex<double>(0.5 * log1p(hm1), atan2(y, x)));
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
} // namespace complex
|
| 200 |
+
|
| 201 |
+
} // namespace detail
|
| 202 |
+
|
| 203 |
+
template <typename ValueType>
|
| 204 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> log(const complex<ValueType>& z)
|
| 205 |
+
{
|
| 206 |
+
return complex<ValueType>(std::log(thrust::abs(z)), thrust::arg(z));
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
template <>
|
| 210 |
+
_CCCL_HOST_DEVICE inline complex<double> log(const complex<double>& z)
|
| 211 |
+
{
|
| 212 |
+
return detail::complex::clog(z);
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
template <typename ValueType>
|
| 216 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> log10(const complex<ValueType>& z)
|
| 217 |
+
{
|
| 218 |
+
// Using the explicit literal prevents compile time warnings in
|
| 219 |
+
// devices that don't support doubles
|
| 220 |
+
return thrust::log(z) / ValueType(2.30258509299404568402);
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/clogf.h
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2012 Stephen Montgomery-Smith <stephen@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSDs msun:*/
|
| 45 |
+
|
| 46 |
+
#pragma once
|
| 47 |
+
|
| 48 |
+
#include <thrust/detail/config.h>
|
| 49 |
+
|
| 50 |
+
#include <thrust/complex.h>
|
| 51 |
+
#include <thrust/detail/complex/math_private.h>
|
| 52 |
+
|
| 53 |
+
THRUST_NAMESPACE_BEGIN
|
| 54 |
+
namespace detail
|
| 55 |
+
{
|
| 56 |
+
namespace complex
|
| 57 |
+
{
|
| 58 |
+
|
| 59 |
+
using thrust::complex;
|
| 60 |
+
|
| 61 |
+
/* round down to 8 = 24/3 bits */
|
| 62 |
+
_CCCL_HOST_DEVICE inline float trim(float x)
|
| 63 |
+
{
|
| 64 |
+
uint32_t hx;
|
| 65 |
+
get_float_word(hx, x);
|
| 66 |
+
hx &= 0xffff0000;
|
| 67 |
+
float ret;
|
| 68 |
+
set_float_word(ret, hx);
|
| 69 |
+
return ret;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
_CCCL_HOST_DEVICE inline complex<float> clogf(const complex<float>& z)
|
| 73 |
+
{
|
| 74 |
+
// Adapted from FreeBSDs msun
|
| 75 |
+
float x, y;
|
| 76 |
+
float ax, ay;
|
| 77 |
+
float x0, y0, x1, y1, x2, y2, t, hm1;
|
| 78 |
+
float val[12];
|
| 79 |
+
int i, sorted;
|
| 80 |
+
const float e = 2.7182818284590452354f;
|
| 81 |
+
|
| 82 |
+
x = z.real();
|
| 83 |
+
y = z.imag();
|
| 84 |
+
|
| 85 |
+
/* Handle NaNs using the general formula to mix them right. */
|
| 86 |
+
if (x != x || y != y)
|
| 87 |
+
{
|
| 88 |
+
return (complex<float>(std::log(norm(z)), std::atan2(y, x)));
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
ax = std::abs(x);
|
| 92 |
+
ay = std::abs(y);
|
| 93 |
+
if (ax < ay)
|
| 94 |
+
{
|
| 95 |
+
t = ax;
|
| 96 |
+
ax = ay;
|
| 97 |
+
ay = t;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
/*
|
| 101 |
+
* To avoid unnecessary overflow, if x and y are very large, divide x
|
| 102 |
+
* and y by M_E, and then add 1 to the logarithm. This depends on
|
| 103 |
+
* M_E being larger than sqrt(2).
|
| 104 |
+
* There is a potential loss of accuracy caused by dividing by M_E,
|
| 105 |
+
* but this case should happen extremely rarely.
|
| 106 |
+
*/
|
| 107 |
+
// For high values of ay -> hypotf(FLT_MAX,ay) = inf
|
| 108 |
+
// We expect that for values at or below ay = 1e34f this should not happen
|
| 109 |
+
if (ay > 1e34f)
|
| 110 |
+
{
|
| 111 |
+
return (complex<float>(std::log(hypotf(x / e, y / e)) + 1.0f, std::atan2(y, x)));
|
| 112 |
+
}
|
| 113 |
+
if (ax == 1.f)
|
| 114 |
+
{
|
| 115 |
+
if (ay < 1e-19f)
|
| 116 |
+
{
|
| 117 |
+
return (complex<float>((ay * 0.5f) * ay, std::atan2(y, x)));
|
| 118 |
+
}
|
| 119 |
+
return (complex<float>(log1pf(ay * ay) * 0.5f, std::atan2(y, x)));
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
/*
|
| 123 |
+
* Because atan2 and hypot conform to C99, this also covers all the
|
| 124 |
+
* edge cases when x or y are 0 or infinite.
|
| 125 |
+
*/
|
| 126 |
+
if (ax < 1e-6f || ay < 1e-6f || ax > 1e6f || ay > 1e6f)
|
| 127 |
+
{
|
| 128 |
+
return (complex<float>(std::log(hypotf(x, y)), std::atan2(y, x)));
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/*
|
| 132 |
+
* From this point on, we don't need to worry about underflow or
|
| 133 |
+
* overflow in calculating ax*ax or ay*ay.
|
| 134 |
+
*/
|
| 135 |
+
|
| 136 |
+
/* Some easy cases. */
|
| 137 |
+
|
| 138 |
+
if (ax >= 1.0f)
|
| 139 |
+
{
|
| 140 |
+
return (complex<float>(log1pf((ax - 1.f) * (ax + 1.f) + ay * ay) * 0.5f, atan2(y, x)));
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
if (ax * ax + ay * ay <= 0.7f)
|
| 144 |
+
{
|
| 145 |
+
return (complex<float>(std::log(ax * ax + ay * ay) * 0.5f, std::atan2(y, x)));
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/*
|
| 149 |
+
* Take extra care so that ULP of real part is small if hypot(x,y) is
|
| 150 |
+
* moderately close to 1.
|
| 151 |
+
*/
|
| 152 |
+
|
| 153 |
+
x0 = trim(ax);
|
| 154 |
+
ax = ax - x0;
|
| 155 |
+
x1 = trim(ax);
|
| 156 |
+
x2 = ax - x1;
|
| 157 |
+
y0 = trim(ay);
|
| 158 |
+
ay = ay - y0;
|
| 159 |
+
y1 = trim(ay);
|
| 160 |
+
y2 = ay - y1;
|
| 161 |
+
|
| 162 |
+
val[0] = x0 * x0;
|
| 163 |
+
val[1] = y0 * y0;
|
| 164 |
+
val[2] = 2 * x0 * x1;
|
| 165 |
+
val[3] = 2 * y0 * y1;
|
| 166 |
+
val[4] = x1 * x1;
|
| 167 |
+
val[5] = y1 * y1;
|
| 168 |
+
val[6] = 2 * x0 * x2;
|
| 169 |
+
val[7] = 2 * y0 * y2;
|
| 170 |
+
val[8] = 2 * x1 * x2;
|
| 171 |
+
val[9] = 2 * y1 * y2;
|
| 172 |
+
val[10] = x2 * x2;
|
| 173 |
+
val[11] = y2 * y2;
|
| 174 |
+
|
| 175 |
+
/* Bubble sort. */
|
| 176 |
+
|
| 177 |
+
do
|
| 178 |
+
{
|
| 179 |
+
sorted = 1;
|
| 180 |
+
for (i = 0; i < 11; i++)
|
| 181 |
+
{
|
| 182 |
+
if (val[i] < val[i + 1])
|
| 183 |
+
{
|
| 184 |
+
sorted = 0;
|
| 185 |
+
t = val[i];
|
| 186 |
+
val[i] = val[i + 1];
|
| 187 |
+
val[i + 1] = t;
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
} while (!sorted);
|
| 191 |
+
|
| 192 |
+
hm1 = -1;
|
| 193 |
+
for (i = 0; i < 12; i++)
|
| 194 |
+
{
|
| 195 |
+
hm1 += val[i];
|
| 196 |
+
}
|
| 197 |
+
return (complex<float>(0.5f * log1pf(hm1), atan2(y, x)));
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
} // namespace complex
|
| 201 |
+
|
| 202 |
+
} // namespace detail
|
| 203 |
+
|
| 204 |
+
template <>
|
| 205 |
+
_CCCL_HOST_DEVICE inline complex<float> log(const complex<float>& z)
|
| 206 |
+
{
|
| 207 |
+
return detail::complex::clogf(z);
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/complex.inl
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2024 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
|
| 22 |
+
#include <thrust/complex.h>
|
| 23 |
+
#include <thrust/type_traits/is_trivially_relocatable.h>
|
| 24 |
+
|
| 25 |
+
THRUST_NAMESPACE_BEGIN
|
| 26 |
+
|
| 27 |
+
/* --- Constructors --- */
|
| 28 |
+
|
| 29 |
+
template <typename T>
|
| 30 |
+
_CCCL_HOST_DEVICE complex<T>::complex(const T& re)
|
| 31 |
+
// Initialize the storage in the member initializer list using C++ unicorn
|
| 32 |
+
// initialization. This allows `complex<T const>` to work.
|
| 33 |
+
: data{re, T()}
|
| 34 |
+
{}
|
| 35 |
+
|
| 36 |
+
template <typename T>
|
| 37 |
+
_CCCL_HOST_DEVICE complex<T>::complex(const T& re, const T& im)
|
| 38 |
+
// Initialize the storage in the member initializer list using C++ unicorn
|
| 39 |
+
// initialization. This allows `complex<T const>` to work.
|
| 40 |
+
: data{re, im}
|
| 41 |
+
{}
|
| 42 |
+
|
| 43 |
+
template <typename T>
|
| 44 |
+
template <typename U>
|
| 45 |
+
_CCCL_HOST_DEVICE complex<T>::complex(const complex<U>& z)
|
| 46 |
+
// Initialize the storage in the member initializer list using C++ unicorn
|
| 47 |
+
// initialization. This allows `complex<T const>` to work.
|
| 48 |
+
// We do a functional-style cast here to suppress conversion warnings.
|
| 49 |
+
: data{T(z.real()), T(z.imag())}
|
| 50 |
+
{}
|
| 51 |
+
|
| 52 |
+
template <typename T>
|
| 53 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<T>& z)
|
| 54 |
+
// Initialize the storage in the member initializer list using C++ unicorn
|
| 55 |
+
// initialization. This allows `complex<T const>` to work.
|
| 56 |
+
: data{THRUST_STD_COMPLEX_REAL(z), THRUST_STD_COMPLEX_IMAG(z)}
|
| 57 |
+
{}
|
| 58 |
+
|
| 59 |
+
template <typename T>
|
| 60 |
+
template <typename U>
|
| 61 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<U>& z)
|
| 62 |
+
// Initialize the storage in the member initializer list using C++ unicorn
|
| 63 |
+
// initialization. This allows `complex<T const>` to work.
|
| 64 |
+
// We do a functional-style cast here to suppress conversion warnings.
|
| 65 |
+
: data{T(THRUST_STD_COMPLEX_REAL(z)), T(THRUST_STD_COMPLEX_IMAG(z))}
|
| 66 |
+
{}
|
| 67 |
+
|
| 68 |
+
/* --- Assignment Operators --- */
|
| 69 |
+
|
| 70 |
+
template <typename T>
|
| 71 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const T& re)
|
| 72 |
+
{
|
| 73 |
+
real(re);
|
| 74 |
+
imag(T());
|
| 75 |
+
return *this;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
template <typename T>
|
| 79 |
+
template <typename U>
|
| 80 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const complex<U>& z)
|
| 81 |
+
{
|
| 82 |
+
real(T(z.real()));
|
| 83 |
+
imag(T(z.imag()));
|
| 84 |
+
return *this;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
template <typename T>
|
| 88 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>& complex<T>::operator=(const std::complex<T>& z)
|
| 89 |
+
{
|
| 90 |
+
real(THRUST_STD_COMPLEX_REAL(z));
|
| 91 |
+
imag(THRUST_STD_COMPLEX_IMAG(z));
|
| 92 |
+
return *this;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
template <typename T>
|
| 96 |
+
template <typename U>
|
| 97 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>& complex<T>::operator=(const std::complex<U>& z)
|
| 98 |
+
{
|
| 99 |
+
real(T(THRUST_STD_COMPLEX_REAL(z)));
|
| 100 |
+
imag(T(THRUST_STD_COMPLEX_IMAG(z)));
|
| 101 |
+
return *this;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
/* --- Compound Assignment Operators --- */
|
| 105 |
+
|
| 106 |
+
template <typename T>
|
| 107 |
+
template <typename U>
|
| 108 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator+=(const complex<U>& z)
|
| 109 |
+
{
|
| 110 |
+
*this = *this + z;
|
| 111 |
+
return *this;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
template <typename T>
|
| 115 |
+
template <typename U>
|
| 116 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator-=(const complex<U>& z)
|
| 117 |
+
{
|
| 118 |
+
*this = *this - z;
|
| 119 |
+
return *this;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
template <typename T>
|
| 123 |
+
template <typename U>
|
| 124 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator*=(const complex<U>& z)
|
| 125 |
+
{
|
| 126 |
+
*this = *this * z;
|
| 127 |
+
return *this;
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
template <typename T>
|
| 131 |
+
template <typename U>
|
| 132 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator/=(const complex<U>& z)
|
| 133 |
+
{
|
| 134 |
+
*this = *this / z;
|
| 135 |
+
return *this;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
template <typename T>
|
| 139 |
+
template <typename U>
|
| 140 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator+=(const U& z)
|
| 141 |
+
{
|
| 142 |
+
*this = *this + z;
|
| 143 |
+
return *this;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
template <typename T>
|
| 147 |
+
template <typename U>
|
| 148 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator-=(const U& z)
|
| 149 |
+
{
|
| 150 |
+
*this = *this - z;
|
| 151 |
+
return *this;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
template <typename T>
|
| 155 |
+
template <typename U>
|
| 156 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator*=(const U& z)
|
| 157 |
+
{
|
| 158 |
+
*this = *this * z;
|
| 159 |
+
return *this;
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
template <typename T>
|
| 163 |
+
template <typename U>
|
| 164 |
+
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator/=(const U& z)
|
| 165 |
+
{
|
| 166 |
+
*this = *this / z;
|
| 167 |
+
return *this;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/* --- Equality Operators --- */
|
| 171 |
+
|
| 172 |
+
template <typename T0, typename T1>
|
| 173 |
+
_CCCL_HOST_DEVICE bool operator==(const complex<T0>& x, const complex<T1>& y)
|
| 174 |
+
{
|
| 175 |
+
return x.real() == y.real() && x.imag() == y.imag();
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
template <typename T0, typename T1>
|
| 179 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE bool operator==(const complex<T0>& x, const std::complex<T1>& y)
|
| 180 |
+
{
|
| 181 |
+
return x.real() == THRUST_STD_COMPLEX_REAL(y) && x.imag() == THRUST_STD_COMPLEX_IMAG(y);
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
template <typename T0, typename T1>
|
| 185 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE bool operator==(const std::complex<T0>& x, const complex<T1>& y)
|
| 186 |
+
{
|
| 187 |
+
return THRUST_STD_COMPLEX_REAL(x) == y.real() && THRUST_STD_COMPLEX_IMAG(x) == y.imag();
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
template <typename T0, typename T1>
|
| 191 |
+
_CCCL_HOST_DEVICE bool operator==(const T0& x, const complex<T1>& y)
|
| 192 |
+
{
|
| 193 |
+
return x == y.real() && y.imag() == T1();
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
template <typename T0, typename T1>
|
| 197 |
+
_CCCL_HOST_DEVICE bool operator==(const complex<T0>& x, const T1& y)
|
| 198 |
+
{
|
| 199 |
+
return x.real() == y && x.imag() == T1();
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
template <typename T0, typename T1>
|
| 203 |
+
_CCCL_HOST_DEVICE bool operator!=(const complex<T0>& x, const complex<T1>& y)
|
| 204 |
+
{
|
| 205 |
+
return !(x == y);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
template <typename T0, typename T1>
|
| 209 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE bool operator!=(const complex<T0>& x, const std::complex<T1>& y)
|
| 210 |
+
{
|
| 211 |
+
return !(x == y);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
template <typename T0, typename T1>
|
| 215 |
+
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE bool operator!=(const std::complex<T0>& x, const complex<T1>& y)
|
| 216 |
+
{
|
| 217 |
+
return !(x == y);
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
template <typename T0, typename T1>
|
| 221 |
+
_CCCL_HOST_DEVICE bool operator!=(const T0& x, const complex<T1>& y)
|
| 222 |
+
{
|
| 223 |
+
return !(x == y);
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
template <typename T0, typename T1>
|
| 227 |
+
_CCCL_HOST_DEVICE bool operator!=(const complex<T0>& x, const T1& y)
|
| 228 |
+
{
|
| 229 |
+
return !(x == y);
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
template <typename T>
|
| 233 |
+
struct proclaim_trivially_relocatable<complex<T>> : thrust::true_type
|
| 234 |
+
{};
|
| 235 |
+
|
| 236 |
+
THRUST_NAMESPACE_END
|
| 237 |
+
|
| 238 |
+
#include <thrust/detail/complex/arithmetic.h>
|
| 239 |
+
#include <thrust/detail/complex/catrig.h>
|
| 240 |
+
#include <thrust/detail/complex/catrigf.h>
|
| 241 |
+
#include <thrust/detail/complex/ccosh.h>
|
| 242 |
+
#include <thrust/detail/complex/ccoshf.h>
|
| 243 |
+
#include <thrust/detail/complex/cexp.h>
|
| 244 |
+
#include <thrust/detail/complex/cexpf.h>
|
| 245 |
+
#include <thrust/detail/complex/clog.h>
|
| 246 |
+
#include <thrust/detail/complex/clogf.h>
|
| 247 |
+
#include <thrust/detail/complex/cpow.h>
|
| 248 |
+
#include <thrust/detail/complex/cproj.h>
|
| 249 |
+
#include <thrust/detail/complex/csinh.h>
|
| 250 |
+
#include <thrust/detail/complex/csinhf.h>
|
| 251 |
+
#include <thrust/detail/complex/csqrt.h>
|
| 252 |
+
#include <thrust/detail/complex/csqrtf.h>
|
| 253 |
+
#include <thrust/detail/complex/ctanh.h>
|
| 254 |
+
#include <thrust/detail/complex/ctanhf.h>
|
| 255 |
+
#include <thrust/detail/complex/stream.h>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cpow.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
|
| 22 |
+
#include <thrust/complex.h>
|
| 23 |
+
#include <thrust/detail/type_traits.h>
|
| 24 |
+
|
| 25 |
+
THRUST_NAMESPACE_BEGIN
|
| 26 |
+
|
| 27 |
+
template <typename T0, typename T1>
|
| 28 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> pow(const complex<T0>& x, const complex<T1>& y)
|
| 29 |
+
{
|
| 30 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 31 |
+
return exp(log(complex<T>(x)) * complex<T>(y));
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
template <typename T0, typename T1>
|
| 35 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> pow(const complex<T0>& x, const T1& y)
|
| 36 |
+
{
|
| 37 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 38 |
+
return exp(log(complex<T>(x)) * T(y));
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
template <typename T0, typename T1>
|
| 42 |
+
_CCCL_HOST_DEVICE complex<::cuda::std::common_type_t<T0, T1>> pow(const T0& x, const complex<T1>& y)
|
| 43 |
+
{
|
| 44 |
+
using T = ::cuda::std::common_type_t<T0, T1>;
|
| 45 |
+
// Find `log` by ADL.
|
| 46 |
+
using std::log;
|
| 47 |
+
return exp(log(T(x)) * complex<T>(y));
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/cproj.h
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
|
| 22 |
+
#include <thrust/complex.h>
|
| 23 |
+
#include <thrust/detail/complex/math_private.h>
|
| 24 |
+
|
| 25 |
+
#include <cmath>
|
| 26 |
+
|
| 27 |
+
THRUST_NAMESPACE_BEGIN
|
| 28 |
+
namespace detail
|
| 29 |
+
{
|
| 30 |
+
namespace complex
|
| 31 |
+
{
|
| 32 |
+
_CCCL_HOST_DEVICE inline complex<float> cprojf(const complex<float>& z)
|
| 33 |
+
{
|
| 34 |
+
if (!isinf(z.real()) && !isinf(z.imag()))
|
| 35 |
+
{
|
| 36 |
+
return z;
|
| 37 |
+
}
|
| 38 |
+
else
|
| 39 |
+
{
|
| 40 |
+
// std::numeric_limits<T>::infinity() doesn't run on the GPU
|
| 41 |
+
return complex<float>(infinity<float>(), copysignf(0.0, z.imag()));
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
_CCCL_HOST_DEVICE inline complex<double> cproj(const complex<double>& z)
|
| 46 |
+
{
|
| 47 |
+
if (!isinf(z.real()) && !isinf(z.imag()))
|
| 48 |
+
{
|
| 49 |
+
return z;
|
| 50 |
+
}
|
| 51 |
+
else
|
| 52 |
+
{
|
| 53 |
+
// std::numeric_limits<T>::infinity() doesn't run on the GPU
|
| 54 |
+
return complex<double>(infinity<double>(), copysign(0.0, z.imag()));
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
} // namespace complex
|
| 59 |
+
|
| 60 |
+
} // namespace detail
|
| 61 |
+
|
| 62 |
+
template <typename T>
|
| 63 |
+
_CCCL_HOST_DEVICE inline thrust::complex<T> proj(const thrust::complex<T>& z)
|
| 64 |
+
{
|
| 65 |
+
return detail::complex::cproj(z);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
template <>
|
| 69 |
+
_CCCL_HOST_DEVICE inline thrust::complex<double> proj(const thrust::complex<double>& z)
|
| 70 |
+
{
|
| 71 |
+
return detail::complex::cproj(z);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
template <>
|
| 75 |
+
_CCCL_HOST_DEVICE inline thrust::complex<float> proj(const thrust::complex<float>& z)
|
| 76 |
+
{
|
| 77 |
+
return detail::complex::cprojf(z);
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csinh.h
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_csinh.c
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#pragma once
|
| 49 |
+
|
| 50 |
+
#include <thrust/detail/config.h>
|
| 51 |
+
|
| 52 |
+
#include <thrust/complex.h>
|
| 53 |
+
#include <thrust/detail/complex/cexp.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
THRUST_NAMESPACE_BEGIN
|
| 57 |
+
namespace detail
|
| 58 |
+
{
|
| 59 |
+
namespace complex
|
| 60 |
+
{
|
| 61 |
+
|
| 62 |
+
using thrust::complex;
|
| 63 |
+
|
| 64 |
+
_CCCL_HOST_DEVICE inline complex<double> csinh(const complex<double>& z)
|
| 65 |
+
{
|
| 66 |
+
double x, y, h;
|
| 67 |
+
uint32_t hx, hy, ix, iy, lx, ly;
|
| 68 |
+
const double huge = 8.98846567431157953864652595395e+307; // 0x1p1023;
|
| 69 |
+
|
| 70 |
+
x = z.real();
|
| 71 |
+
y = z.imag();
|
| 72 |
+
|
| 73 |
+
extract_words(hx, lx, x);
|
| 74 |
+
extract_words(hy, ly, y);
|
| 75 |
+
|
| 76 |
+
ix = 0x7fffffff & hx;
|
| 77 |
+
iy = 0x7fffffff & hy;
|
| 78 |
+
|
| 79 |
+
/* Handle the nearly-non-exceptional cases where x and y are finite. */
|
| 80 |
+
if (ix < 0x7ff00000 && iy < 0x7ff00000)
|
| 81 |
+
{
|
| 82 |
+
if ((iy | ly) == 0)
|
| 83 |
+
{
|
| 84 |
+
return (complex<double>(sinh(x), y));
|
| 85 |
+
}
|
| 86 |
+
if (ix < 0x40360000) /* small x: normal case */
|
| 87 |
+
{
|
| 88 |
+
return (complex<double>(sinh(x) * cos(y), cosh(x) * sin(y)));
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* |x| >= 22, so cosh(x) ~= exp(|x|) */
|
| 92 |
+
if (ix < 0x40862e42)
|
| 93 |
+
{
|
| 94 |
+
/* x < 710: exp(|x|) won't overflow */
|
| 95 |
+
h = exp(fabs(x)) * 0.5;
|
| 96 |
+
return (complex<double>(copysign(h, x) * cos(y), h * sin(y)));
|
| 97 |
+
}
|
| 98 |
+
else if (ix < 0x4096bbaa)
|
| 99 |
+
{
|
| 100 |
+
/* x < 1455: scale to avoid overflow */
|
| 101 |
+
complex<double> z_ = ldexp_cexp(complex<double>(fabs(x), y), -1);
|
| 102 |
+
return (complex<double>(z_.real() * copysign(1.0, x), z_.imag()));
|
| 103 |
+
}
|
| 104 |
+
else
|
| 105 |
+
{
|
| 106 |
+
/* x >= 1455: the result always overflows */
|
| 107 |
+
h = huge * x;
|
| 108 |
+
return (complex<double>(h * cos(y), h * h * sin(y)));
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
/*
|
| 113 |
+
* sinh(+-0 +- I Inf) = sign(d(+-0, dNaN))0 + I dNaN.
|
| 114 |
+
* The sign of 0 in the result is unspecified. Choice = normally
|
| 115 |
+
* the same as dNaN. Raise the invalid floating-point exception.
|
| 116 |
+
*
|
| 117 |
+
* sinh(+-0 +- I NaN) = sign(d(+-0, NaN))0 + I d(NaN).
|
| 118 |
+
* The sign of 0 in the result is unspecified. Choice = normally
|
| 119 |
+
* the same as d(NaN).
|
| 120 |
+
*/
|
| 121 |
+
if ((ix | lx) == 0 && iy >= 0x7ff00000)
|
| 122 |
+
{
|
| 123 |
+
return (complex<double>(copysign(0.0, x * (y - y)), y - y));
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
/*
|
| 127 |
+
* sinh(+-Inf +- I 0) = +-Inf + I +-0.
|
| 128 |
+
*
|
| 129 |
+
* sinh(NaN +- I 0) = d(NaN) + I +-0.
|
| 130 |
+
*/
|
| 131 |
+
if ((iy | ly) == 0 && ix >= 0x7ff00000)
|
| 132 |
+
{
|
| 133 |
+
if (((hx & 0xfffff) | lx) == 0)
|
| 134 |
+
{
|
| 135 |
+
return (complex<double>(x, y));
|
| 136 |
+
}
|
| 137 |
+
return (complex<double>(x, copysign(0.0, y)));
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/*
|
| 141 |
+
* sinh(x +- I Inf) = dNaN + I dNaN.
|
| 142 |
+
* Raise the invalid floating-point exception for finite nonzero x.
|
| 143 |
+
*
|
| 144 |
+
* sinh(x + I NaN) = d(NaN) + I d(NaN).
|
| 145 |
+
* Optionally raises the invalid floating-point exception for finite
|
| 146 |
+
* nonzero x. Choice = don't raise (except for signaling NaNs).
|
| 147 |
+
*/
|
| 148 |
+
if (ix < 0x7ff00000 && iy >= 0x7ff00000)
|
| 149 |
+
{
|
| 150 |
+
return (complex<double>(y - y, x * (y - y)));
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
/*
|
| 154 |
+
* sinh(+-Inf + I NaN) = +-Inf + I d(NaN).
|
| 155 |
+
* The sign of Inf in the result is unspecified. Choice = normally
|
| 156 |
+
* the same as d(NaN).
|
| 157 |
+
*
|
| 158 |
+
* sinh(+-Inf +- I Inf) = +Inf + I dNaN.
|
| 159 |
+
* The sign of Inf in the result is unspecified. Choice = always +.
|
| 160 |
+
* Raise the invalid floating-point exception.
|
| 161 |
+
*
|
| 162 |
+
* sinh(+-Inf + I y) = +-Inf cos(y) + I Inf sin(y)
|
| 163 |
+
*/
|
| 164 |
+
if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0)
|
| 165 |
+
{
|
| 166 |
+
if (iy >= 0x7ff00000)
|
| 167 |
+
{
|
| 168 |
+
return (complex<double>(x * x, x * (y - y)));
|
| 169 |
+
}
|
| 170 |
+
return (complex<double>(x * cos(y), infinity<double>() * sin(y)));
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
/*
|
| 174 |
+
* sinh(NaN + I NaN) = d(NaN) + I d(NaN).
|
| 175 |
+
*
|
| 176 |
+
* sinh(NaN +- I Inf) = d(NaN) + I d(NaN).
|
| 177 |
+
* Optionally raises the invalid floating-point exception.
|
| 178 |
+
* Choice = raise.
|
| 179 |
+
*
|
| 180 |
+
* sinh(NaN + I y) = d(NaN) + I d(NaN).
|
| 181 |
+
* Optionally raises the invalid floating-point exception for finite
|
| 182 |
+
* nonzero y. Choice = don't raise (except for signaling NaNs).
|
| 183 |
+
*/
|
| 184 |
+
return (complex<double>((x * x) * (y - y), (x + x) * (y - y)));
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
_CCCL_HOST_DEVICE inline complex<double> csin(complex<double> z)
|
| 188 |
+
{
|
| 189 |
+
/* csin(z) = -I * csinh(I * z) */
|
| 190 |
+
z = csinh(complex<double>(-z.imag(), z.real()));
|
| 191 |
+
return (complex<double>(z.imag(), -z.real()));
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
} // namespace complex
|
| 195 |
+
|
| 196 |
+
} // namespace detail
|
| 197 |
+
|
| 198 |
+
template <typename ValueType>
|
| 199 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> sin(const complex<ValueType>& z)
|
| 200 |
+
{
|
| 201 |
+
const ValueType re = z.real();
|
| 202 |
+
const ValueType im = z.imag();
|
| 203 |
+
return complex<ValueType>(std::sin(re) * std::cosh(im), std::cos(re) * std::sinh(im));
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
template <typename ValueType>
|
| 207 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> sinh(const complex<ValueType>& z)
|
| 208 |
+
{
|
| 209 |
+
const ValueType re = z.real();
|
| 210 |
+
const ValueType im = z.imag();
|
| 211 |
+
return complex<ValueType>(std::sinh(re) * std::cos(im), std::cosh(re) * std::sin(im));
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
template <>
|
| 215 |
+
_CCCL_HOST_DEVICE inline complex<double> sin(const complex<double>& z)
|
| 216 |
+
{
|
| 217 |
+
return detail::complex::csin(z);
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
template <>
|
| 221 |
+
_CCCL_HOST_DEVICE inline complex<double> sinh(const complex<double>& z)
|
| 222 |
+
{
|
| 223 |
+
return detail::complex::csinh(z);
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csinhf.h
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2005 Bruce D. Evans and Steven G. Kargl
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/* adapted from FreeBSD:
|
| 45 |
+
* lib/msun/src/s_csinhf.c
|
| 46 |
+
*/
|
| 47 |
+
|
| 48 |
+
#pragma once
|
| 49 |
+
|
| 50 |
+
#include <thrust/detail/config.h>
|
| 51 |
+
|
| 52 |
+
#include <thrust/complex.h>
|
| 53 |
+
#include <thrust/detail/complex/cexp.h>
|
| 54 |
+
#include <thrust/detail/complex/cexpf.h>
|
| 55 |
+
#include <thrust/detail/complex/math_private.h>
|
| 56 |
+
|
| 57 |
+
THRUST_NAMESPACE_BEGIN
|
| 58 |
+
namespace detail
|
| 59 |
+
{
|
| 60 |
+
namespace complex
|
| 61 |
+
{
|
| 62 |
+
|
| 63 |
+
using thrust::complex;
|
| 64 |
+
|
| 65 |
+
_CCCL_HOST_DEVICE inline complex<float> csinhf(const complex<float>& z)
|
| 66 |
+
{
|
| 67 |
+
float x, y, h;
|
| 68 |
+
uint32_t hx, hy, ix, iy;
|
| 69 |
+
|
| 70 |
+
const float huge = 1.70141183460469231731687303716e+38; // 0x1p127;
|
| 71 |
+
|
| 72 |
+
x = z.real();
|
| 73 |
+
y = z.imag();
|
| 74 |
+
|
| 75 |
+
get_float_word(hx, x);
|
| 76 |
+
get_float_word(hy, y);
|
| 77 |
+
|
| 78 |
+
ix = 0x7fffffff & hx;
|
| 79 |
+
iy = 0x7fffffff & hy;
|
| 80 |
+
|
| 81 |
+
if (ix < 0x7f800000 && iy < 0x7f800000)
|
| 82 |
+
{
|
| 83 |
+
if (iy == 0)
|
| 84 |
+
{
|
| 85 |
+
return (complex<float>(sinhf(x), y));
|
| 86 |
+
}
|
| 87 |
+
if (ix < 0x41100000) /* small x: normal case */
|
| 88 |
+
{
|
| 89 |
+
return (complex<float>(sinhf(x) * cosf(y), coshf(x) * sinf(y)));
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
/* |x| >= 9, so cosh(x) ~= exp(|x|) */
|
| 93 |
+
if (ix < 0x42b17218)
|
| 94 |
+
{
|
| 95 |
+
/* x < 88.7: expf(|x|) won't overflow */
|
| 96 |
+
h = expf(fabsf(x)) * 0.5f;
|
| 97 |
+
return (complex<float>(copysignf(h, x) * cosf(y), h * sinf(y)));
|
| 98 |
+
}
|
| 99 |
+
else if (ix < 0x4340b1e7)
|
| 100 |
+
{
|
| 101 |
+
/* x < 192.7: scale to avoid overflow */
|
| 102 |
+
complex<float> z_ = ldexp_cexpf(complex<float>(fabsf(x), y), -1);
|
| 103 |
+
return (complex<float>(z_.real() * copysignf(1.0f, x), z_.imag()));
|
| 104 |
+
}
|
| 105 |
+
else
|
| 106 |
+
{
|
| 107 |
+
/* x >= 192.7: the result always overflows */
|
| 108 |
+
h = huge * x;
|
| 109 |
+
return (complex<float>(h * cosf(y), h * h * sinf(y)));
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
if (ix == 0 && iy >= 0x7f800000)
|
| 114 |
+
{
|
| 115 |
+
return (complex<float>(copysignf(0, x * (y - y)), y - y));
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
if (iy == 0 && ix >= 0x7f800000)
|
| 119 |
+
{
|
| 120 |
+
if ((hx & 0x7fffff) == 0)
|
| 121 |
+
{
|
| 122 |
+
return (complex<float>(x, y));
|
| 123 |
+
}
|
| 124 |
+
return (complex<float>(x, copysignf(0.0f, y)));
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
if (ix < 0x7f800000 && iy >= 0x7f800000)
|
| 128 |
+
{
|
| 129 |
+
return (complex<float>(y - y, x * (y - y)));
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0)
|
| 133 |
+
{
|
| 134 |
+
if (iy >= 0x7f800000)
|
| 135 |
+
{
|
| 136 |
+
return (complex<float>(x * x, x * (y - y)));
|
| 137 |
+
}
|
| 138 |
+
return (complex<float>(x * cosf(y), infinity<float>() * sinf(y)));
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
return (complex<float>((x * x) * (y - y), (x + x) * (y - y)));
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
_CCCL_HOST_DEVICE inline complex<float> csinf(complex<float> z)
|
| 145 |
+
{
|
| 146 |
+
z = csinhf(complex<float>(-z.imag(), z.real()));
|
| 147 |
+
return (complex<float>(z.imag(), -z.real()));
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
} // namespace complex
|
| 151 |
+
|
| 152 |
+
} // namespace detail
|
| 153 |
+
|
| 154 |
+
template <>
|
| 155 |
+
_CCCL_HOST_DEVICE inline complex<float> sin(const complex<float>& z)
|
| 156 |
+
{
|
| 157 |
+
return detail::complex::csinf(z);
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
template <>
|
| 161 |
+
_CCCL_HOST_DEVICE inline complex<float> sinh(const complex<float>& z)
|
| 162 |
+
{
|
| 163 |
+
return detail::complex::csinhf(z);
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csqrt.h
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia <filipe.c.maia@gmail.com>:
|
| 46 |
+
* freebsd/lib/msun/src/s_csqrt.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#pragma once
|
| 50 |
+
|
| 51 |
+
#include <thrust/detail/config.h>
|
| 52 |
+
|
| 53 |
+
#include <thrust/complex.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
#include <cmath>
|
| 57 |
+
|
| 58 |
+
THRUST_NAMESPACE_BEGIN
|
| 59 |
+
namespace detail
|
| 60 |
+
{
|
| 61 |
+
namespace complex
|
| 62 |
+
{
|
| 63 |
+
|
| 64 |
+
using thrust::complex;
|
| 65 |
+
|
| 66 |
+
_CCCL_HOST_DEVICE inline complex<double> csqrt(const complex<double>& z)
|
| 67 |
+
{
|
| 68 |
+
complex<double> result;
|
| 69 |
+
double a, b;
|
| 70 |
+
double t;
|
| 71 |
+
int scale;
|
| 72 |
+
|
| 73 |
+
/* We risk spurious overflow for components >= DBL_MAX / (1 + sqrt(2)). */
|
| 74 |
+
const double THRESH = 7.446288774449766337959726e+307;
|
| 75 |
+
|
| 76 |
+
a = z.real();
|
| 77 |
+
b = z.imag();
|
| 78 |
+
|
| 79 |
+
/* Handle special cases. */
|
| 80 |
+
if (z == 0.0)
|
| 81 |
+
{
|
| 82 |
+
return (complex<double>(0.0, b));
|
| 83 |
+
}
|
| 84 |
+
if (isinf(b))
|
| 85 |
+
{
|
| 86 |
+
return (complex<double>(infinity<double>(), b));
|
| 87 |
+
}
|
| 88 |
+
if (isnan(a))
|
| 89 |
+
{
|
| 90 |
+
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
|
| 91 |
+
return (complex<double>(a, t)); /* return NaN + NaN i */
|
| 92 |
+
}
|
| 93 |
+
if (isinf(a))
|
| 94 |
+
{
|
| 95 |
+
/*
|
| 96 |
+
* csqrt(inf + NaN i) = inf + NaN i
|
| 97 |
+
* csqrt(inf + y i) = inf + 0 i
|
| 98 |
+
* csqrt(-inf + NaN i) = NaN +- inf i
|
| 99 |
+
* csqrt(-inf + y i) = 0 + inf i
|
| 100 |
+
*/
|
| 101 |
+
if (signbit(a))
|
| 102 |
+
{
|
| 103 |
+
return (complex<double>(fabs(b - b), copysign(a, b)));
|
| 104 |
+
}
|
| 105 |
+
else
|
| 106 |
+
{
|
| 107 |
+
return (complex<double>(a, copysign(b - b, b)));
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
/*
|
| 111 |
+
* The remaining special case (b is NaN) is handled just fine by
|
| 112 |
+
* the normal code path below.
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
// DBL_MIN*2
|
| 116 |
+
const double low_thresh = 4.450147717014402766180465e-308;
|
| 117 |
+
scale = 0;
|
| 118 |
+
|
| 119 |
+
if (fabs(a) >= THRESH || fabs(b) >= THRESH)
|
| 120 |
+
{
|
| 121 |
+
/* Scale to avoid overflow. */
|
| 122 |
+
a *= 0.25;
|
| 123 |
+
b *= 0.25;
|
| 124 |
+
scale = 1;
|
| 125 |
+
}
|
| 126 |
+
else if (fabs(a) <= low_thresh && fabs(b) <= low_thresh)
|
| 127 |
+
{
|
| 128 |
+
/* Scale to avoid underflow. */
|
| 129 |
+
a *= 4.0;
|
| 130 |
+
b *= 4.0;
|
| 131 |
+
scale = 2;
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
/* Algorithm 312, CACM vol 10, Oct 1967. */
|
| 135 |
+
if (a >= 0.0)
|
| 136 |
+
{
|
| 137 |
+
t = sqrt((a + hypot(a, b)) * 0.5);
|
| 138 |
+
result = complex<double>(t, b / (2 * t));
|
| 139 |
+
}
|
| 140 |
+
else
|
| 141 |
+
{
|
| 142 |
+
t = sqrt((-a + hypot(a, b)) * 0.5);
|
| 143 |
+
result = complex<double>(fabs(b) / (2 * t), copysign(t, b));
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
/* Rescale. */
|
| 147 |
+
if (scale == 1)
|
| 148 |
+
{
|
| 149 |
+
return (result * 2.0);
|
| 150 |
+
}
|
| 151 |
+
else if (scale == 2)
|
| 152 |
+
{
|
| 153 |
+
return (result * 0.5);
|
| 154 |
+
}
|
| 155 |
+
else
|
| 156 |
+
{
|
| 157 |
+
return (result);
|
| 158 |
+
}
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
} // namespace complex
|
| 162 |
+
|
| 163 |
+
} // namespace detail
|
| 164 |
+
|
| 165 |
+
template <typename ValueType>
|
| 166 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> sqrt(const complex<ValueType>& z)
|
| 167 |
+
{
|
| 168 |
+
return thrust::polar(std::sqrt(thrust::abs(z)), thrust::arg(z) / ValueType(2));
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
template <>
|
| 172 |
+
_CCCL_HOST_DEVICE inline complex<double> sqrt(const complex<double>& z)
|
| 173 |
+
{
|
| 174 |
+
return detail::complex::csqrt(z);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/csqrtf.h
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2007 David Schultz <das@FreeBSD.ORG>
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice, this list of conditions and the following disclaimer.
|
| 27 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 28 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 29 |
+
* documentation and/or other materials provided with the distribution.
|
| 30 |
+
*
|
| 31 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
| 32 |
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| 33 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
| 34 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
| 35 |
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
| 36 |
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
| 37 |
+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
| 38 |
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
| 39 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
| 40 |
+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
| 41 |
+
* SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia <filipe.c.maia@gmail.com>:
|
| 46 |
+
* freebsd/lib/msun/src/s_csqrt.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#pragma once
|
| 50 |
+
|
| 51 |
+
#include <thrust/detail/config.h>
|
| 52 |
+
|
| 53 |
+
#include <thrust/complex.h>
|
| 54 |
+
#include <thrust/detail/complex/math_private.h>
|
| 55 |
+
|
| 56 |
+
#include <cmath>
|
| 57 |
+
|
| 58 |
+
THRUST_NAMESPACE_BEGIN
|
| 59 |
+
namespace detail
|
| 60 |
+
{
|
| 61 |
+
namespace complex
|
| 62 |
+
{
|
| 63 |
+
|
| 64 |
+
using thrust::complex;
|
| 65 |
+
|
| 66 |
+
_CCCL_HOST_DEVICE inline complex<float> csqrtf(const complex<float>& z)
|
| 67 |
+
{
|
| 68 |
+
float a = z.real(), b = z.imag();
|
| 69 |
+
float t;
|
| 70 |
+
int scale;
|
| 71 |
+
complex<float> result;
|
| 72 |
+
|
| 73 |
+
/* We risk spurious overflow for components >= FLT_MAX / (1 + sqrt(2)). */
|
| 74 |
+
const float THRESH = 1.40949553037932e+38f;
|
| 75 |
+
|
| 76 |
+
/* Handle special cases. */
|
| 77 |
+
if (z == 0.0f)
|
| 78 |
+
{
|
| 79 |
+
return (complex<float>(0, b));
|
| 80 |
+
}
|
| 81 |
+
if (isinf(b))
|
| 82 |
+
{
|
| 83 |
+
return (complex<float>(infinity<float>(), b));
|
| 84 |
+
}
|
| 85 |
+
if (isnan(a))
|
| 86 |
+
{
|
| 87 |
+
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
|
| 88 |
+
return (complex<float>(a, t)); /* return NaN + NaN i */
|
| 89 |
+
}
|
| 90 |
+
if (isinf(a))
|
| 91 |
+
{
|
| 92 |
+
/*
|
| 93 |
+
* csqrtf(inf + NaN i) = inf + NaN i
|
| 94 |
+
* csqrtf(inf + y i) = inf + 0 i
|
| 95 |
+
* csqrtf(-inf + NaN i) = NaN +- inf i
|
| 96 |
+
* csqrtf(-inf + y i) = 0 + inf i
|
| 97 |
+
*/
|
| 98 |
+
if (signbit(a))
|
| 99 |
+
{
|
| 100 |
+
return (complex<float>(fabsf(b - b), copysignf(a, b)));
|
| 101 |
+
}
|
| 102 |
+
else
|
| 103 |
+
{
|
| 104 |
+
return (complex<float>(a, copysignf(b - b, b)));
|
| 105 |
+
}
|
| 106 |
+
}
|
| 107 |
+
/*
|
| 108 |
+
* The remaining special case (b is NaN) is handled just fine by
|
| 109 |
+
* the normal code path below.
|
| 110 |
+
*/
|
| 111 |
+
|
| 112 |
+
/*
|
| 113 |
+
* Unlike in the FreeBSD code we'll avoid using double precision as
|
| 114 |
+
* not all hardware supports it.
|
| 115 |
+
*/
|
| 116 |
+
|
| 117 |
+
// FLT_MIN*2
|
| 118 |
+
const float low_thresh = 2.35098870164458e-38f;
|
| 119 |
+
scale = 0;
|
| 120 |
+
|
| 121 |
+
if (fabsf(a) >= THRESH || fabsf(b) >= THRESH)
|
| 122 |
+
{
|
| 123 |
+
/* Scale to avoid overflow. */
|
| 124 |
+
a *= 0.25f;
|
| 125 |
+
b *= 0.25f;
|
| 126 |
+
scale = 1;
|
| 127 |
+
}
|
| 128 |
+
else if (fabsf(a) <= low_thresh && fabsf(b) <= low_thresh)
|
| 129 |
+
{
|
| 130 |
+
/* Scale to avoid underflow. */
|
| 131 |
+
a *= 4.f;
|
| 132 |
+
b *= 4.f;
|
| 133 |
+
scale = 2;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
/* Algorithm 312, CACM vol 10, Oct 1967. */
|
| 137 |
+
if (a >= 0.0f)
|
| 138 |
+
{
|
| 139 |
+
t = sqrtf((a + hypotf(a, b)) * 0.5f);
|
| 140 |
+
result = complex<float>(t, b / (2.0f * t));
|
| 141 |
+
}
|
| 142 |
+
else
|
| 143 |
+
{
|
| 144 |
+
t = sqrtf((-a + hypotf(a, b)) * 0.5f);
|
| 145 |
+
result = complex<float>(fabsf(b) / (2.0f * t), copysignf(t, b));
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
/* Rescale. */
|
| 149 |
+
if (scale == 1)
|
| 150 |
+
{
|
| 151 |
+
return (result * 2.0f);
|
| 152 |
+
}
|
| 153 |
+
else if (scale == 2)
|
| 154 |
+
{
|
| 155 |
+
return (result * 0.5f);
|
| 156 |
+
}
|
| 157 |
+
else
|
| 158 |
+
{
|
| 159 |
+
return (result);
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
} // namespace complex
|
| 164 |
+
|
| 165 |
+
} // namespace detail
|
| 166 |
+
|
| 167 |
+
template <>
|
| 168 |
+
_CCCL_HOST_DEVICE inline complex<float> sqrt(const complex<float>& z)
|
| 169 |
+
{
|
| 170 |
+
return detail::complex::csqrtf(z);
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ctanh.h
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2011 David Schultz
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia <filipe.c.maia@gmail.com>:
|
| 46 |
+
* freebsd/lib/msun/src/s_ctanh.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
/*
|
| 50 |
+
* Hyperbolic tangent of a complex argument z = x + i y.
|
| 51 |
+
*
|
| 52 |
+
* The algorithm is from:
|
| 53 |
+
*
|
| 54 |
+
* W. Kahan. Branch Cuts for Complex Elementary Functions or Much
|
| 55 |
+
* Ado About Nothing's Sign Bit. In The State of the Art in
|
| 56 |
+
* Numerical Analysis, pp. 165 ff. Iserles and Powell, eds., 1987.
|
| 57 |
+
*
|
| 58 |
+
* Method:
|
| 59 |
+
*
|
| 60 |
+
* Let t = tan(x)
|
| 61 |
+
* beta = 1/cos^2(y)
|
| 62 |
+
* s = sinh(x)
|
| 63 |
+
* rho = cosh(x)
|
| 64 |
+
*
|
| 65 |
+
* We have:
|
| 66 |
+
*
|
| 67 |
+
* tanh(z) = sinh(z) / cosh(z)
|
| 68 |
+
*
|
| 69 |
+
* sinh(x) cos(y) + i cosh(x) sin(y)
|
| 70 |
+
* = ---------------------------------
|
| 71 |
+
* cosh(x) cos(y) + i sinh(x) sin(y)
|
| 72 |
+
*
|
| 73 |
+
* cosh(x) sinh(x) / cos^2(y) + i tan(y)
|
| 74 |
+
* = -------------------------------------
|
| 75 |
+
* 1 + sinh^2(x) / cos^2(y)
|
| 76 |
+
*
|
| 77 |
+
* beta rho s + i t
|
| 78 |
+
* = ----------------
|
| 79 |
+
* 1 + beta s^2
|
| 80 |
+
*
|
| 81 |
+
* Modifications:
|
| 82 |
+
*
|
| 83 |
+
* I omitted the original algorithm's handling of overflow in tan(x) after
|
| 84 |
+
* verifying with nearpi.c that this can't happen in IEEE single or double
|
| 85 |
+
* precision. I also handle large x differently.
|
| 86 |
+
*/
|
| 87 |
+
|
| 88 |
+
#pragma once
|
| 89 |
+
|
| 90 |
+
#include <thrust/detail/config.h>
|
| 91 |
+
|
| 92 |
+
#include <thrust/complex.h>
|
| 93 |
+
#include <thrust/detail/complex/math_private.h>
|
| 94 |
+
|
| 95 |
+
#include <cmath>
|
| 96 |
+
|
| 97 |
+
THRUST_NAMESPACE_BEGIN
|
| 98 |
+
namespace detail
|
| 99 |
+
{
|
| 100 |
+
namespace complex
|
| 101 |
+
{
|
| 102 |
+
|
| 103 |
+
using thrust::complex;
|
| 104 |
+
|
| 105 |
+
_CCCL_HOST_DEVICE inline complex<double> ctanh(const complex<double>& z)
|
| 106 |
+
{
|
| 107 |
+
double x, y;
|
| 108 |
+
double t, beta, s, rho, denom;
|
| 109 |
+
uint32_t hx, ix, lx;
|
| 110 |
+
|
| 111 |
+
x = z.real();
|
| 112 |
+
y = z.imag();
|
| 113 |
+
|
| 114 |
+
extract_words(hx, lx, x);
|
| 115 |
+
ix = hx & 0x7fffffff;
|
| 116 |
+
|
| 117 |
+
/*
|
| 118 |
+
* ctanh(NaN + i 0) = NaN + i 0
|
| 119 |
+
*
|
| 120 |
+
* ctanh(NaN + i y) = NaN + i NaN for y != 0
|
| 121 |
+
*
|
| 122 |
+
* The imaginary part has the sign of x*sin(2*y), but there's no
|
| 123 |
+
* special effort to get this right.
|
| 124 |
+
*
|
| 125 |
+
* ctanh(+-Inf +- i Inf) = +-1 +- 0
|
| 126 |
+
*
|
| 127 |
+
* ctanh(+-Inf + i y) = +-1 + 0 sin(2y) for y finite
|
| 128 |
+
*
|
| 129 |
+
* The imaginary part of the sign is unspecified. This special
|
| 130 |
+
* case is only needed to avoid a spurious invalid exception when
|
| 131 |
+
* y is infinite.
|
| 132 |
+
*/
|
| 133 |
+
if (ix >= 0x7ff00000)
|
| 134 |
+
{
|
| 135 |
+
if ((ix & 0xfffff) | lx) /* x is NaN */
|
| 136 |
+
{
|
| 137 |
+
return (complex<double>(x, (y == 0 ? y : x * y)));
|
| 138 |
+
}
|
| 139 |
+
set_high_word(x, hx - 0x40000000); /* x = copysign(1, x) */
|
| 140 |
+
return (complex<double>(x, copysign(0.0, isinf(y) ? y : sin(y) * cos(y))));
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* ctanh(x + i NAN) = NaN + i NaN
|
| 145 |
+
* ctanh(x +- i Inf) = NaN + i NaN
|
| 146 |
+
*/
|
| 147 |
+
if (!isfinite(y))
|
| 148 |
+
{
|
| 149 |
+
return (complex<double>(y - y, y - y));
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
/*
|
| 153 |
+
* ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the
|
| 154 |
+
* approximation sinh^2(huge) ~= exp(2*huge) / 4.
|
| 155 |
+
* We use a modified formula to avoid spurious overflow.
|
| 156 |
+
*/
|
| 157 |
+
if (ix >= 0x40360000)
|
| 158 |
+
{ /* x >= 22 */
|
| 159 |
+
double exp_mx = exp(-fabs(x));
|
| 160 |
+
return (complex<double>(copysign(1.0, x), 4.0 * sin(y) * cos(y) * exp_mx * exp_mx));
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
/* Kahan's algorithm */
|
| 164 |
+
t = tan(y);
|
| 165 |
+
beta = 1.0 + t * t; /* = 1 / cos^2(y) */
|
| 166 |
+
s = sinh(x);
|
| 167 |
+
rho = sqrt(1.0 + s * s); /* = cosh(x) */
|
| 168 |
+
denom = 1.0 + beta * s * s;
|
| 169 |
+
return (complex<double>((beta * rho * s) / denom, t / denom));
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
_CCCL_HOST_DEVICE inline complex<double> ctan(complex<double> z)
|
| 173 |
+
{
|
| 174 |
+
/* ctan(z) = -I * ctanh(I * z) */
|
| 175 |
+
z = ctanh(complex<double>(-z.imag(), z.real()));
|
| 176 |
+
return (complex<double>(z.imag(), -z.real()));
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
} // namespace complex
|
| 180 |
+
|
| 181 |
+
} // namespace detail
|
| 182 |
+
|
| 183 |
+
template <typename ValueType>
|
| 184 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> tan(const complex<ValueType>& z)
|
| 185 |
+
{
|
| 186 |
+
return sin(z) / cos(z);
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
template <typename ValueType>
|
| 190 |
+
_CCCL_HOST_DEVICE inline complex<ValueType> tanh(const complex<ValueType>& z)
|
| 191 |
+
{
|
| 192 |
+
// This implementation seems better than the simple sin/cos
|
| 193 |
+
return (thrust::exp(ValueType(2) * z) - ValueType(1)) / (thrust::exp(ValueType(2) * z) + ValueType(1));
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
template <>
|
| 197 |
+
_CCCL_HOST_DEVICE inline complex<double> tan(const complex<double>& z)
|
| 198 |
+
{
|
| 199 |
+
return detail::complex::ctan(z);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
template <>
|
| 203 |
+
_CCCL_HOST_DEVICE inline complex<double> tanh(const complex<double>& z)
|
| 204 |
+
{
|
| 205 |
+
return detail::complex::ctanh(z);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/ctanhf.h
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*-
|
| 19 |
+
* Copyright (c) 2011 David Schultz
|
| 20 |
+
* All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Redistribution and use in source and binary forms, with or without
|
| 23 |
+
* modification, are permitted provided that the following conditions
|
| 24 |
+
* are met:
|
| 25 |
+
* 1. Redistributions of source code must retain the above copyright
|
| 26 |
+
* notice unmodified, this list of conditions, and the following
|
| 27 |
+
* disclaimer.
|
| 28 |
+
* 2. Redistributions in binary form must reproduce the above copyright
|
| 29 |
+
* notice, this list of conditions and the following disclaimer in the
|
| 30 |
+
* documentation and/or other materials provided with the distribution.
|
| 31 |
+
*
|
| 32 |
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
| 33 |
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
| 34 |
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
| 35 |
+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
| 36 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
| 37 |
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
| 38 |
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
| 39 |
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| 40 |
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
| 41 |
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/*
|
| 45 |
+
* Adapted from FreeBSD by Filipe Maia, filipe.c.maia@gmail.com:
|
| 46 |
+
* freebsd/lib/msun/src/s_ctanhf.c
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
/*
|
| 50 |
+
* Hyperbolic tangent of a complex argument z. See ctanh.c for details.
|
| 51 |
+
*/
|
| 52 |
+
|
| 53 |
+
#pragma once
|
| 54 |
+
|
| 55 |
+
#include <thrust/detail/config.h>
|
| 56 |
+
|
| 57 |
+
#include <thrust/complex.h>
|
| 58 |
+
#include <thrust/detail/complex/math_private.h>
|
| 59 |
+
|
| 60 |
+
#include <cmath>
|
| 61 |
+
|
| 62 |
+
THRUST_NAMESPACE_BEGIN
|
| 63 |
+
namespace detail
|
| 64 |
+
{
|
| 65 |
+
namespace complex
|
| 66 |
+
{
|
| 67 |
+
|
| 68 |
+
using thrust::complex;
|
| 69 |
+
|
| 70 |
+
_CCCL_HOST_DEVICE inline complex<float> ctanhf(const complex<float>& z)
|
| 71 |
+
{
|
| 72 |
+
float x, y;
|
| 73 |
+
float t, beta, s, rho, denom;
|
| 74 |
+
uint32_t hx, ix;
|
| 75 |
+
|
| 76 |
+
x = z.real();
|
| 77 |
+
y = z.imag();
|
| 78 |
+
|
| 79 |
+
get_float_word(hx, x);
|
| 80 |
+
ix = hx & 0x7fffffff;
|
| 81 |
+
|
| 82 |
+
if (ix >= 0x7f800000)
|
| 83 |
+
{
|
| 84 |
+
if (ix & 0x7fffff)
|
| 85 |
+
{
|
| 86 |
+
return (complex<float>(x, (y == 0.0f ? y : x * y)));
|
| 87 |
+
}
|
| 88 |
+
set_float_word(x, hx - 0x40000000);
|
| 89 |
+
return (complex<float>(x, copysignf(0, isinf(y) ? y : sinf(y) * cosf(y))));
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
if (!isfinite(y))
|
| 93 |
+
{
|
| 94 |
+
return (complex<float>(y - y, y - y));
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
if (ix >= 0x41300000)
|
| 98 |
+
{ /* x >= 11 */
|
| 99 |
+
float exp_mx = expf(-fabsf(x));
|
| 100 |
+
return (complex<float>(copysignf(1.0f, x), 4.0f * sinf(y) * cosf(y) * exp_mx * exp_mx));
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
t = tanf(y);
|
| 104 |
+
beta = 1.0f + t * t;
|
| 105 |
+
s = sinhf(x);
|
| 106 |
+
rho = sqrtf(1.0f + s * s);
|
| 107 |
+
denom = 1.0f + beta * s * s;
|
| 108 |
+
return (complex<float>((beta * rho * s) / denom, t / denom));
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
_CCCL_HOST_DEVICE inline complex<float> ctanf(complex<float> z)
|
| 112 |
+
{
|
| 113 |
+
z = ctanhf(complex<float>(-z.imag(), z.real()));
|
| 114 |
+
return (complex<float>(z.imag(), -z.real()));
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
} // namespace complex
|
| 118 |
+
|
| 119 |
+
} // namespace detail
|
| 120 |
+
|
| 121 |
+
template <>
|
| 122 |
+
_CCCL_HOST_DEVICE inline complex<float> tan(const complex<float>& z)
|
| 123 |
+
{
|
| 124 |
+
return detail::complex::ctanf(z);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
template <>
|
| 128 |
+
_CCCL_HOST_DEVICE inline complex<float> tanh(const complex<float>& z)
|
| 129 |
+
{
|
| 130 |
+
return detail::complex::ctanhf(z);
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/math_private.h
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* ====================================================
|
| 20 |
+
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
| 21 |
+
*
|
| 22 |
+
* Developed at SunPro, a Sun Microsystems, Inc. business.
|
| 23 |
+
* Permission to use, copy, modify, and distribute this
|
| 24 |
+
* software is freely granted, provided that this notice
|
| 25 |
+
* is preserved.
|
| 26 |
+
* ====================================================
|
| 27 |
+
*/
|
| 28 |
+
|
| 29 |
+
/* adapted from FreeBSD:
|
| 30 |
+
* lib/msun/src/math_private.h
|
| 31 |
+
*/
|
| 32 |
+
#pragma once
|
| 33 |
+
|
| 34 |
+
#include <thrust/detail/config.h>
|
| 35 |
+
|
| 36 |
+
#include <thrust/complex.h>
|
| 37 |
+
|
| 38 |
+
#include <cstdint>
|
| 39 |
+
|
| 40 |
+
THRUST_NAMESPACE_BEGIN
|
| 41 |
+
namespace detail
|
| 42 |
+
{
|
| 43 |
+
namespace complex
|
| 44 |
+
{
|
| 45 |
+
|
| 46 |
+
using thrust::complex;
|
| 47 |
+
|
| 48 |
+
using ieee_float_shape_type = union
|
| 49 |
+
{
|
| 50 |
+
float value;
|
| 51 |
+
uint32_t word;
|
| 52 |
+
};
|
| 53 |
+
|
| 54 |
+
_CCCL_HOST_DEVICE inline void get_float_word(uint32_t& i, float d)
|
| 55 |
+
{
|
| 56 |
+
ieee_float_shape_type gf_u;
|
| 57 |
+
gf_u.value = (d);
|
| 58 |
+
(i) = gf_u.word;
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
_CCCL_HOST_DEVICE inline void get_float_word(int32_t& i, float d)
|
| 62 |
+
{
|
| 63 |
+
ieee_float_shape_type gf_u;
|
| 64 |
+
gf_u.value = (d);
|
| 65 |
+
(i) = gf_u.word;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
_CCCL_HOST_DEVICE inline void set_float_word(float& d, uint32_t i)
|
| 69 |
+
{
|
| 70 |
+
ieee_float_shape_type sf_u;
|
| 71 |
+
sf_u.word = (i);
|
| 72 |
+
(d) = sf_u.value;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// Assumes little endian ordering
|
| 76 |
+
using ieee_double_shape_type = union
|
| 77 |
+
{
|
| 78 |
+
double value;
|
| 79 |
+
struct
|
| 80 |
+
{
|
| 81 |
+
uint32_t lsw;
|
| 82 |
+
uint32_t msw;
|
| 83 |
+
} parts;
|
| 84 |
+
struct
|
| 85 |
+
{
|
| 86 |
+
uint64_t w;
|
| 87 |
+
} xparts;
|
| 88 |
+
};
|
| 89 |
+
|
| 90 |
+
_CCCL_HOST_DEVICE inline void get_high_word(uint32_t& i, double d)
|
| 91 |
+
{
|
| 92 |
+
ieee_double_shape_type gh_u;
|
| 93 |
+
gh_u.value = (d);
|
| 94 |
+
(i) = gh_u.parts.msw;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
/* Set the more significant 32 bits of a double from an int. */
|
| 98 |
+
_CCCL_HOST_DEVICE inline void set_high_word(double& d, uint32_t v)
|
| 99 |
+
{
|
| 100 |
+
ieee_double_shape_type sh_u;
|
| 101 |
+
sh_u.value = (d);
|
| 102 |
+
sh_u.parts.msw = (v);
|
| 103 |
+
(d) = sh_u.value;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
_CCCL_HOST_DEVICE inline void insert_words(double& d, uint32_t ix0, uint32_t ix1)
|
| 107 |
+
{
|
| 108 |
+
ieee_double_shape_type iw_u;
|
| 109 |
+
iw_u.parts.msw = (ix0);
|
| 110 |
+
iw_u.parts.lsw = (ix1);
|
| 111 |
+
(d) = iw_u.value;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
/* Get two 32 bit ints from a double. */
|
| 115 |
+
_CCCL_HOST_DEVICE inline void extract_words(uint32_t& ix0, uint32_t& ix1, double d)
|
| 116 |
+
{
|
| 117 |
+
ieee_double_shape_type ew_u;
|
| 118 |
+
ew_u.value = (d);
|
| 119 |
+
(ix0) = ew_u.parts.msw;
|
| 120 |
+
(ix1) = ew_u.parts.lsw;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
/* Get two 32 bit ints from a double. */
|
| 124 |
+
_CCCL_HOST_DEVICE inline void extract_words(int32_t& ix0, int32_t& ix1, double d)
|
| 125 |
+
{
|
| 126 |
+
ieee_double_shape_type ew_u;
|
| 127 |
+
ew_u.value = (d);
|
| 128 |
+
(ix0) = ew_u.parts.msw;
|
| 129 |
+
(ix1) = ew_u.parts.lsw;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
} // namespace complex
|
| 133 |
+
|
| 134 |
+
} // namespace detail
|
| 135 |
+
|
| 136 |
+
THRUST_NAMESPACE_END
|
| 137 |
+
|
| 138 |
+
#include <thrust/detail/complex/c99math.h>
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/complex/stream.h
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2021 NVIDIA Corporation
|
| 3 |
+
* Copyright 2013 Filipe RNC Maia
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
#pragma once
|
| 19 |
+
|
| 20 |
+
#include <thrust/detail/config.h>
|
| 21 |
+
|
| 22 |
+
#include <thrust/complex.h>
|
| 23 |
+
|
| 24 |
+
THRUST_NAMESPACE_BEGIN
|
| 25 |
+
template <typename ValueType, class charT, class traits>
|
| 26 |
+
std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const complex<ValueType>& z)
|
| 27 |
+
{
|
| 28 |
+
os << '(' << z.real() << ',' << z.imag() << ')';
|
| 29 |
+
return os;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
template <typename ValueType, typename charT, class traits>
|
| 33 |
+
std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, complex<ValueType>& z)
|
| 34 |
+
{
|
| 35 |
+
ValueType re, im;
|
| 36 |
+
|
| 37 |
+
charT ch;
|
| 38 |
+
is >> ch;
|
| 39 |
+
|
| 40 |
+
if (ch == '(')
|
| 41 |
+
{
|
| 42 |
+
is >> re >> ch;
|
| 43 |
+
if (ch == ',')
|
| 44 |
+
{
|
| 45 |
+
is >> im >> ch;
|
| 46 |
+
if (ch == ')')
|
| 47 |
+
{
|
| 48 |
+
z = complex<ValueType>(re, im);
|
| 49 |
+
}
|
| 50 |
+
else
|
| 51 |
+
{
|
| 52 |
+
is.setstate(std::ios_base::failbit);
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
else if (ch == ')')
|
| 56 |
+
{
|
| 57 |
+
z = re;
|
| 58 |
+
}
|
| 59 |
+
else
|
| 60 |
+
{
|
| 61 |
+
is.setstate(std::ios_base::failbit);
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
else
|
| 65 |
+
{
|
| 66 |
+
is.putback(ch);
|
| 67 |
+
is >> re;
|
| 68 |
+
z = re;
|
| 69 |
+
}
|
| 70 |
+
return is;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
THRUST_NAMESPACE_END
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/compiler.h
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file compiler.h
|
| 18 |
+
* \brief Compiler-specific configuration
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
// Internal config header that is only included through thrust/detail/config/config.h
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
|
| 33 |
+
// enumerate host compilers we know about
|
| 34 |
+
//! deprecated [Since 2.7]
|
| 35 |
+
#define THRUST_HOST_COMPILER_UNKNOWN 0
|
| 36 |
+
//! deprecated [Since 2.7]
|
| 37 |
+
#define THRUST_HOST_COMPILER_MSVC 1
|
| 38 |
+
//! deprecated [Since 2.7]
|
| 39 |
+
#define THRUST_HOST_COMPILER_GCC 2
|
| 40 |
+
//! deprecated [Since 2.7]
|
| 41 |
+
#define THRUST_HOST_COMPILER_CLANG 3
|
| 42 |
+
//! deprecated [Since 2.7]
|
| 43 |
+
#define THRUST_HOST_COMPILER_INTEL 4
|
| 44 |
+
|
| 45 |
+
// enumerate device compilers we know about
|
| 46 |
+
//! deprecated [Since 2.7]
|
| 47 |
+
#define THRUST_DEVICE_COMPILER_UNKNOWN 0
|
| 48 |
+
//! deprecated [Since 2.7]
|
| 49 |
+
#define THRUST_DEVICE_COMPILER_MSVC 1
|
| 50 |
+
//! deprecated [Since 2.7]
|
| 51 |
+
#define THRUST_DEVICE_COMPILER_GCC 2
|
| 52 |
+
//! deprecated [Since 2.7]
|
| 53 |
+
#define THRUST_DEVICE_COMPILER_CLANG 3
|
| 54 |
+
//! deprecated [Since 2.7]
|
| 55 |
+
#define THRUST_DEVICE_COMPILER_NVCC 4
|
| 56 |
+
|
| 57 |
+
// figure out which host compiler we're using
|
| 58 |
+
#if _CCCL_COMPILER(MSVC)
|
| 59 |
+
//! deprecated [Since 2.7]
|
| 60 |
+
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC
|
| 61 |
+
//! deprecated [Since 2.7]
|
| 62 |
+
# define THRUST_MSVC_VERSION _MSC_VER
|
| 63 |
+
//! deprecated [Since 2.7]
|
| 64 |
+
# define THRUST_MSVC_VERSION_FULL _MSC_FULL_VER
|
| 65 |
+
#elif _CCCL_COMPILER(ICC)
|
| 66 |
+
//! deprecated [Since 2.7]
|
| 67 |
+
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL
|
| 68 |
+
#elif _CCCL_COMPILER(CLANG)
|
| 69 |
+
//! deprecated [Since 2.7]
|
| 70 |
+
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_CLANG
|
| 71 |
+
//! deprecated [Since 2.7]
|
| 72 |
+
# define THRUST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
| 73 |
+
#elif _CCCL_COMPILER(GCC)
|
| 74 |
+
//! deprecated [Since 2.7]
|
| 75 |
+
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_GCC
|
| 76 |
+
//! deprecated [Since 2.7]
|
| 77 |
+
# define THRUST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
| 78 |
+
# if _CCCL_COMPILER(GCC, >=, 5)
|
| 79 |
+
//! deprecated [Since 2.7]
|
| 80 |
+
# define THRUST_MODERN_GCC
|
| 81 |
+
# else
|
| 82 |
+
//! deprecated [Since 2.7]
|
| 83 |
+
# define THRUST_LEGACY_GCC
|
| 84 |
+
# endif
|
| 85 |
+
#else
|
| 86 |
+
//! deprecated [Since 2.7]
|
| 87 |
+
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_UNKNOWN
|
| 88 |
+
#endif // TRUST_HOST_COMPILER
|
| 89 |
+
|
| 90 |
+
// figure out which device compiler we're using
|
| 91 |
+
#if defined(__CUDACC__) || defined(_NVHPC_CUDA)
|
| 92 |
+
//! deprecated [Since 2.7]
|
| 93 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
|
| 94 |
+
#elif _CCCL_COMPILER(MSVC)
|
| 95 |
+
//! deprecated [Since 2.7]
|
| 96 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC
|
| 97 |
+
#elif _CCCL_COMPILER(GCC)
|
| 98 |
+
//! deprecated [Since 2.7]
|
| 99 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_GCC
|
| 100 |
+
#elif _CCCL_COMPILER(CLANG)
|
| 101 |
+
// CUDA-capable clang should behave similar to NVCC.
|
| 102 |
+
# if defined(__CUDA__)
|
| 103 |
+
//! deprecated [Since 2.7]
|
| 104 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
|
| 105 |
+
# else
|
| 106 |
+
//! deprecated [Since 2.7]
|
| 107 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG
|
| 108 |
+
# endif
|
| 109 |
+
#else
|
| 110 |
+
//! deprecated [Since 2.7]
|
| 111 |
+
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_UNKNOWN
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
// is the device compiler capable of compiling omp?
|
| 115 |
+
#if defined(_OPENMP) || defined(_NVHPC_STDPAR_OPENMP)
|
| 116 |
+
# define THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE THRUST_TRUE
|
| 117 |
+
#else
|
| 118 |
+
# define THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE THRUST_FALSE
|
| 119 |
+
#endif // _OPENMP
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/compiler_fence.h
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
#include <thrust/detail/config.h>
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#include <thrust/detail/preprocessor.h>
|
| 30 |
+
|
| 31 |
+
#if _CCCL_COMPILER(MSVC)
|
| 32 |
+
# pragma message( \
|
| 33 |
+
"warning: The functionality in this header is unsafe, deprecated, and will soon be removed. Use C++11 atomics instead.")
|
| 34 |
+
#else
|
| 35 |
+
#warning The functionality in this header is unsafe, deprecated, and will soon be removed. Use C++11 or C11 atomics instead.
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
// msvc case
|
| 39 |
+
#if _CCCL_COMPILER(MSVC)
|
| 40 |
+
|
| 41 |
+
# ifndef _DEBUG
|
| 42 |
+
|
| 43 |
+
# include <intrin.h>
|
| 44 |
+
# pragma intrinsic(_ReadWriteBarrier)
|
| 45 |
+
# define __thrust_compiler_fence() _ReadWriteBarrier()
|
| 46 |
+
# else
|
| 47 |
+
|
| 48 |
+
# define __thrust_compiler_fence() \
|
| 49 |
+
do \
|
| 50 |
+
{ \
|
| 51 |
+
} while (0)
|
| 52 |
+
|
| 53 |
+
# endif // _DEBUG
|
| 54 |
+
|
| 55 |
+
// gcc case
|
| 56 |
+
#elif _CCCL_COMPILER(GCC)
|
| 57 |
+
|
| 58 |
+
# if _CCCL_COMPILER(GCC, >=, 4, 2) // atomic built-ins were introduced ~4.2
|
| 59 |
+
# define __thrust_compiler_fence() __sync_synchronize()
|
| 60 |
+
# else
|
| 61 |
+
// allow the code to compile without any guarantees
|
| 62 |
+
# define __thrust_compiler_fence() \
|
| 63 |
+
do \
|
| 64 |
+
{ \
|
| 65 |
+
} while (0)
|
| 66 |
+
# endif // _CCCL_COMPILER(GCC, >=, 4, 2)
|
| 67 |
+
|
| 68 |
+
// unknown case
|
| 69 |
+
#elif _CCCL_COMPILER(CLANG)
|
| 70 |
+
# define __thrust_compiler_fence() __sync_synchronize()
|
| 71 |
+
#else
|
| 72 |
+
|
| 73 |
+
// allow the code to compile without any guarantees
|
| 74 |
+
# define __thrust_compiler_fence() \
|
| 75 |
+
do \
|
| 76 |
+
{ \
|
| 77 |
+
} while (0)
|
| 78 |
+
|
| 79 |
+
#endif
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/config.h
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file config.h
|
| 18 |
+
* \brief Defines platform configuration.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
// For _CCCL_IMPLICIT_SYSTEM_HEADER
|
| 24 |
+
#include <cuda/__cccl_config> // IWYU pragma: export
|
| 25 |
+
|
| 26 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 27 |
+
# pragma GCC system_header
|
| 28 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 29 |
+
# pragma clang system_header
|
| 30 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 31 |
+
# pragma system_header
|
| 32 |
+
#endif // no system header
|
| 33 |
+
|
| 34 |
+
// NOTE: The order of these #includes matters.
|
| 35 |
+
|
| 36 |
+
#include <thrust/detail/config/compiler.h> // IWYU pragma: export
|
| 37 |
+
#include <thrust/detail/config/cpp_compatibility.h> // IWYU pragma: export
|
| 38 |
+
#include <thrust/detail/config/cpp_dialect.h> // IWYU pragma: export
|
| 39 |
+
#include <thrust/detail/config/simple_defines.h> // IWYU pragma: export
|
| 40 |
+
// host_system.h & device_system.h must be #included as early as possible because other config headers depend on it
|
| 41 |
+
#include <thrust/detail/config/host_system.h> // IWYU pragma: export
|
| 42 |
+
|
| 43 |
+
#include <thrust/detail/config/device_system.h> // IWYU pragma: export
|
| 44 |
+
#include <thrust/detail/config/global_workarounds.h> // IWYU pragma: export
|
| 45 |
+
#include <thrust/detail/config/namespace.h> // IWYU pragma: export
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/cpp_compatibility.h
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2018 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
// Internal config header that is only included through thrust/detail/config/config.h
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// deprecated [Since 2.8.0]
|
| 30 |
+
#define THRUST_NODISCARD _CCCL_NODISCARD
|
| 31 |
+
// deprecated [Since 2.8.0]
|
| 32 |
+
#define THRUST_INLINE_CONSTANT _CCCL_GLOBAL_CONSTANT
|
| 33 |
+
// deprecated [Since 2.8.0]
|
| 34 |
+
#define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr
|
| 35 |
+
|
| 36 |
+
// These definitions were intended for internal use only and are now obsolete.
|
| 37 |
+
// If you relied on them, consider porting your code to use the functionality
|
| 38 |
+
// in libcu++'s <nv/target> header.
|
| 39 |
+
// For a temporary workaround, define THRUST_PROVIDE_LEGACY_ARCH_MACROS to make
|
| 40 |
+
// them available again. These should be considered deprecated and will be
|
| 41 |
+
// fully removed in a future version.
|
| 42 |
+
#ifdef THRUST_PROVIDE_LEGACY_ARCH_MACROS
|
| 43 |
+
# ifndef THRUST_IS_DEVICE_CODE
|
| 44 |
+
# if defined(_NVHPC_CUDA)
|
| 45 |
+
# define THRUST_IS_DEVICE_CODE __builtin_is_device_code()
|
| 46 |
+
# define THRUST_IS_HOST_CODE (!__builtin_is_device_code())
|
| 47 |
+
# define THRUST_INCLUDE_DEVICE_CODE 1
|
| 48 |
+
# define THRUST_INCLUDE_HOST_CODE 1
|
| 49 |
+
# elif defined(__CUDA_ARCH__)
|
| 50 |
+
# define THRUST_IS_DEVICE_CODE 1
|
| 51 |
+
# define THRUST_IS_HOST_CODE 0
|
| 52 |
+
# define THRUST_INCLUDE_DEVICE_CODE 1
|
| 53 |
+
# define THRUST_INCLUDE_HOST_CODE 0
|
| 54 |
+
# else
|
| 55 |
+
# define THRUST_IS_DEVICE_CODE 0
|
| 56 |
+
# define THRUST_IS_HOST_CODE 1
|
| 57 |
+
# define THRUST_INCLUDE_DEVICE_CODE 0
|
| 58 |
+
# define THRUST_INCLUDE_HOST_CODE 1
|
| 59 |
+
# endif
|
| 60 |
+
# endif
|
| 61 |
+
#endif // THRUST_PROVIDE_LEGACY_ARCH_MACROS
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/cpp_dialect.h
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
/*! \file cpp_dialect.h
|
| 18 |
+
* \brief Detect the version of the C++ standard used by the compiler.
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#pragma once
|
| 22 |
+
|
| 23 |
+
#include <thrust/detail/config/config.h>
|
| 24 |
+
|
| 25 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 26 |
+
# pragma GCC system_header
|
| 27 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 28 |
+
# pragma clang system_header
|
| 29 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 30 |
+
# pragma system_header
|
| 31 |
+
#endif // no system header
|
| 32 |
+
|
| 33 |
+
#include <thrust/detail/config/compiler.h> // IWYU pragma: export
|
| 34 |
+
|
| 35 |
+
// Deprecation warnings may be silenced by defining the following macros. These
|
| 36 |
+
// may be combined.
|
| 37 |
+
// - CCCL_IGNORE_DEPRECATED_CPP_DIALECT:
|
| 38 |
+
// Ignore all deprecated C++ dialects and outdated compilers.
|
| 39 |
+
// - CCCL_IGNORE_DEPRECATED_CPP_11:
|
| 40 |
+
// Ignore deprecation warnings when compiling with C++11. C++03 and outdated
|
| 41 |
+
// compilers will still issue warnings.
|
| 42 |
+
// - CCCL_IGNORE_DEPRECATED_CPP_14:
|
| 43 |
+
// Ignore deprecation warnings when compiling with C++14. C++03 and outdated
|
| 44 |
+
// compilers will still issue warnings.
|
| 45 |
+
// - CCCL_IGNORE_DEPRECATED_COMPILER
|
| 46 |
+
// Ignore deprecation warnings when using deprecated compilers. Compiling
|
| 47 |
+
// with C++03, C++11 and C++14 will still issue warnings.
|
| 48 |
+
|
| 49 |
+
#define THRUST_CPP_DIALECT _CCCL_STD_VER
|
| 50 |
+
|
| 51 |
+
// Define THRUST_COMPILER_DEPRECATION macro:
|
| 52 |
+
#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC)
|
| 53 |
+
# define THRUST_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(message(__FILE__ ":" _CCCL_TO_STRING(__LINE__) ": warning: " #msg))
|
| 54 |
+
#else // clang / gcc:
|
| 55 |
+
# define THRUST_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(GCC warning #msg)
|
| 56 |
+
#endif
|
| 57 |
+
|
| 58 |
+
// clang-format off
|
| 59 |
+
#define THRUST_COMPILER_DEPRECATION(REQ) \
|
| 60 |
+
THRUST_COMP_DEPR_IMPL(Thrust requires at least REQ. Define CCCL_IGNORE_DEPRECATED_COMPILER to suppress this message.)
|
| 61 |
+
|
| 62 |
+
#define THRUST_COMPILER_DEPRECATION_SOFT(REQ, CUR) \
|
| 63 |
+
THRUST_COMP_DEPR_IMPL( \
|
| 64 |
+
Thrust requires at least REQ. CUR is deprecated but still supported. CUR support will be removed in a \
|
| 65 |
+
future release. Define CCCL_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message.)
|
| 66 |
+
// clang-format on
|
| 67 |
+
|
| 68 |
+
#ifndef CCCL_IGNORE_DEPRECATED_COMPILER
|
| 69 |
+
|
| 70 |
+
// Compiler checks:
|
| 71 |
+
# if _CCCL_COMPILER(GCC, <, 5)
|
| 72 |
+
THRUST_COMPILER_DEPRECATION(GCC 5.0);
|
| 73 |
+
# elif _CCCL_COMPILER(CLANG, <, 7)
|
| 74 |
+
THRUST_COMPILER_DEPRECATION(Clang 7.0);
|
| 75 |
+
# elif _CCCL_COMPILER(MSVC, <, 19, 10)
|
| 76 |
+
// <2017. Hard upgrade message:
|
| 77 |
+
THRUST_COMPILER_DEPRECATION(MSVC 2019(19.20 / 16.0 / 14.20));
|
| 78 |
+
# elif _CCCL_COMPILER(MSVC2017)
|
| 79 |
+
// >=2017, <2019. Soft deprecation message:
|
| 80 |
+
THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017);
|
| 81 |
+
# endif
|
| 82 |
+
|
| 83 |
+
#endif // CCCL_IGNORE_DEPRECATED_COMPILER
|
| 84 |
+
|
| 85 |
+
#if _CCCL_STD_VER < 2011
|
| 86 |
+
// <C++11. Hard upgrade message:
|
| 87 |
+
THRUST_COMPILER_DEPRECATION(C++ 17);
|
| 88 |
+
#elif _CCCL_STD_VER == 2011 && !defined(CCCL_IGNORE_DEPRECATED_CPP_11)
|
| 89 |
+
// =C++11. Soft upgrade message:
|
| 90 |
+
THRUST_COMPILER_DEPRECATION_SOFT(C++ 17, C++ 11);
|
| 91 |
+
#elif _CCCL_STD_VER == 2014 && !defined(CCCL_IGNORE_DEPRECATED_CPP_14)
|
| 92 |
+
// =C++14. Soft upgrade message:
|
| 93 |
+
THRUST_COMPILER_DEPRECATION_SOFT(C++ 17, C++ 14);
|
| 94 |
+
#endif // _CCCL_STD_VER >= 2017
|
| 95 |
+
|
| 96 |
+
#undef THRUST_COMPILER_DEPRECATION_SOFT
|
| 97 |
+
#undef THRUST_COMPILER_DEPRECATION
|
| 98 |
+
#undef THRUST_COMP_DEPR_IMPL
|
| 99 |
+
#undef THRUST_COMP_DEPR_IMPL0
|
| 100 |
+
#undef THRUST_COMP_DEPR_IMPL1
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/device_system.h
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
// Internal config header that is only included through thrust/detail/config/config.h
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// reserve 0 for undefined
|
| 30 |
+
#define THRUST_DEVICE_SYSTEM_CUDA 1
|
| 31 |
+
#define THRUST_DEVICE_SYSTEM_OMP 2
|
| 32 |
+
#define THRUST_DEVICE_SYSTEM_TBB 3
|
| 33 |
+
#define THRUST_DEVICE_SYSTEM_CPP 4
|
| 34 |
+
|
| 35 |
+
#ifndef THRUST_DEVICE_SYSTEM
|
| 36 |
+
# define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CUDA
|
| 37 |
+
#endif // THRUST_DEVICE_SYSTEM
|
| 38 |
+
|
| 39 |
+
#ifdef THRUST_DEVICE_BACKEND
|
| 40 |
+
# error THRUST_DEVICE_BACKEND is no longer supported; use THRUST_DEVICE_SYSTEM instead.
|
| 41 |
+
#endif // THRUST_DEVICE_BACKEND
|
| 42 |
+
|
| 43 |
+
#if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA
|
| 44 |
+
# define __THRUST_DEVICE_SYSTEM_NAMESPACE cuda
|
| 45 |
+
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP
|
| 46 |
+
# define __THRUST_DEVICE_SYSTEM_NAMESPACE omp
|
| 47 |
+
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB
|
| 48 |
+
# define __THRUST_DEVICE_SYSTEM_NAMESPACE tbb
|
| 49 |
+
#elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CPP
|
| 50 |
+
# define __THRUST_DEVICE_SYSTEM_NAMESPACE cpp
|
| 51 |
+
#endif
|
| 52 |
+
|
| 53 |
+
// clang-format off
|
| 54 |
+
#define __THRUST_DEVICE_SYSTEM_ROOT thrust/system/__THRUST_DEVICE_SYSTEM_NAMESPACE
|
| 55 |
+
// clang-format on
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/global_workarounds.h
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
// Internal config header that is only included through thrust/detail/config/config.h
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
#include <thrust/detail/config/compiler.h>
|
| 30 |
+
|
| 31 |
+
// XXX workaround gcc 4.8+'s complaints about unused local aliases by silencing them globally
|
| 32 |
+
#if _CCCL_COMPILER(GCC, >=, 4, 8)
|
| 33 |
+
# if defined(__NVCC__) && (CUDART_VERSION >= 6000)
|
| 34 |
+
# pragma GCC diagnostic ignored "-Wunused-local-typedefs"
|
| 35 |
+
# endif // nvcc & cuda 6+
|
| 36 |
+
#endif // gcc 4.8
|
data/miniconda3/pkgs/cuda-cccl_linux-64-12.9.27-0/targets/x86_64-linux/include/thrust/detail/config/host_system.h
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2008-2013 NVIDIA Corporation
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#pragma once
|
| 18 |
+
|
| 19 |
+
// Internal config header that is only included through thrust/detail/config/config.h
|
| 20 |
+
|
| 21 |
+
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
|
| 22 |
+
# pragma GCC system_header
|
| 23 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
|
| 24 |
+
# pragma clang system_header
|
| 25 |
+
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
|
| 26 |
+
# pragma system_header
|
| 27 |
+
#endif // no system header
|
| 28 |
+
|
| 29 |
+
// reserve 0 for undefined
|
| 30 |
+
#define THRUST_HOST_SYSTEM_CPP 1
|
| 31 |
+
#define THRUST_HOST_SYSTEM_OMP 2
|
| 32 |
+
#define THRUST_HOST_SYSTEM_TBB 3
|
| 33 |
+
|
| 34 |
+
#ifndef THRUST_HOST_SYSTEM
|
| 35 |
+
# define THRUST_HOST_SYSTEM THRUST_HOST_SYSTEM_CPP
|
| 36 |
+
#endif // THRUST_HOST_SYSTEM
|
| 37 |
+
|
| 38 |
+
#ifdef THRUST_HOST_BACKEND
|
| 39 |
+
# error THRUST_HOST_BACKEND is no longer supported; use THRUST_HOST_SYSTEM instead.
|
| 40 |
+
#endif // THRUST_HOST_BACKEND
|
| 41 |
+
|
| 42 |
+
#if THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_CPP
|
| 43 |
+
# define __THRUST_HOST_SYSTEM_NAMESPACE cpp
|
| 44 |
+
#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_OMP
|
| 45 |
+
# define __THRUST_HOST_SYSTEM_NAMESPACE omp
|
| 46 |
+
#elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_TBB
|
| 47 |
+
# define __THRUST_HOST_SYSTEM_NAMESPACE tbb
|
| 48 |
+
#endif
|
| 49 |
+
|
| 50 |
+
// clang-format off
|
| 51 |
+
#define __THRUST_HOST_SYSTEM_ROOT thrust/system/__THRUST_HOST_SYSTEM_NAMESPACE
|
| 52 |
+
// clang-format on
|