├── cmake ├── filecheck_smoke_test ├── wrap_source_file.cpp.in ├── ThrustRunTest.cmake ├── ThrustAddSubdir.cmake └── AppendOptionIfAvailable.cmake ├── internal ├── test │ ├── thrust.example.mr_basic.filecheck │ ├── thrust.example.saxpy.filecheck │ ├── thrust.example.cuda.async_reduce.filecheck │ ├── thrust.example.cuda.unwrap_pointer.filecheck │ ├── thrust.example.cuda.wrap_pointer.filecheck │ ├── thrust.example.scan_matrix_by_rows.filecheck │ ├── thrust.smoke.filecheck │ ├── thrust.example.uninitialized_vector.filecheck │ ├── thrust.example.cuda.global_device_vector.filecheck │ ├── thrust.example.sum.filecheck │ ├── thrust.example.norm.filecheck │ ├── thrust.example.permutation_iterator.filecheck │ ├── thrust.example.monte_carlo.filecheck │ ├── thrust.example.cuda.explicit_cuda_stream.filecheck │ ├── thrust.example.max_abs_diff.filecheck │ ├── thrust.example.monte_carlo_disjoint_sequences.filecheck │ ├── thrust.example.version.filecheck │ ├── thrust.example.minimal_custom_backend.filecheck │ ├── thrust.example.transform_output_iterator.filecheck │ ├── thrust.example.bounding_box.filecheck │ ├── thrust.example.constant_iterator.filecheck │ ├── thrust.example.device_ptr.filecheck │ ├── thrust.example.cuda.range_view.filecheck │ ├── thrust.example.minmax.filecheck │ ├── warningstester.cu │ ├── thrust.example.sorting_aos_vs_soa.filecheck │ ├── thrust.example.transform_input_output_iterator.filecheck │ ├── thrust.example.counting_iterator.filecheck │ ├── thrust.example.stream_compaction.filecheck │ ├── thrust.example.tiled_range.filecheck │ ├── thrust.example.arbitrary_transformation.filecheck │ ├── thrust.example.repeated_range.filecheck │ ├── thrust.example.run_length_decoding.filecheck │ ├── thrust.example.run_length_encoding.filecheck │ ├── thrust.example.raw_reference_cast.filecheck │ ├── thrust.example.strided_range.filecheck │ ├── thrust.example.expand.filecheck │ ├── thrust.example.basic_vector.filecheck │ ├── thrust.example.sparse_vector.filecheck │ ├── thrust.example.sum_rows.filecheck │ ├── thrust.example.fill_copy_sequence.filecheck │ ├── thrust.example.lambda.filecheck │ ├── thrust.example.dot_products_with_zip.filecheck │ ├── thrust.example.mode.filecheck │ ├── thrust.example.set_operations.filecheck │ ├── thrust.example.transform_iterator.filecheck │ ├── thrust.example.discrete_voronoi.filecheck │ ├── thrust.example.summary_statistics.filecheck │ ├── thrust.example.cuda.fallback_allocator.filecheck │ ├── thrust.example.weld_vertices.filecheck │ ├── thrust.example.word_count.filecheck │ └── thrust.example.histogram.filecheck ├── rename_cub_namespace.sh ├── reverse_rename_cub_namespace.sh ├── scripts │ └── tounix ├── build │ ├── common_detect.mk │ ├── generic_example.mk │ ├── testframework.mk │ └── generic_test.mk ├── benchmark │ └── bench.mk └── racecheck.sh ├── testing ├── cuda │ ├── complex.mk │ ├── copy.mk │ ├── copy_if.mk │ ├── count.mk │ ├── cudart.mk │ ├── equal.mk │ ├── fill.mk │ ├── find.mk │ ├── gather.mk │ ├── logical.mk │ ├── memory.mk │ ├── merge.mk │ ├── reduce.mk │ ├── remove.mk │ ├── replace.mk │ ├── reverse.mk │ ├── scan.mk │ ├── scatter.mk │ ├── sort.mk │ ├── unique.mk │ ├── for_each.mk │ ├── generate.mk │ ├── is_sorted.mk │ ├── max_element.mk │ ├── merge_by_key.mk │ ├── merge_sort.mk │ ├── min_element.mk │ ├── mismatch.mk │ ├── pair_sort.mk │ ├── partition.mk │ ├── scan_by_key.mk │ ├── sequence.mk │ ├── set_union.mk │ ├── sort_by_key.mk │ ├── swap_ranges.mk │ ├── tabulate.mk │ ├── transform.mk │ ├── binary_search.mk │ ├── inner_product.mk │ ├── is_partitioned.mk │ ├── is_sorted_until.mk │ ├── minmax_element.mk │ ├── pair_sort_by_key.mk │ ├── partition_point.mk │ ├── reduce_by_key.mk │ ├── set_difference.mk │ ├── set_intersection.mk │ ├── set_union_by_key.mk │ ├── transform_reduce.mk │ ├── transform_scan.mk │ ├── unique_by_key.mk │ ├── adjacent_difference.mk │ ├── managed_memory_pointer.mk │ ├── set_difference_by_key.mk │ ├── uninitialized_copy.mk │ ├── uninitialized_fill.mk │ ├── set_intersection_by_key.mk │ ├── set_symmetric_difference.mk │ ├── set_symmetric_difference_by_key.mk │ ├── stream_per_thread.mk │ ├── cudart.cu │ ├── stream_legacy.cu │ ├── stream_per_thread.cu │ └── stream_per_thread.cmake ├── regression │ ├── nvbug_1965743__unnecessary_static_on_get_occ_device_properties.cu │ ├── gh_928_nvbug_2341455__reduce_with_complex.cu │ ├── nvbug_1632709__reduce_large_input_sizes.cu │ ├── CMakeLists.txt │ ├── nvbug_1990211__scan_requires_assignability_from_zero.cu │ ├── nvbug_1990211__scan_requires_assignability_from_zero.fixed1.cu │ └── nvbug_1990211__scan_requires_assignability_from_zero.fixed0.cu ├── async_reduce.cmake ├── unittest │ ├── unittest.h │ ├── cuda │ │ └── testframework.h │ ├── system.h │ └── CMakeLists.txt ├── unittest_static_assert.cmake ├── cpp │ └── CMakeLists.txt ├── omp │ └── CMakeLists.txt ├── distance.cu ├── caching_allocator.cu ├── unittest_static_assert.cu └── generate_const_iterators.cu ├── examples ├── cmake │ └── add_subdir │ │ ├── dummy.cu │ │ └── dummy.cpp ├── cpp_integration │ ├── device.h │ ├── device.cu │ ├── host.cpp │ └── README ├── README.md ├── version.cu ├── cuda │ ├── CMakeLists.txt │ ├── wrap_pointer.cu │ └── unwrap_pointer.cu ├── constant_iterator.cu └── fill_copy_sequence.cu ├── .gitignore ├── docs ├── doxybook │ └── templates │ │ ├── table_header_brief.tmpl │ │ ├── index_classes.tmpl │ │ ├── index_examples.tmpl │ │ ├── index_files.tmpl │ │ ├── index_groups.tmpl │ │ ├── index_pages.tmpl │ │ ├── index_namespaces.tmpl │ │ ├── table_header_enum.tmpl │ │ ├── table_row_brief.tmpl │ │ ├── kind_page.tmpl │ │ ├── kind_example.tmpl │ │ ├── synopsis_initializer_abbreviated.tmpl │ │ ├── synopsis_leading_line_break.tmpl │ │ ├── title_trailing.tmpl │ │ ├── synopsis_initializer.tmpl │ │ ├── name_unqualified.tmpl │ │ ├── table_row_enum.tmpl │ │ ├── name.tmpl │ │ ├── synopsis_indent.tmpl │ │ ├── title_kind.tmpl │ │ ├── kind_class.tmpl │ │ ├── kind_group.tmpl │ │ ├── name_qualified.tmpl │ │ ├── title_leading.tmpl │ │ ├── title_nonmember.tmpl │ │ ├── synopsis_function_trailing_specifiers.tmpl │ │ ├── synopsis_inherited_from.tmpl │ │ ├── title_member.tmpl │ │ ├── synopsis_type_and_leading_specifiers.tmpl │ │ ├── synopsis_brief.tmpl │ │ ├── kind_file.tmpl │ │ ├── kind_nonclass.tmpl │ │ ├── synopsis_function_type_and_leading_specifiers.tmpl │ │ ├── synopsis_inherited_from_comment.tmpl │ │ ├── synopsis_macro.tmpl │ │ ├── synopsis_namespace_abbreviated.tmpl │ │ ├── synopsis_member_namespace_abbreviated.tmpl │ │ ├── synopsis_function_parameters.tmpl │ │ ├── synopsis_kind.tmpl │ │ ├── synopsis_kind_abbreviated.tmpl │ │ ├── index.tmpl │ │ ├── synopsis_type.tmpl │ │ ├── synopsis_variable.tmpl │ │ ├── synopsis_template_parameters.tmpl │ │ ├── synopsis_function.tmpl │ │ └── synopsis_friend_class.tmpl └── github_pages │ ├── favicon.ico │ ├── api.md │ ├── setup.md │ ├── assets │ └── images │ │ └── nvidia_logo.png │ ├── contributing.md │ └── Gemfile ├── ci ├── common │ └── memmon_config │ │ └── procps │ │ └── toprc ├── axis │ └── gpu.yml ├── cpu │ └── build.bash └── gpu │ └── build.bash ├── .gitmodules ├── thrust ├── cmake │ ├── thrust-header-search.cmake │ └── thrust-header-search.cmake.in ├── limits.h ├── system │ ├── cuda │ │ └── detail │ │ │ ├── binary_search.h │ │ │ ├── logical.h │ │ │ ├── sequence.h │ │ │ └── temporary_buffer.h │ ├── cpp │ │ └── detail │ │ │ ├── transform.h │ │ │ ├── swap_ranges.h │ │ │ ├── count.h │ │ │ ├── equal.h │ │ │ ├── fill.h │ │ │ ├── gather.h │ │ │ ├── generate.h │ │ │ ├── logical.h │ │ │ ├── mismatch.h │ │ │ ├── replace.h │ │ │ ├── reverse.h │ │ │ ├── scatter.h │ │ │ ├── sequence.h │ │ │ ├── tabulate.h │ │ │ ├── inner_product.h │ │ │ ├── transform_scan.h │ │ │ ├── per_device_resource.h │ │ │ ├── temporary_buffer.h │ │ │ ├── transform_reduce.h │ │ │ ├── uninitialized_copy.h │ │ │ ├── uninitialized_fill.h │ │ │ ├── copy.h │ │ │ ├── find.h │ │ │ ├── merge.h │ │ │ ├── scan.h │ │ │ ├── sort.h │ │ │ ├── copy_if.h │ │ │ ├── reduce.h │ │ │ ├── remove.h │ │ │ ├── unique.h │ │ │ ├── for_each.h │ │ │ ├── get_value.h │ │ │ ├── iter_swap.h │ │ │ ├── partition.h │ │ │ ├── assign_value.h │ │ │ ├── extrema.h │ │ │ ├── reduce_by_key.h │ │ │ ├── unique_by_key.h │ │ │ ├── malloc_and_free.h │ │ │ ├── set_operations.h │ │ │ ├── scan_by_key.h │ │ │ ├── adjacent_difference.h │ │ │ └── binary_search.h │ ├── detail │ │ └── sequential │ │ │ ├── fill.h │ │ │ ├── count.h │ │ │ ├── equal.h │ │ │ ├── gather.h │ │ │ ├── logical.h │ │ │ ├── replace.h │ │ │ ├── reverse.h │ │ │ ├── scatter.h │ │ │ ├── generate.h │ │ │ ├── mismatch.h │ │ │ ├── sequence.h │ │ │ ├── tabulate.h │ │ │ ├── transform.h │ │ │ ├── swap_ranges.h │ │ │ ├── inner_product.h │ │ │ ├── per_device_resource.h │ │ │ ├── temporary_buffer.h │ │ │ ├── transform_reduce.h │ │ │ ├── transform_scan.h │ │ │ ├── uninitialized_copy.h │ │ │ └── uninitialized_fill.h │ ├── omp │ │ └── detail │ │ │ ├── per_device_resource.h │ │ │ ├── temporary_buffer.h │ │ │ ├── fill.h │ │ │ ├── scan.h │ │ │ ├── count.h │ │ │ ├── equal.h │ │ │ ├── gather.h │ │ │ ├── merge.h │ │ │ ├── logical.h │ │ │ ├── reverse.h │ │ │ ├── transform.h │ │ │ ├── generate.h │ │ │ ├── get_value.h │ │ │ ├── iter_swap.h │ │ │ ├── mismatch.h │ │ │ ├── replace.h │ │ │ ├── scatter.h │ │ │ ├── sequence.h │ │ │ ├── swap_ranges.h │ │ │ ├── tabulate.h │ │ │ ├── assign_value.h │ │ │ ├── scan_by_key.h │ │ │ ├── inner_product.h │ │ │ ├── set_operations.h │ │ │ ├── transform_scan.h │ │ │ ├── malloc_and_free.h │ │ │ ├── transform_reduce.h │ │ │ ├── uninitialized_copy.h │ │ │ └── uninitialized_fill.h │ └── tbb │ │ └── detail │ │ ├── per_device_resource.h │ │ ├── temporary_buffer.h │ │ ├── fill.h │ │ ├── count.h │ │ ├── equal.h │ │ ├── gather.h │ │ ├── logical.h │ │ ├── reverse.h │ │ ├── transform.h │ │ ├── generate.h │ │ ├── get_value.h │ │ ├── iter_swap.h │ │ ├── mismatch.h │ │ ├── replace.h │ │ ├── scatter.h │ │ ├── sequence.h │ │ ├── swap_ranges.h │ │ ├── tabulate.h │ │ ├── scan_by_key.h │ │ ├── assign_value.h │ │ ├── binary_search.h │ │ ├── inner_product.h │ │ ├── set_operations.h │ │ ├── transform_scan.h │ │ ├── malloc_and_free.h │ │ ├── transform_reduce.h │ │ ├── uninitialized_copy.h │ │ └── uninitialized_fill.h ├── mr │ └── universal_memory_resource.h ├── detail │ ├── swap.inl │ ├── use_default.h │ ├── config.h │ └── reference_forward_declaration.h ├── event.h ├── universal_ptr.h └── addressof.h ├── .github └── workflows │ ├── xrefcheck-validate-markdown-links.yml │ ├── mirror-main-branch-to-master-branch.yml │ ├── add_to_project.yml │ └── deploy-documentation-github-pages.yml └── .git-blame-ignore-revs /cmake/filecheck_smoke_test: -------------------------------------------------------------------------------- 1 | SMOKE 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.mr_basic.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/test/thrust.example.saxpy.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testing/cuda/complex.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/copy.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/copy_if.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/count.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/cudart.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/equal.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/fill.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/find.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/gather.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/logical.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/memory.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/merge.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/reduce.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/remove.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/replace.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/reverse.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/scan.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/scatter.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/sort.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/unique.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.async_reduce.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.unwrap_pointer.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.wrap_pointer.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/test/thrust.example.scan_matrix_by_rows.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /internal/test/thrust.smoke.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: SMOKE 2 | -------------------------------------------------------------------------------- /testing/cuda/for_each.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/generate.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/is_sorted.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/max_element.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/merge_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/merge_sort.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/min_element.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/mismatch.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/pair_sort.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/partition.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/scan_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/sequence.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_union.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/sort_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/swap_ranges.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/tabulate.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/transform.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /examples/cmake/add_subdir/dummy.cu: -------------------------------------------------------------------------------- 1 | #include "dummy.cpp" 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.uninitialized_vector.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testing/cuda/binary_search.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/inner_product.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/is_partitioned.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/is_sorted_until.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/minmax_element.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/pair_sort_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/partition_point.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/reduce_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_difference.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_intersection.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_union_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/transform_reduce.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/transform_scan.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/unique_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /cmake/wrap_source_file.cpp.in: -------------------------------------------------------------------------------- 1 | #include <${wrapped_source_file}> 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.global_device_vector.filecheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /testing/cuda/adjacent_difference.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/managed_memory_pointer.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_difference_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/uninitialized_copy.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/uninitialized_fill.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | discrete_voronoi.pgm 2 | *build*/ 3 | .idea/ 4 | .vscode 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.sum.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: sum is 509773 2 | -------------------------------------------------------------------------------- /testing/cuda/set_intersection_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/set_symmetric_difference.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.norm.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: norm is 5.47723 2 | -------------------------------------------------------------------------------- /testing/cuda/set_symmetric_difference_by_key.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += -rdc=true 2 | -------------------------------------------------------------------------------- /testing/cuda/stream_per_thread.mk: -------------------------------------------------------------------------------- 1 | CUDACC_FLAGS += --default-stream per-thread 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.permutation_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: sum is 130 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.monte_carlo.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: pi is approximately 3.14 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.explicit_cuda_stream.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: sum is 499500 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.max_abs_diff.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: maximum absolute difference: 4 2 | -------------------------------------------------------------------------------- /docs/doxybook/templates/table_header_brief.tmpl: -------------------------------------------------------------------------------- 1 | | Name | Description | 2 | |------|-------------| 3 | -------------------------------------------------------------------------------- /internal/test/thrust.example.monte_carlo_disjoint_sequences.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: pi is around 3.1415 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.version.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Thrust v{{[0-9]+[.][0-9]+[.][0-9]+-[0-9]+}} 2 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index_classes.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index_examples.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index_files.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index_groups.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index_pages.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/github_pages/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorBaratta/thrust/main/docs/github_pages/favicon.ico -------------------------------------------------------------------------------- /docs/doxybook/templates/index_namespaces.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {% include "index.tmpl" -%} 3 | -------------------------------------------------------------------------------- /docs/github_pages/api.md: -------------------------------------------------------------------------------- 1 | --- 2 | has_children: true 3 | has_toc: true 4 | nav_order: 2 5 | --- 6 | 7 | # API 8 | 9 | -------------------------------------------------------------------------------- /docs/github_pages/setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | has_children: true 3 | has_toc: true 4 | nav_order: 1 5 | --- 6 | 7 | # Setup 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.minimal_custom_backend.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Hello, world from for_each(my_system)! 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.transform_output_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: result= [ -0.666667 -2.66667 2 ] 2 | -------------------------------------------------------------------------------- /internal/test/thrust.example.bounding_box.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: bounding box (0.000022,0.037300) (0.967956,0.995085) 2 | -------------------------------------------------------------------------------- /ci/common/memmon_config/procps/toprc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorBaratta/thrust/main/ci/common/memmon_config/procps/toprc -------------------------------------------------------------------------------- /docs/doxybook/templates/table_header_enum.tmpl: -------------------------------------------------------------------------------- 1 | | Enumerator | Value | Description | 2 | |------------|-------|-------------| 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/table_row_brief.tmpl: -------------------------------------------------------------------------------- 1 | | **[`{{name}}`]({{url}})** | {% if exists("brief") %}{{brief}}{% endif %} | 2 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_page.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if exists("details") -%}{{details}}{%- endif -%} 3 | -------------------------------------------------------------------------------- /internal/test/thrust.example.constant_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: 13 2 | CHECK-NEXT: 17 3 | CHECK-NEXT: 12 4 | CHECK-NEXT: 15 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.device_ptr.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: device array contains 10 values 2 | CHECK-NEXT: sum of values is 45 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_example.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if exists("details") -%}{{details}}{%- endif -%} 3 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_initializer_abbreviated.tmpl: -------------------------------------------------------------------------------- 1 | {% if kind == "using" or exists("initializer") %} = see below{% endif -%} 2 | -------------------------------------------------------------------------------- /docs/github_pages/assets/images/nvidia_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IgorBaratta/thrust/main/docs/github_pages/assets/images/nvidia_logo.png -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_leading_line_break.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(synopsis_needs_leading_line_break, false) -%} 2 |
3 | {%- endif -%} 4 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.range_view.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: z[0]= 7 2 | CHECK-NEXT: z[1]= 8 3 | CHECK-NEXT: z[2]= 9 4 | CHECK-NEXT: z[3]= 10 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.minmax.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: [ 10 17 64 90 97 27 56 45 33 76 ] 2 | CHECK-NEXT: minimum = 10 3 | CHECK-NEXT: maximum = 97 4 | -------------------------------------------------------------------------------- /internal/test/warningstester.cu: -------------------------------------------------------------------------------- 1 | //#include "cuda_runtime_api.h" 2 | #include "warningstester.h" 3 | 4 | int main() 5 | { 6 | return 0; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /docs/doxybook/templates/title_trailing.tmpl: -------------------------------------------------------------------------------- 1 | {%- if existsIn(child, "kind") and child.kind in ["class", "struct"] -%} 2 | 3 | {%- endif -%} 4 | 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.sorting_aos_vs_soa.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: AoS sort took {{[0-9.]+}} milliseconds 2 | CHECK-NEXT: SoA sort took {{[0-9.]+}} milliseconds 3 | -------------------------------------------------------------------------------- /internal/test/thrust.example.transform_input_output_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Expected [ 1050 2060 3070 4080 ] 2 | CHECK-NEXT: Result [ 1050 2060 3070 4080 ] 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cub"] 2 | path = dependencies/cub 3 | url = ../cub.git 4 | [submodule "libcudacxx"] 5 | path = dependencies/libcudacxx 6 | url = ../libcudacxx.git 7 | -------------------------------------------------------------------------------- /examples/cpp_integration/device.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // function prototype 6 | void sort_on_device(thrust::host_vector& V); 7 | 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.counting_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: found 4 nonzero values at indices: 2 | CHECK-NEXT: 1 3 | CHECK-NEXT: 2 4 | CHECK-NEXT: 5 5 | CHECK-NEXT: 7 6 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_initializer.tmpl: -------------------------------------------------------------------------------- 1 | {%- if kind == "using" %} = {{ escape(type) -}} 2 | {%- else if exists("initializer") %} {{ escape(initializer) -}} 3 | {%- endif -%} 4 | -------------------------------------------------------------------------------- /docs/doxybook/templates/name_unqualified.tmpl: -------------------------------------------------------------------------------- 1 | {%- if exists("name") -%} 2 | {{- escape(stripNamespace(name)) -}} 3 | {%- else -%} 4 | {{- escape(stripNamespace(title)) -}} 5 | {%- endif -%} 6 | -------------------------------------------------------------------------------- /docs/doxybook/templates/table_row_enum.tmpl: -------------------------------------------------------------------------------- 1 | | `{{ name }}` | {% if exists("initializer") -%}`{{ escape(replace(initializer, "= ", "")) }}`{%- endif %} | {% if exists("brief") -%}{{ brief }}{%- endif %} | 2 | -------------------------------------------------------------------------------- /docs/github_pages/contributing.md: -------------------------------------------------------------------------------- 1 | --- 2 | has_children: true 3 | has_toc: true 4 | nav_order: 4 5 | --- 6 | 7 | # Contributing 8 | 9 | We welcome contributions - just send us a pull request! 10 | 11 | -------------------------------------------------------------------------------- /internal/test/thrust.example.stream_compaction.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: values: 0 1 2 3 4 5 6 7 8 9 2 | CHECK-NEXT: output: 1 3 5 7 9 3 | CHECK-NEXT: small_output: 1 3 5 7 9 4 | CHECK-NEXT: values: 0 2 4 6 8 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.tiled_range.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: range 10 20 30 40 2 | CHECK-NEXT: two tiles: 10 20 30 40 10 20 30 40 3 | CHECK-NEXT: three tiles: 10 20 30 40 10 20 30 40 10 20 30 40 4 | -------------------------------------------------------------------------------- /docs/doxybook/templates/name.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(names_qualified, true) -%} 2 | {{- render("name_qualified.tmpl", child) -}} 3 | {%- else -%} 4 | {{- render("name_unqualified.tmpl", child) -}} 5 | {%- endif -%} 6 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_indent.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(synopsis_indent_width, false) -%} 2 | {%- for i in range(synopsis_indent_width) -%} 3 |  {{ noop() -}} 4 | {%- endfor -%} 5 | {%- endif -%} 6 | -------------------------------------------------------------------------------- /internal/test/thrust.example.arbitrary_transformation.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: 3 + 6 * 2 = 15 2 | CHECK-NEXT: 4 + 7 * 5 = 39 3 | CHECK-NEXT: 0 + 2 * 7 = 14 4 | CHECK-NEXT: 8 + 1 * 4 = 12 5 | CHECK-NEXT: 2 + 8 * 3 = 26 6 | -------------------------------------------------------------------------------- /internal/test/thrust.example.repeated_range.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: range 10 20 30 40 2 | CHECK-NEXT: repeated x2: 10 10 20 20 30 30 40 40 3 | CHECK-NEXT: repeated x3: 10 10 10 20 20 20 30 30 30 40 40 40 4 | -------------------------------------------------------------------------------- /internal/test/thrust.example.run_length_decoding.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: run-length encoded input: 2 | CHECK-NEXT: (a,3)(b,5)(c,1)(d,2)(e,9)(f,2) 3 | CHECK: decoded output: 4 | CHECK-NEXT: aaabbbbbcddeeeeeeeeeff 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.run_length_encoding.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: input data: 2 | CHECK-NEXT: aaabbbbbcddeeeeeeeeeff 3 | CHECK: run-length encoded output: 4 | CHECK-NEXT: (a,3)(b,5)(c,1)(d,2)(e,9)(f,2) 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/title_kind.tmpl: -------------------------------------------------------------------------------- 1 | {%- if child.kind == "using" %}Type Alias{{ noop() -}} 2 | {%- else -%}{{ title(child.kind) -}} 3 | {%- endif -%} 4 | {%- if child.kind == "enum" and child.strong %} Class{%- endif -%} 5 | -------------------------------------------------------------------------------- /testing/regression/nvbug_1965743__unnecessary_static_on_get_occ_device_properties.cu: -------------------------------------------------------------------------------- 1 | // nvcc -Xcompiler -Wall -Xcompiler -Werror -ccbin=clang 2 | 3 | #include 4 | 5 | int main() {} 6 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_class.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if hasDetails -%}{% include "details.tmpl" -%}{%- endif -%} 3 | {% include "class_members.tmpl" -%} 4 | {% include "class_members_details.tmpl" -%} 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_group.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if hasDetails %}{% include "details.tmpl" -%}{%- endif -%} 3 | {% include "nonclass_members.tmpl" -%} 4 | {% include "nonclass_members_details.tmpl" -%} 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/name_qualified.tmpl: -------------------------------------------------------------------------------- 1 | {%- if exists("qualifiedname") -%} 2 | {{- escape(qualifiedname) -}} 3 | {%- else if exists("name") -%} 4 | {{- escape(name) -}} 5 | {%- else -%} 6 | {{- escape(title) -}} 7 | {%- endif -%} 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.raw_reference_cast.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Before A->B Copy 2 | CHECK-NEXT: A: 0 1 2 3 4 3 | CHECK-NEXT: B: 0 0 0 0 0 4 | CHECK-NEXT: After A->B Copy 5 | CHECK-NEXT: A: 0 1 2 3 4 6 | CHECK-NEXT: B: 0 1 2 3 4 7 | -------------------------------------------------------------------------------- /cmake/ThrustRunTest.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | COMMAND "${THRUST_BINARY}" 3 | RESULT_VARIABLE EXIT_CODE 4 | ) 5 | 6 | if (NOT "0" STREQUAL "${EXIT_CODE}") 7 | message(FATAL_ERROR "${THRUST_BINARY} failed (${EXIT_CODE})") 8 | endif () 9 | -------------------------------------------------------------------------------- /docs/doxybook/templates/title_leading.tmpl: -------------------------------------------------------------------------------- 1 |

2 | {%- if existsIn(child, "kind") and child.kind in ["class", "struct"] -%} 3 | {{ noop() -}} 4 | {%- endif -%} 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/title_nonmember.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "title_leading.tmpl" -%} 2 | {%- include "title_kind.tmpl" -%} 3 | {{- noop() }} {{render("name_qualified.tmpl", child)}} 4 | {%- include "title_trailing.tmpl" -%} 5 | 6 | -------------------------------------------------------------------------------- /internal/rename_cub_namespace.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Run this in //sw/gpgpu/thrust/thrust/system/cuda/detail/cub to add a THRUST_ 4 | # prefix to CUB's namespace macro. 5 | 6 | sed -i -e 's/CUB_NS_P/THRUST_CUB_NS_P/g' `find . -type f` 7 | 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.strided_range.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: data: 10 20 30 40 50 60 70 80 2 | CHECK-NEXT: sum of even indices: 160 3 | CHECK-NEXT: sum of odd indices: 200 4 | CHECK-NEXT: setting odd indices to zero: 10 0 30 0 50 0 70 0 5 | -------------------------------------------------------------------------------- /internal/reverse_rename_cub_namespace.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # Run this in //sw/gpgpu/thrust/thrust/system/cuda/detail/cub to undo the 4 | # renaming of CUB's namespace macro. 5 | 6 | sed -i -e 's|THRUST_CUB_NS_P|CUB_NS_P|g' `find . -type f` 7 | 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.expand.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Expanding values according to counts 2 | CHECK-NEXT: counts 3 5 2 0 1 3 4 2 4 3 | CHECK-NEXT: values 1 2 3 4 5 6 7 8 9 4 | CHECK-NEXT: output 1 1 1 2 2 2 2 2 3 3 5 6 6 6 7 7 7 7 8 8 9 9 9 9 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.basic_vector.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: H has size 4 2 | CHECK-NEXT: H[0] = 14 3 | CHECK-NEXT: H[1] = 20 4 | CHECK-NEXT: H[2] = 38 5 | CHECK-NEXT: H[3] = 46 6 | CHECK-NEXT: H now has size 2 7 | CHECK-NEXT: D[0] = 99 8 | CHECK-NEXT: D[1] = 88 9 | -------------------------------------------------------------------------------- /cmake/ThrustAddSubdir.cmake: -------------------------------------------------------------------------------- 1 | find_package(Thrust REQUIRED CONFIG 2 | NO_DEFAULT_PATH # Only check the explicit path in HINTS: 3 | HINTS "${CMAKE_CURRENT_LIST_DIR}/.." 4 | COMPONENTS ${THRUST_REQUIRED_SYSTEMS} 5 | OPTIONAL_COMPONENTS ${THRUST_OPTIONAL_SYSTEMS} 6 | ) 7 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_function_trailing_specifiers.tmpl: -------------------------------------------------------------------------------- 1 | {%- if const %} const{% endif -%} 2 | {%- if override %} override{% endif -%} 3 | {%- if default %} = default{% endif -%} 4 | {%- if deleted %} = deleted{% endif -%} 5 | {%- if pureVirtual %} = 0{% endif -%} 6 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_inherited_from.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(synopsis_is_inherited, false) != false -%} 2 | {%- set base.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 3 | {{- render("synopsis_inherited_from_comment.tmpl", base) -}} 4 | {%- endif -%} 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/title_member.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "title_leading.tmpl" -%} 2 | {%- include "title_kind.tmpl" -%} 3 | {{- noop() }} {% include "name_qualified.tmpl" %}::{{ render("name_unqualified.tmpl", child) }} 4 | {%- include "title_trailing.tmpl" -%} 5 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_type_and_leading_specifiers.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(virtual, false) %}virtual {% endif -%} 2 | {%- if default(static, false) %}static {% endif -%} 3 | {%- if default(explicit, false) %}explicit {% endif -%} 4 | {%- if exists("type") %}{{ type }} {% endif -%} 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.sparse_vector.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Computing C = A + B for sparse vectors A and B 2 | CHECK-NEXT: A (2,10) (3,60) (5,20) (8,40) 3 | CHECK-NEXT: B (1,50) (2,30) (4,80) (5,30) (7,90) (8,10) 4 | CHECK-NEXT: C (1,50) (2,40) (3,60) (4,80) (5,50) (7,90) (8,50) 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.sum_rows.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: [ 10 17 64 90 97 27 56 45 ] = 406 2 | CHECK-NEXT: [ 33 76 18 60 62 82 63 56 ] = 450 3 | CHECK-NEXT: [ 88 99 75 96 36 48 90 68 ] = 600 4 | CHECK-NEXT: [ 91 96 24 87 91 36 94 47 ] = 566 5 | CHECK-NEXT: [ 37 56 45 81 72 58 63 18 ] = 430 6 | -------------------------------------------------------------------------------- /internal/test/thrust.example.fill_copy_sequence.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: D[0] = 0 2 | CHECK-NEXT: D[1] = 1 3 | CHECK-NEXT: D[2] = 2 4 | CHECK-NEXT: D[3] = 3 5 | CHECK-NEXT: D[4] = 4 6 | CHECK-NEXT: D[5] = 9 7 | CHECK-NEXT: D[6] = 9 8 | CHECK-NEXT: D[7] = 1 9 | CHECK-NEXT: D[8] = 1 10 | CHECK-NEXT: D[9] = 1 11 | -------------------------------------------------------------------------------- /testing/regression/gh_928_nvbug_2341455__reduce_with_complex.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | thrust::device_vector > d(5); 8 | thrust::reduce(d.begin(), d.end()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /testing/async_reduce.cmake: -------------------------------------------------------------------------------- 1 | # Disable unreachable code warnings. 2 | # This test unconditionally throws in some places, the compiler will detect that 3 | # control flow will never reach some instructions. This is intentional. 4 | target_link_libraries(${test_target} PRIVATE thrust.silence_unreachable_code_warnings) 5 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | Once Thrust has been installed, these example programs can be compiled 2 | directly with nvcc. For example, the following command will compile the 3 | norm example. 4 | $ nvcc norm.cu -o norm 5 | 6 | These examples are also available online: 7 | https://github.com/NVIDIA/thrust/tree/main/examples 8 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_brief.tmpl: -------------------------------------------------------------------------------- 1 | {%- if exists("brief") -%} 2 | {{ noop() -}} 3 | {%- if default(synopsis_indent_width, 0) != 0 -%} 4 | {%- include "synopsis_indent.tmpl" -%} 5 | {%- endif -%} 6 | /* {{ brief }} */{{ noop() -}} 7 | {{ noop() -}} 8 | {%- endif -%} 9 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_file.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if hasDetails -%}{% include "details.tmpl" -%}{%- endif -%} 3 | {% include "nonclass_members_details.tmpl" -%} 4 | {% include "nonclass_members.tmpl" -%} 5 | {%- if exists("programlisting") -%} 6 | 7 | ```cpp 8 | {{programlisting}} 9 | ``` 10 | {%- endif -%} 11 | -------------------------------------------------------------------------------- /docs/doxybook/templates/kind_nonclass.tmpl: -------------------------------------------------------------------------------- 1 | {% include "frontmatter.tmpl" -%} 2 | {%- if hasDetails %}{% include "details.tmpl" -%}{%- endif -%} 3 | {% if kind == "namespace" -%} 4 | {%- include "namespace_members.tmpl" -%} 5 | {%- else -%} 6 | {%- include "nonclass_members.tmpl" -%} 7 | {%- endif -%} 8 | {% include "nonclass_members_details.tmpl" -%} 9 | -------------------------------------------------------------------------------- /testing/unittest/unittest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // this is the only header included by unittests 4 | // it pulls in all the others used for unittesting 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | -------------------------------------------------------------------------------- /cmake/AppendOptionIfAvailable.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | include(CheckCXXCompilerFlag) 3 | 4 | macro (APPEND_OPTION_IF_AVAILABLE _FLAG _LIST) 5 | 6 | string(MAKE_C_IDENTIFIER "CXX_FLAG_${_FLAG}" _VAR) 7 | check_cxx_compiler_flag(${_FLAG} ${_VAR}) 8 | 9 | if (${${_VAR}}) 10 | list(APPEND ${_LIST} ${_FLAG}) 11 | endif () 12 | 13 | endmacro () 14 | 15 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_function_type_and_leading_specifiers.tmpl: -------------------------------------------------------------------------------- 1 | {%- if default(virtual, false) or default(static, false) or default(explicit, false) or default(type, false) -%} 2 | {{ noop() -}} 3 | {%- include "synopsis_indent.tmpl" -%} 4 | {%- include "synopsis_type_and_leading_specifiers.tmpl" -%} 5 | {{ noop() -}} 6 | {%- endif -%} 7 | -------------------------------------------------------------------------------- /internal/test/thrust.example.lambda.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: SAXPY (functor method) 2 | CHECK-NEXT: 2 * 1 + 1 = 3 3 | CHECK-NEXT: 2 * 2 + 1 = 5 4 | CHECK-NEXT: 2 * 3 + 1 = 7 5 | CHECK-NEXT: 2 * 4 + 1 = 9 6 | CHECK-NEXT: SAXPY (placeholder method) 7 | CHECK-NEXT: 2 * 1 + 1 = 3 8 | CHECK-NEXT: 2 * 2 + 1 = 5 9 | CHECK-NEXT: 2 * 3 + 1 = 7 10 | CHECK-NEXT: 2 * 4 + 1 = 9 11 | -------------------------------------------------------------------------------- /internal/scripts/tounix: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # converts all files in the current directory with extensions .h .inl or .cu to unix format 4 | 5 | #find . -type f \( -name "*.h" -o -name "*.inl" -o -name "*.cu" \) -a \( -not -wholename "*\.hg/*" \) -print 6 | find . -type f \( -name "*.h" -o -name "*.inl" -o -name "*.cu" \) -a \( -not -wholename "*\.hg/*" \) -exec fromdos -d {} \; 7 | 8 | -------------------------------------------------------------------------------- /internal/test/thrust.example.dot_products_with_zip.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: (0.000022,0.000022,0.000022) * (0.000022,0.000022,0.000022) = 0.000000 2 | CHECK-NEXT: (0.085032,0.085032,0.085032) * (0.085032,0.085032,0.085032) = 0.021692 3 | CHECK-NEXT: (0.601353,0.601353,0.601353) * (0.601353,0.601353,0.601353) = 1.084875 4 | CHECK-NEXT: (0.891611,0.891611,0.891611) * (0.891611,0.891611,0.891611) = 2.384912 5 | -------------------------------------------------------------------------------- /internal/test/thrust.example.mode.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: initial data 2 | CHECK-NEXT: 0 0 6 8 9 1 5 3 2 7 0 5 5 8 5 5 8 9 7 9 2 4 8 6 9 9 1 8 9 2 3 | CHECK-NEXT: sorted data 4 | CHECK-NEXT: 0 0 0 1 1 2 2 2 3 4 5 5 5 5 5 6 6 7 7 8 8 8 8 8 9 9 9 9 9 9 5 | CHECK-NEXT: values 6 | CHECK-NEXT: 0 1 2 3 4 5 6 7 8 9 7 | CHECK-NEXT: counts 8 | CHECK-NEXT: 3 2 3 1 1 5 2 2 5 6 9 | CHECK-NEXT: Modal value 9 occurs 6 times 10 | -------------------------------------------------------------------------------- /internal/test/thrust.example.set_operations.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Set A [ 0 2 4 5 6 8 9 ] 2 | CHECK-NEXT: Set B [ 0 1 2 3 5 7 8 ] 3 | CHECK-NEXT: Merge(A,B) [ 0 0 1 2 2 3 4 5 5 6 7 8 8 9 ] 4 | CHECK-NEXT: Union(A,B) [ 0 1 2 3 4 5 6 7 8 9 ] 5 | CHECK-NEXT: Intersection(A,B) [ 0 2 5 8 ] 6 | CHECK-NEXT: Difference(A,B) [ 4 6 9 ] 7 | CHECK-NEXT: SymmetricDifference(A,B) [ 1 3 4 6 7 9 ] 8 | CHECK-NEXT: SetIntersectionSize(A,B) 4 9 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_inherited_from_comment.tmpl: -------------------------------------------------------------------------------- 1 | {{ noop() -}} 2 | {%- if default(synopsis_indent_width, 0) != 0 -%} 3 | {%- include "synopsis_indent.tmpl" -%} 4 | {%- endif -%} 5 | /* Inherited from {{ noop() -}} 6 | {%- include "name_qualified.tmpl" -%}{{ noop() -}} 7 | */{{ noop() -}} 8 | {{ noop() -}} 9 | -------------------------------------------------------------------------------- /internal/test/thrust.example.transform_iterator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: values : 2 5 7 1 6 0 3 8 2 | CHECK-NEXT: clamped values : 2 5 5 1 5 1 3 5 3 | CHECK-NEXT: sum of clamped values : 27 4 | CHECK-NEXT: sequence : 0 1 2 3 4 5 6 7 8 9 5 | CHECK-NEXT: clamped sequence : 1 1 2 3 4 5 5 5 5 5 6 | CHECK-NEXT: negated sequence : -1 -1 -2 -3 -4 -5 -5 -5 -5 -5 7 | CHECK-NEXT: negated values : -2 -5 -7 -1 -6 0 -3 -8 8 | -------------------------------------------------------------------------------- /examples/version.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(void) 5 | { 6 | int major = THRUST_MAJOR_VERSION; 7 | int minor = THRUST_MINOR_VERSION; 8 | int subminor = THRUST_SUBMINOR_VERSION; 9 | int patch = THRUST_PATCH_NUMBER; 10 | 11 | std::cout << "Thrust v" << major << "." << minor << "." << subminor << "-" << patch << std::endl; 12 | 13 | return 0; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /thrust/cmake/thrust-header-search.cmake: -------------------------------------------------------------------------------- 1 | # Parse version information from version.h in source tree 2 | set(_THRUST_VERSION_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") 3 | if(EXISTS "${_THRUST_VERSION_INCLUDE_DIR}/thrust/version.h") 4 | set(_THRUST_VERSION_INCLUDE_DIR "${_THRUST_VERSION_INCLUDE_DIR}" CACHE FILEPATH "" FORCE) # Clear old result 5 | set_property(CACHE _THRUST_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL) 6 | endif() 7 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_macro.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 3 | {{ noop() -}} 4 | {{- render("synopsis_kind.tmpl", child) -}} 5 | {{- render("name_qualified.tmpl", child) -}}{{ noop() -}} 6 | {{- render("synopsis_initializer_abbreviated.tmpl", child) -}};{{ noop() -}} 7 | 8 | -------------------------------------------------------------------------------- /docs/github_pages/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | gem "just-the-docs" 3 | group :jekyll_plugins do 4 | gem "github-pages" # GitHub Pages. 5 | gem "jekyll-optional-front-matter" # GitHub Pages. 6 | gem "jekyll-default-layout" # GitHub Pages. 7 | gem "jekyll-titles-from-headings" # GitHub Pages. 8 | gem "jekyll-relative-links" # GitHub Pages. 9 | gem "jekyll-include-cache" 10 | end 11 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_namespace_abbreviated.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 3 | {{- render("synopsis_brief.tmpl", child) -}} 4 | {{ noop() -}} 5 | {{- render("synopsis_kind_abbreviated.tmpl", child) -}} 6 | {{- render("name_qualified.tmpl", child) -}} { }{{ noop() -}} 7 | 8 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_member_namespace_abbreviated.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 3 | {{- render("synopsis_brief.tmpl", child) -}} 4 | {{ noop() -}} 5 | {{- render("synopsis_kind_abbreviated.tmpl", child) -}} 6 | {{- render("name_qualified.tmpl", child) -}} { }{{ noop() -}} 7 | 8 | -------------------------------------------------------------------------------- /testing/cuda/cudart.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | template 6 | void TestCudaMallocResultAligned(const std::size_t n) 7 | { 8 | T *ptr = 0; 9 | cudaMalloc(&ptr, n * sizeof(T)); 10 | cudaFree(ptr); 11 | 12 | ASSERT_EQUAL(true, thrust::detail::util::is_aligned(ptr)); 13 | } 14 | DECLARE_VARIABLE_UNITTEST(TestCudaMallocResultAligned); 15 | 16 | -------------------------------------------------------------------------------- /ci/axis/gpu.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2018-2020 NVIDIA Corporation 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 | # Released under the Apache License v2.0 with LLVM Exceptions. 4 | # See https://llvm.org/LICENSE.txt for license information. 5 | 6 | SDK_TYPE: 7 | - cuda 8 | 9 | SDK_VER: 10 | - 11.7.0-devel 11 | 12 | OS_TYPE: 13 | - ubuntu 14 | 15 | OS_VER: 16 | - 20.04 17 | 18 | CXX_TYPE: 19 | - gcc 20 | 21 | CXX_VER: 22 | - 9 23 | -------------------------------------------------------------------------------- /internal/test/thrust.example.discrete_voronoi.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: [Inititialize {{[0-9]+}}x{{[0-9]+}} Image] 2 | CHECK-NEXT: ( {{[0-9.]+}}ms ) 3 | CHECK-NEXT: [Copy to Device] 4 | CHECK-NEXT: ( {{[0-9.]+}}ms ) 5 | CHECK-NEXT: [JFA stepping] 6 | CHECK-NEXT: ( {{[0-9.]+}}ms ) 7 | CHECK-NEXT: ( {{[0-9.]+}} MPixel/s ) 8 | CHECK-NEXT: [Device to Host Copy] 9 | CHECK-NEXT: ( {{[0-9.]+}}ms ) 10 | CHECK-NEXT: [PGM Export] 11 | CHECK-NEXT: ( {{[0-9.]+}}ms ) 12 | -------------------------------------------------------------------------------- /internal/test/thrust.example.summary_statistics.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: ******Summary Statistics Example***** 2 | CHECK-NEXT: The data: 4 7 13 16 3 | CHECK-NEXT: Count : 4 4 | CHECK-NEXT: Minimum : 4 5 | CHECK-NEXT: Maximum : 16 6 | CHECK-NEXT: Mean : 10 7 | CHECK-NEXT: Variance : 30 8 | CHECK-NEXT: Standard Deviation : 4.74342 9 | CHECK-NEXT: Skewness : 0 10 | CHECK-NEXT: Kurtosis : 1.36 11 | -------------------------------------------------------------------------------- /.github/workflows/xrefcheck-validate-markdown-links.yml: -------------------------------------------------------------------------------- 1 | name: Check bad links 2 | 3 | on: 4 | push: 5 | branches: [ '*' ] 6 | pull_request: 7 | branches: [ '*' ] 8 | 9 | jobs: 10 | xrefcheck: 11 | name: Check links 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: serokell/xrefcheck-action@v1 16 | with: 17 | xrefcheck-version: 0.2 18 | xrefcheck-args: --ignored dependencies 19 | -------------------------------------------------------------------------------- /testing/regression/nvbug_1632709__reduce_large_input_sizes.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | long long n = 10000000000; 10 | 11 | long long r = thrust::reduce( 12 | thrust::constant_iterator(0) 13 | , thrust::constant_iterator(n) 14 | ); 15 | 16 | std::cout << r << std::endl; 17 | 18 | assert(r == n); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_function_parameters.tmpl: -------------------------------------------------------------------------------- 1 | {%- for param in params -%} 2 | {%- if not loop.is_first -%}  {%- endif -%} 3 | {{- param.type -}} 4 | {%- if not isEmpty(param.name) %} {% endif -%} 5 | {{- param.name -}} 6 | {%- if existsIn(param, "defvalPlain") %} = {{ escape(param.defvalPlain) }}{% endif -%} 7 | {%- if not loop.is_last -%} 8 | , 9 | {{- noop() }}{% include "synopsis_indent.tmpl" -%} 10 | {%- endif -%} 11 | {%- endfor -%} 12 | -------------------------------------------------------------------------------- /thrust/limits.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 NVIDIA Corporation 2 | // Author: Bryce Adelstein Lelbach 3 | // 4 | // Distributed under the Boost Software License v1.0 (boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | THRUST_NAMESPACE_BEGIN 14 | 15 | template 16 | struct numeric_limits : std::numeric_limits {}; 17 | 18 | THRUST_NAMESPACE_END 19 | -------------------------------------------------------------------------------- /.github/workflows/mirror-main-branch-to-master-branch.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | 6 | jobs: 7 | mirror-main-branch-to-master-branch: 8 | name: Mirror main branch to master branch 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Mirror main branch to master branch 12 | id: mirror 13 | uses: google/mirror-branch-action@v1.0 14 | with: 15 | source: main 16 | dest: master 17 | github-token: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /internal/build/common_detect.mk: -------------------------------------------------------------------------------- 1 | CXX_STD = c++11 2 | 3 | ifeq ($(THRUST_TEST),1) 4 | include $(ROOTDIR)/build/getprofile.mk 5 | include $(ROOTDIR)/build/config/$(PROFILE).mk 6 | else 7 | ifdef VULCAN_TOOLKIT_BASE 8 | include $(VULCAN_TOOLKIT_BASE)/build/getprofile.mk 9 | include $(VULCAN_TOOLKIT_BASE)/build/config/$(PROFILE).mk 10 | else 11 | include $(ROOTDIR)/build/getprofile.mk 12 | include $(ROOTDIR)/build/config/$(PROFILE).mk 13 | endif # VULCAN_TOOLKIT_BASE 14 | endif # THRUST_TEST 15 | 16 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # Exclude these commits from git-blame and similar tools. 2 | # 3 | # To use this file, run the following command from the repo root: 4 | # 5 | # ``` 6 | # $ git config blame.ignoreRevsFile .git-blame-ignore-revs 7 | # ``` 8 | # 9 | # Include a brief comment with each commit added, for example: 10 | # 11 | # ``` 12 | # d92d9f8baac5ec48a8f8718dd69f415a45efe372 # Initial clang-format 13 | # ``` 14 | # 15 | # Only add commits that are pure formatting changes (e.g. 16 | # clang-format version changes, etc). 17 | -------------------------------------------------------------------------------- /examples/cpp_integration/device.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "device.h" 6 | 7 | void sort_on_device(thrust::host_vector& h_vec) 8 | { 9 | // transfer data to the device 10 | thrust::device_vector d_vec = h_vec; 11 | 12 | // sort data on the device 13 | thrust::sort(d_vec.begin(), d_vec.end()); 14 | 15 | // transfer data back to host 16 | thrust::copy(d_vec.begin(), d_vec.end(), h_vec.begin()); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /internal/build/generic_example.mk: -------------------------------------------------------------------------------- 1 | # Generic project mk that is included by examples mk 2 | EXECUTABLE := $(EXAMPLE_NAME) 3 | BUILD_SRC := $(ROOTDIR)/thrust/$(EXAMPLE_SRC) 4 | 5 | include $(ROOTDIR)/thrust/internal/build/common_detect.mk 6 | 7 | EXAMPLE_MAKEFILE := $(join $(dir $(BUILD_SRC)), $(basename $(notdir $(BUILD_SRC))).mk) 8 | ifneq ("$(wildcard $(EXAMPLE_MAKEFILE))","") # Check if the file exists. 9 | include $(EXAMPLE_MAKEFILE) 10 | endif 11 | 12 | include $(ROOTDIR)/thrust/internal/build/common_build.mk 13 | 14 | -------------------------------------------------------------------------------- /internal/test/thrust.example.cuda.fallback_allocator.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Testing fallback_allocator on device 2 | CHECK-SAME: with {{[0-9]+}} bytes of device memory 3 | CHECK: attempting to sort {{[0-9]+}} values 4 | CHECK: allocated {{[0-9]+}} bytes of device memory 5 | CHECK: allocated {{[0-9]+}} bytes of device memory 6 | CHECK: attempting to sort {{[0-9]+}} values 7 | CHECK: allocated {{[0-9]+}} bytes of device memory 8 | CHECK: allocated {{[0-9]+}} bytes of pinned host memory (fallback successful) 9 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_kind.tmpl: -------------------------------------------------------------------------------- 1 | {%- if kind == "interface" %}class {{ noop() -}} 2 | {%- else if kind == "namespace" %}namespace {{ noop() -}} 3 | {%- else if kind == "typedef" %}typedef {{ type -}} 4 | {%- else if kind == "enum" %}enum {% if strong %}class {% endif -%} {{ noop() -}} 5 | {%- else if kind == "friend" %}friend {{ noop() -}} 6 | {%- if type == "class" or type == "struct" %}{{ type }} {% endif -%} 7 | {%- else if kind == "define" %}#define {{ noop() -}} 8 | {%- else %}{{ kind }} {{ noop() -}} 9 | {%- endif -%} 10 | -------------------------------------------------------------------------------- /testing/cuda/stream_legacy.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | void verify_stream() 8 | { 9 | auto exec = thrust::device; 10 | auto stream = thrust::cuda_cub::stream(exec); 11 | ASSERT_EQUAL(stream, cudaStreamLegacy); 12 | } 13 | 14 | void TestLegacyDefaultStream() 15 | { 16 | verify_stream(); 17 | 18 | std::thread t(verify_stream); 19 | t.join(); 20 | } 21 | DECLARE_UNITTEST(TestLegacyDefaultStream); 22 | -------------------------------------------------------------------------------- /testing/cuda/stream_per_thread.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | void verify_stream() 8 | { 9 | auto exec = thrust::device; 10 | auto stream = thrust::cuda_cub::stream(exec); 11 | ASSERT_EQUAL(stream, cudaStreamPerThread); 12 | } 13 | 14 | void TestPerThreadDefaultStream() 15 | { 16 | verify_stream(); 17 | 18 | std::thread t(verify_stream); 19 | t.join(); 20 | } 21 | DECLARE_UNITTEST(TestPerThreadDefaultStream); 22 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_kind_abbreviated.tmpl: -------------------------------------------------------------------------------- 1 | {%- if kind == "interface" %}class {{ noop() -}} 2 | {%- else if kind == "namespace" %}namespace {{ noop() -}} 3 | {%- else if kind == "typedef" %}typedef see below {{ noop() -}} 4 | {%- else if kind == "enum" %}enum {% if strong %}class {% endif -%} 5 | {%- else if kind == "friend" %}friend {{ noop() -}} 6 | {%- if type == "class" or type == "struct" %}{{type}} {% endif -%} 7 | {%- else if kind == "define" %}#define {{ noop() -}} 8 | {%- else %}{{ kind }} {{ noop() -}} 9 | {%- endif -%} 10 | -------------------------------------------------------------------------------- /internal/build/testframework.mk: -------------------------------------------------------------------------------- 1 | STATIC_LIBRARY := testframework 2 | 3 | SRC_PATH := $(ROOTDIR)/thrust/testing/ 4 | BUILD_SRC := unittest/testframework.cu 5 | 6 | CUSRC := unittest/cuda/testframework.cu 7 | $(CUSRC).CUDACC_FLAGS := -I$(ROOTDIR)/thrust/testing/cuda/ 8 | $(CUSRC).TARGET_BASENAME := testframework_cu 9 | CU_FILES += $(CUSRC) 10 | 11 | INCLUDES_ABSPATH += $(ROOTDIR)/thrust/testing 12 | 13 | THRUST_TEST := 1 14 | 15 | include $(ROOTDIR)/thrust/internal/build/common_detect.mk 16 | include $(ROOTDIR)/thrust/internal/build/common_build.mk 17 | 18 | -------------------------------------------------------------------------------- /internal/test/thrust.example.weld_vertices.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Output Representation 2 | CHECK-NEXT: vertices[0] = (0,0) 3 | CHECK-NEXT: vertices[1] = (0,1) 4 | CHECK-NEXT: vertices[2] = (1,0) 5 | CHECK-NEXT: vertices[3] = (1,1) 6 | CHECK-NEXT: vertices[4] = (2,0) 7 | CHECK-NEXT: indices[0] = 0 8 | CHECK-NEXT: indices[1] = 2 9 | CHECK-NEXT: indices[2] = 1 10 | CHECK-NEXT: indices[3] = 2 11 | CHECK-NEXT: indices[4] = 3 12 | CHECK-NEXT: indices[5] = 1 13 | CHECK-NEXT: indices[6] = 2 14 | CHECK-NEXT: indices[7] = 4 15 | CHECK-NEXT: indices[8] = 3 16 | -------------------------------------------------------------------------------- /testing/cuda/stream_per_thread.cmake: -------------------------------------------------------------------------------- 1 | # This test should always use per-thread streams on NVCC. 2 | set_target_properties(${test_target} PROPERTIES 3 | COMPILE_OPTIONS 4 | $<$,$>:--default-stream=per-thread> 5 | ) 6 | 7 | thrust_fix_clang_nvcc_build_for(${test_target}) 8 | 9 | # NVC++ does not have an equivalent option, and will always 10 | # use the global stream by default. 11 | if (CMAKE_CUDA_COMPILER_ID STREQUAL "Feta") 12 | set_tests_properties(${test_target} PROPERTIES WILL_FAIL ON) 13 | endif() 14 | -------------------------------------------------------------------------------- /internal/benchmark/bench.mk: -------------------------------------------------------------------------------- 1 | # XXX Use the common Thrust Makefiles instead of this. 2 | 3 | EXECUTABLE := bench 4 | BUILD_SRC := $(ROOTDIR)/thrust/internal/benchmark/bench.cu 5 | 6 | ifeq ($(OS),Linux) 7 | LIBRARIES += m 8 | endif 9 | 10 | # XXX Why is this needed? 11 | ifeq ($(OS),Linux) 12 | ifeq ($(ABITYPE), androideabi) 13 | override ALL_SASS_ARCHITECTURES := 32 14 | endif 15 | endif 16 | 17 | ARCH_NEG_FILTER += 20 21 18 | 19 | include $(ROOTDIR)/thrust/internal/build/common_detect.mk 20 | include $(ROOTDIR)/thrust/internal/build/common_build.mk 21 | -------------------------------------------------------------------------------- /internal/test/thrust.example.word_count.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Text sample: 2 | CHECK-NEXT: But the raven, sitting lonely on the placid bust, spoke only, 3 | CHECK-NEXT: That one word, as if his soul in that one word he did outpour. 4 | CHECK-NEXT: Nothing further then he uttered - not a feather then he fluttered - 5 | CHECK-NEXT: Till I scarcely more than muttered `Other friends have flown before - 6 | CHECK-NEXT: On the morrow he will leave me, as my hopes have flown before.' 7 | CHECK-NEXT: Then the bird said, `Nevermore.' 8 | CHECK: Text sample contains 65 words 9 | -------------------------------------------------------------------------------- /testing/unittest_static_assert.cmake: -------------------------------------------------------------------------------- 1 | # Disable unreachable code warnings. 2 | # This test unconditionally throws in some places, the compiler will detect that 3 | # control flow will never reach some instructions. This is intentional. 4 | target_link_libraries(${test_target} PRIVATE thrust.silence_unreachable_code_warnings) 5 | 6 | # The machinery behind this test is not compatible with NVC++. 7 | # See https://github.com/NVIDIA/thrust/issues/1397 8 | if ("NVCXX" STREQUAL "${CMAKE_CUDA_COMPILER_ID}") 9 | set_tests_properties(${test_target} PROPERTIES DISABLED True) 10 | endif() 11 | -------------------------------------------------------------------------------- /ci/cpu/build.bash: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Copyright (c) 2018-2020 NVIDIA Corporation 4 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 | # Released under the Apache License v2.0 with LLVM Exceptions. 6 | # See https://llvm.org/LICENSE.txt for license information. 7 | 8 | ################################################################################ 9 | # Thrust and CUB build script for gpuCI (CPU-only) 10 | ################################################################################ 11 | 12 | export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} 13 | 14 | source ${WORKSPACE}/ci/common/build.bash 15 | -------------------------------------------------------------------------------- /testing/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_srcs 2 | RELATIVE "${CMAKE_CURRENT_LIST_DIR}}" 3 | CONFIGURE_DEPENDS 4 | *.cu *.cpp 5 | ) 6 | 7 | foreach(thrust_target IN LISTS THRUST_TARGETS) 8 | thrust_get_target_property(config_device ${thrust_target} DEVICE) 9 | if (NOT config_device STREQUAL "CPP") 10 | continue() 11 | endif() 12 | 13 | foreach(test_src IN LISTS test_srcs) 14 | get_filename_component(test_name "${test_src}" NAME_WLE) 15 | string(PREPEND test_name "cpp.") 16 | thrust_add_test(test_target ${test_name} "${test_src}" ${thrust_target}) 17 | endforeach() 18 | endforeach() 19 | -------------------------------------------------------------------------------- /testing/omp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB test_srcs 2 | RELATIVE "${CMAKE_CURRENT_LIST_DIR}}" 3 | CONFIGURE_DEPENDS 4 | *.cu *.cpp 5 | ) 6 | 7 | foreach(thrust_target IN LISTS THRUST_TARGETS) 8 | thrust_get_target_property(config_device ${thrust_target} DEVICE) 9 | if (NOT config_device STREQUAL "OMP") 10 | continue() 11 | endif() 12 | 13 | foreach(test_src IN LISTS test_srcs) 14 | get_filename_component(test_name "${test_src}" NAME_WLE) 15 | string(PREPEND test_name "omp.") 16 | thrust_add_test(test_target ${test_name} "${test_src}" ${thrust_target}) 17 | endforeach() 18 | endforeach() 19 | -------------------------------------------------------------------------------- /ci/gpu/build.bash: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Copyright (c) 2018-2020 NVIDIA Corporation 4 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 | # Released under the Apache License v2.0 with LLVM Exceptions. 6 | # See https://llvm.org/LICENSE.txt for license information. 7 | 8 | ################################################################################ 9 | # Thrust and CUB build script for gpuCI (heterogeneous) 10 | ################################################################################ 11 | 12 | export PARALLEL_LEVEL=${PARALLEL_LEVEL:-4} 13 | 14 | source ${WORKSPACE}/ci/common/build.bash 15 | -------------------------------------------------------------------------------- /docs/doxybook/templates/index.tmpl: -------------------------------------------------------------------------------- 1 | {%- if exists("children") -%}{%- for child in children -%} 2 | {%- for i in range(default(index_depth, 0)) -%} 3 | {{- noop() }} {{ noop() -}} 4 | {%- endfor -%} 5 | * {{ noop() -}} 6 | {{ render("name_qualified.tmpl", child) }}{{ noop() -}} 7 | {%- if existsIn(child, "brief") -%} 8 | {{- noop() }}
{{ child.brief -}} 9 | {%- endif %} 10 | {%- if existsIn(child, "children") -%} 11 | {%- set child.index_depth = default(index_depth, 0) + 1 -%} 12 | {{- render("index.tmpl", child) -}} 13 | {%- endif -%} 14 | {%- endfor -%}{%- endif -%} 15 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_type.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- include "synopsis_inherited_from.tmpl" -%} 3 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 4 | {{- render("synopsis_brief.tmpl", child) -}} 5 | {{- render("synopsis_template_parameters.tmpl", child) -}} 6 | {{ noop() -}} 7 | {%- include "synopsis_indent.tmpl" -%} 8 | {{- render("synopsis_kind_abbreviated.tmpl", child) -}} 9 | {% include "name.tmpl" %}{{ noop() -}} 10 | {{- render("synopsis_initializer_abbreviated.tmpl", child) -}};{{ noop() -}} 11 | 12 | -------------------------------------------------------------------------------- /examples/cuda/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB example_srcs 2 | RELATIVE "${CMAKE_CURRENT_LIST_DIR}}" 3 | CONFIGURE_DEPENDS 4 | *.cu *.cpp 5 | ) 6 | 7 | foreach(thrust_target IN LISTS THRUST_TARGETS) 8 | thrust_get_target_property(config_device ${thrust_target} DEVICE) 9 | if (NOT config_device STREQUAL "CUDA") 10 | continue() 11 | endif() 12 | 13 | foreach(example_src IN LISTS example_srcs) 14 | get_filename_component(example_name "${example_src}" NAME_WLE) 15 | string(PREPEND example_name "cuda.") 16 | thrust_add_example(example_target ${example_name} "${example_src}" ${thrust_target}) 17 | endforeach() 18 | endforeach() 19 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_variable.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- include "synopsis_inherited_from.tmpl" -%} 3 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 4 | {{- render("synopsis_brief.tmpl", child) -}} 5 | {{- render("synopsis_template_parameters.tmpl", child) -}} 6 | {{ noop() -}} 7 | {%- include "synopsis_indent.tmpl" -%} 8 | {{- render("synopsis_type_and_leading_specifiers.tmpl", child) -}} 9 | {% include "name.tmpl" %}{{ noop() -}} 10 | {{- render("synopsis_initializer_abbreviated.tmpl", child) -}};{{ noop() -}} 11 | 12 | -------------------------------------------------------------------------------- /testing/regression/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Disabled as these test names are too long for CMAKE_OBJECT_PATH_MAX. 3 | # We should integrate these with the other unit tests. 4 | # See issue #1205. 5 | # 6 | return() 7 | 8 | file(GLOB test_srcs 9 | RELATIVE "${CMAKE_CURRENT_LIST_DIR}}" 10 | CONFIGURE_DEPENDS 11 | *.cu *.cpp 12 | ) 13 | 14 | foreach(thrust_target IN LISTS THRUST_TARGETS) 15 | foreach(test_src IN LISTS test_srcs) 16 | get_filename_component(test_name "${test_src}" NAME_WLE) 17 | string(PREPEND test_name "regression.") 18 | thrust_add_test(test_target ${test_name} "${test_src}" ${thrust_target}) 19 | endforeach() 20 | endforeach() 21 | -------------------------------------------------------------------------------- /testing/regression/nvbug_1990211__scan_requires_assignability_from_zero.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | inline __host__ __device__ uint2 operator+(uint2 a, uint2 b) 5 | { 6 | return make_uint2(a.x + b.x, a.y + b.y); 7 | } 8 | 9 | int main() { 10 | int num_elements = 32; 11 | uint2 *input = NULL, *output = NULL; 12 | const uint2 zero = make_uint2(0,0); 13 | 14 | thrust::exclusive_scan(thrust::device_ptr((uint2*)input), 15 | thrust::device_ptr((uint2*)input + num_elements), 16 | thrust::device_ptr(output), zero); 17 | 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_template_parameters.tmpl: -------------------------------------------------------------------------------- 1 | {%- if exists("templateParams") -%} 2 | {% include "synopsis_indent.tmpl" -%}template <{{ noop() -}} 3 | {%- for param in templateParams -%} 4 | {%- if not loop.is_first %}{% include "synopsis_indent.tmpl" -%}  {% endif -%} 5 | {{- param.type -}} 6 | {%- if not isEmpty(param.name) %} {% endif -%} 7 | {{- param.name -}} 8 | {%- if existsIn(param, "defvalPlain") %} = {{ escape(param.defvalPlain) }}{% endif -%} 9 | {%- if not loop.is_last -%} 10 | , 11 | {{- noop() }}{% include "synopsis_indent.tmpl" -%} 12 | {%- endif -%} 13 | {%- endfor -%}> 14 | {%- endif -%} 15 | -------------------------------------------------------------------------------- /testing/distance.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // TODO expand this with other iterator types (forward, bidirectional, etc.) 5 | 6 | template 7 | void TestDistance(void) 8 | { 9 | typedef typename Vector::iterator Iterator; 10 | 11 | Vector v(100); 12 | 13 | Iterator i = v.begin(); 14 | 15 | ASSERT_EQUAL(thrust::distance(i, v.end()), 100); 16 | 17 | i++; 18 | 19 | ASSERT_EQUAL(thrust::distance(i, v.end()), 99); 20 | 21 | i += 49; 22 | 23 | ASSERT_EQUAL(thrust::distance(i, v.end()), 50); 24 | 25 | ASSERT_EQUAL(thrust::distance(i, i), 0); 26 | } 27 | DECLARE_VECTOR_UNITTEST(TestDistance); 28 | 29 | -------------------------------------------------------------------------------- /testing/regression/nvbug_1990211__scan_requires_assignability_from_zero.fixed1.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | inline __host__ __device__ uint2 operator+(uint2 a, uint2 b) 5 | { 6 | return make_uint2(a.x + b.x, a.y + b.y); 7 | } 8 | 9 | int main() { 10 | int num_elements = 32; 11 | uint2 *input = NULL, *output = NULL; 12 | const uint2 zero = make_uint2(0,0); 13 | 14 | thrust::exclusive_scan(thrust::device_ptr((uint2*)input), 15 | thrust::device_ptr((uint2*)input + num_elements), 16 | thrust::device_ptr(output), zero, operator+); 17 | 18 | return 0; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /examples/cuda/wrap_pointer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(void) 6 | { 7 | size_t N = 10; 8 | 9 | // obtain raw pointer to device memory 10 | int * raw_ptr; 11 | cudaMalloc((void **) &raw_ptr, N * sizeof(int)); 12 | 13 | // wrap raw pointer with a device_ptr 14 | thrust::device_ptr dev_ptr = thrust::device_pointer_cast(raw_ptr); 15 | 16 | // use device_ptr in Thrust algorithms 17 | thrust::fill(dev_ptr, dev_ptr + N, (int) 0); 18 | 19 | // access device memory transparently through device_ptr 20 | dev_ptr[0] = 1; 21 | 22 | // free memory 23 | cudaFree(raw_ptr); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /testing/unittest/cuda/testframework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class CUDATestDriver 9 | : public UnitTestDriver 10 | { 11 | public: 12 | int current_device_architecture() const; 13 | 14 | private: 15 | std::vector target_devices(const ArgumentMap &kwargs); 16 | 17 | bool check_cuda_error(bool concise); 18 | 19 | virtual bool post_test_smoke_check(const UnitTest &test, bool concise); 20 | 21 | virtual bool run_tests(const ArgumentSet &args, const ArgumentMap &kwargs); 22 | }; 23 | 24 | UnitTestDriver &driver_instance(thrust::system::cuda::tag); 25 | 26 | -------------------------------------------------------------------------------- /testing/unittest/system.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // for demangling the result of type_info.name() 4 | // with msvc, type_info.name() is already demangled 5 | #ifdef __GNUC__ 6 | #include 7 | #endif // __GNUC__ 8 | 9 | #include 10 | #include 11 | 12 | namespace unittest 13 | { 14 | 15 | #if __GNUC__ && !_NVHPC_CUDA 16 | inline std::string demangle(const char* name) 17 | { 18 | int status = 0; 19 | char* realname = abi::__cxa_demangle(name, 0, 0, &status); 20 | std::string result(realname); 21 | std::free(realname); 22 | 23 | return result; 24 | } 25 | #else 26 | inline std::string demangle(const char* name) 27 | { 28 | return name; 29 | } 30 | #endif 31 | 32 | } // end unittest 33 | 34 | -------------------------------------------------------------------------------- /internal/build/generic_test.mk: -------------------------------------------------------------------------------- 1 | # Generic project mk that is included by unit tests mk 2 | EXECUTABLE := $(TEST_NAME) 3 | BUILD_SRC := $(ROOTDIR)/thrust/$(TEST_SRC) 4 | 5 | ifdef VULCAN 6 | INCLUDES_ABSPATH += $(VULCAN_TOOLKIT_BASE)/thrust/testing 7 | else 8 | INCLUDES_ABSPATH += $(ROOTDIR)/thrust/testing 9 | endif 10 | 11 | PROJ_LIBRARIES += testframework 12 | 13 | THRUST_TEST := 1 14 | 15 | include $(ROOTDIR)/thrust/internal/build/common_detect.mk 16 | 17 | TEST_MAKEFILE := $(join $(dir $(BUILD_SRC)), $(basename $(notdir $(BUILD_SRC))).mk) 18 | ifneq ("$(wildcard $(TEST_MAKEFILE))","") # Check if the file exists. 19 | include $(TEST_MAKEFILE) 20 | endif 21 | 22 | include $(ROOTDIR)/thrust/internal/build/common_build.mk 23 | 24 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_function.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- include "synopsis_inherited_from.tmpl" -%} 3 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 4 | {{- render("synopsis_brief.tmpl", child) -}} 5 | {{- render("synopsis_template_parameters.tmpl", child) -}} 6 | {{- render("synopsis_function_type_and_leading_specifiers.tmpl", child) -}} 7 | {{ noop() -}} 8 | {%- include "synopsis_indent.tmpl" -%} 9 | {% include "name.tmpl" %}{{ noop() -}} 10 | ({{- render("synopsis_function_parameters.tmpl", child) -}}){{ noop() -}} 11 | {{- render("synopsis_function_trailing_specifiers.tmpl", child) -}};{{- noop() -}} 12 | 13 | -------------------------------------------------------------------------------- /testing/regression/nvbug_1990211__scan_requires_assignability_from_zero.fixed0.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct uint2_adder 5 | { 6 | __host__ __device__ uint2 operator()(uint2 a, uint2 b) { 7 | return make_uint2(a.x + b.x, a.y + b.y); 8 | } 9 | }; 10 | 11 | int main() { 12 | int num_elements = 32; 13 | uint2 *input = NULL, *output = NULL; 14 | const uint2 zero = make_uint2(0,0); 15 | 16 | thrust::exclusive_scan(thrust::device_ptr((uint2*)input), 17 | thrust::device_ptr((uint2*)input + num_elements), 18 | thrust::device_ptr(output), zero, uint2_adder()); 19 | 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /examples/cpp_integration/host.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // defines the function prototype 10 | #include "device.h" 11 | 12 | int main(void) 13 | { 14 | // generate 20 random numbers on the host 15 | thrust::host_vector h_vec(20); 16 | thrust::default_random_engine rng; 17 | thrust::generate(h_vec.begin(), h_vec.end(), rng); 18 | 19 | // interface to CUDA code 20 | sort_on_device(h_vec); 21 | 22 | // print sorted array 23 | thrust::copy(h_vec.begin(), h_vec.end(), std::ostream_iterator(std::cout, "\n")); 24 | 25 | return 0; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /testing/caching_allocator.cu: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | template 7 | void test_implementation(Allocator alloc) 8 | { 9 | typedef typename thrust::detail::allocator_traits Traits; 10 | typedef typename Allocator::pointer Ptr; 11 | 12 | Ptr p = Traits::allocate(alloc, 123); 13 | Traits::deallocate(alloc, p, 123); 14 | 15 | Ptr p2 = Traits::allocate(alloc, 123); 16 | ASSERT_EQUAL(p, p2); 17 | } 18 | 19 | void TestSingleDeviceTLSCachingAllocator() 20 | { 21 | test_implementation(thrust::detail::single_device_tls_caching_allocator()); 22 | }; 23 | DECLARE_UNITTEST(TestSingleDeviceTLSCachingAllocator); 24 | -------------------------------------------------------------------------------- /thrust/system/cuda/detail/binary_search.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 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 | // this system has no special version of this algorithm 20 | -------------------------------------------------------------------------------- /internal/test/thrust.example.histogram.filecheck: -------------------------------------------------------------------------------- 1 | CHECK: Dense Histogram 2 | CHECK-NEXT: initial data 3 4 3 5 8 5 6 6 4 4 5 3 2 5 6 3 1 3 2 3 6 5 3 3 3 2 4 2 3 3 2 5 5 5 8 2 5 6 6 3 3 | CHECK-NEXT: sorted data 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 8 8 4 | CHECK-NEXT: cumulative histogram 0 1 7 19 23 32 38 38 40 5 | CHECK-NEXT: histogram 0 1 6 12 4 9 6 0 2 6 | CHECK-NEXT: Sparse Histogram 7 | CHECK-NEXT: initial data 3 4 3 5 8 5 6 6 4 4 5 3 2 5 6 3 1 3 2 3 6 5 3 3 3 2 4 2 3 3 2 5 5 5 8 2 5 6 6 3 8 | CHECK-NEXT: sorted data 1 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 8 8 9 | CHECK-NEXT: histogram values 1 2 3 4 5 6 8 10 | CHECK-NEXT: histogram counts 1 6 12 4 9 6 2 11 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/transform.h: -------------------------------------------------------------------------------- 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 20 | 21 | // cpp has no special transform 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/swap_ranges.h: -------------------------------------------------------------------------------- 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 20 | 21 | // cpp has no special swap_ranges 22 | 23 | -------------------------------------------------------------------------------- /thrust/mr/universal_memory_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-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 | #pragma once 18 | 19 | #include 20 | 21 | #include 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special fill functions 22 | 23 | -------------------------------------------------------------------------------- /testing/unittest_static_assert.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | template 6 | struct dependent_false 7 | { 8 | enum { value = false }; 9 | }; 10 | 11 | template 12 | struct static_assertion 13 | { 14 | __host__ __device__ 15 | T operator()() const 16 | { 17 | THRUST_STATIC_ASSERT(dependent_false::value); 18 | return 0; 19 | } 20 | }; 21 | 22 | template 23 | void TestStaticAssertAssert() 24 | { 25 | using value_type = typename V::value_type; 26 | V test(10); 27 | ASSERT_STATIC_ASSERT(thrust::generate(test.begin(), test.end(), 28 | static_assertion())); 29 | } 30 | DECLARE_VECTOR_UNITTEST(TestStaticAssertAssert); 31 | -------------------------------------------------------------------------------- /thrust/detail/swap.inl: -------------------------------------------------------------------------------- 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 20 | #include 21 | #include 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/count.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/equal.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/count.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special count functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/equal.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special equal functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/gather.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special gather functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/logical.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special logical functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/replace.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special replace functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/reverse.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special reverse functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/scatter.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special scatter functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/gather.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/generate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/logical.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/mismatch.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/replace.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/reverse.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/scatter.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/sequence.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/tabulate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cuda/detail/logical.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cuda/detail/sequence.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/generate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special generate functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/mismatch.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special mismatch functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/sequence.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special sequence functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/tabulate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special tabulate functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/transform.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special transform functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/inner_product.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/transform_scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/swap_ranges.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special swap_ranges functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/per_device_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | // this system has no special per device resource functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/temporary_buffer.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special temporary buffer functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/transform_reduce.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/uninitialized_copy.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/uninitialized_fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/cuda/detail/temporary_buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-2016 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 20 | 21 | // this system has no special temporary buffer functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/inner_product.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special inner_product functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/per_device_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | // this system has no special per device resource functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/temporary_buffer.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special temporary buffer functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/per_device_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | // this system has no special per device resource functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/temporary_buffer.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special temporary buffer functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/per_device_resource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | // this system has no special per device resource functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/temporary_buffer.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special temporary buffer functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/transform_reduce.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special transform_reduce functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/transform_scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/uninitialized_copy.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special version of this algorithm 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits fill 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits scan 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits fill 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /docs/doxybook/templates/synopsis_friend_class.tmpl: -------------------------------------------------------------------------------- 1 | {%- include "synopsis_leading_line_break.tmpl" -%} 2 | {%- include "synopsis_inherited_from.tmpl" -%} 3 | {%- set child.synopsis_indent_width = default(synopsis_indent_width, 0) -%} 4 | {{- render("synopsis_brief.tmpl", child) -}} 5 | {{- render("synopsis_template_parameters.tmpl", child) -}} 6 | {#- Unfortunately, the refid and URL for a friend class -#}{{ noop() -}} 7 | {#- incorrectly refers to a definition on the local -#}{{ noop() -}} 8 | {#- page, instead of the friend class's own page. -#}{{ noop() -}} 9 | {#- So we don't link to friend classes. -#}{{ noop() -}} 10 | {{ noop() -}} 11 | {%- include "synopsis_indent.tmpl" -%} 12 | {{- render("synopsis_kind_abbreviated.tmpl", child) -}} 13 | {{- render("name_qualified.tmpl", child) -}};{{ noop() -}} 14 | 15 | -------------------------------------------------------------------------------- /thrust/system/detail/sequential/uninitialized_fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system has no special unintialized_fill functions 22 | 23 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/count.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits count 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/equal.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits equal 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/gather.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits gather 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/merge.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits merge 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/count.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits count 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/equal.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits equal 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/gather.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits gather 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /examples/constant_iterator.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | int main(void) 10 | { 11 | thrust::device_vector data(4); 12 | data[0] = 3; 13 | data[1] = 7; 14 | data[2] = 2; 15 | data[3] = 5; 16 | 17 | // add 10 to all values in data 18 | thrust::transform(data.begin(), data.end(), 19 | thrust::constant_iterator(10), 20 | data.begin(), 21 | thrust::plus()); 22 | 23 | // data is now [13, 17, 12, 15] 24 | 25 | // print result 26 | thrust::copy(data.begin(), data.end(), std::ostream_iterator(std::cout, "\n")); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /thrust/detail/use_default.h: -------------------------------------------------------------------------------- 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 20 | 21 | THRUST_NAMESPACE_BEGIN 22 | 23 | struct use_default {}; 24 | 25 | THRUST_NAMESPACE_END 26 | 27 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/copy.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits copy 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/find.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits find 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/merge.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits merge 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits scan 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/sort.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits sort 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/logical.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits logical 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/reverse.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits reverse 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/transform.h: -------------------------------------------------------------------------------- 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 20 | 21 | // omp inherits transform 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/logical.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits logical 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/reverse.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits reverse 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/transform.h: -------------------------------------------------------------------------------- 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 20 | 21 | // omp inherits transform 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/copy_if.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits copy_if 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/reduce.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits reduce 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/remove.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits remove 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/unique.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits unique 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/generate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits generate 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/get_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits get_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/iter_swap.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits iter_swap 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/mismatch.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits mismatch 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/replace.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits this algorithm 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/scatter.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits this algorithm 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/sequence.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits sequence 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/swap_ranges.h: -------------------------------------------------------------------------------- 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 20 | 21 | // omp inherits swap_ranges 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/tabulate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits tabulate 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/generate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits generate 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/get_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits get_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/iter_swap.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits iter_swap 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/mismatch.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits mismatch 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/replace.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits this algorithm 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/scatter.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits this algorithm 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/sequence.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits sequence 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/swap_ranges.h: -------------------------------------------------------------------------------- 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 20 | 21 | // tbb inherits swap_ranges 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/tabulate.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits tabulate 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/for_each.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits for_each 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/scan_by_key.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits scan_by_key 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/detail/config.h: -------------------------------------------------------------------------------- 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 | /*! \file config.h 17 | * \brief Defines platform configuration. 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/get_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits get_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/iter_swap.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits iter_swap 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/partition.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits partition 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/assign_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits assign_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/scan_by_key.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits this algorithm 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/assign_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits assign_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/assign_value.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits assign_value 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/extrema.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits extrema algorithms 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/inner_product.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits inner_product 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/set_operations.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits set_operations 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/transform_scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits transform_scan 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/binary_search.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits binary_search 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/inner_product.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits inner_product 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/set_operations.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits set_operations 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/transform_scan.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits transform_scan 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/reduce_by_key.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits reduce_by_key 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/unique_by_key.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits unique_by_key 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/malloc_and_free.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits malloc and free 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/transform_reduce.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits transform_reduce 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/malloc_and_free.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits malloc and free 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/transform_reduce.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits transform_reduce 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /.github/workflows/add_to_project.yml: -------------------------------------------------------------------------------- 1 | name: Add new issue/PR to project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | pull_request_target: 9 | types: 10 | - opened 11 | 12 | jobs: 13 | add-to-project: 14 | name: Add issue or PR to project 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Generate token 18 | id: generate_token 19 | uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0 20 | with: 21 | app_id: ${{ secrets.CCCL_AUTH_APP_ID }} 22 | private_key: ${{ secrets.CCCL_AUTH_APP_PEM }} 23 | - name: Add to Project 24 | env: 25 | TOKEN: ${{ steps.generate_token.outputs.token }} 26 | uses: actions/add-to-project@v0.3.0 27 | with: 28 | project-url: https://github.com/orgs/NVIDIA/projects/6 29 | github-token: ${{ env.TOKEN }} 30 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/malloc_and_free.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits malloc & free 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/set_operations.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits the set operations 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /examples/cuda/unwrap_pointer.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(void) 8 | { 9 | size_t N = 10; 10 | 11 | // create a device_ptr 12 | thrust::device_ptr dev_ptr = thrust::device_malloc(N); 13 | 14 | // extract raw pointer from device_ptr 15 | int * raw_ptr = thrust::raw_pointer_cast(dev_ptr); 16 | 17 | // use raw_ptr in CUDA API functions 18 | cudaMemset(raw_ptr, 0, N * sizeof(int)); 19 | 20 | // free memory 21 | thrust::device_free(dev_ptr); 22 | 23 | // we can use the same approach for device_vector 24 | thrust::device_vector d_vec(N); 25 | 26 | // note: d_vec.data() returns a device_ptr 27 | raw_ptr = thrust::raw_pointer_cast(d_vec.data()); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /testing/generate_const_iterators.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct generator 6 | { 7 | __host__ __device__ 8 | int operator()() const 9 | { 10 | return 1; 11 | } 12 | }; 13 | 14 | void TestGenerateConstIteratorCompilationError() 15 | { 16 | thrust::host_vector test1(10); 17 | 18 | ASSERT_STATIC_ASSERT(thrust::generate(test1.cbegin(), test1.cend(), generator())); 19 | ASSERT_STATIC_ASSERT(thrust::generate_n(test1.cbegin(), 10, generator())); 20 | } 21 | DECLARE_UNITTEST(TestGenerateConstIteratorCompilationError); 22 | 23 | void TestFillConstIteratorCompilationError() 24 | { 25 | thrust::host_vector test1(10); 26 | ASSERT_STATIC_ASSERT(thrust::fill(test1.cbegin(), test1.cend(), 1)); 27 | } 28 | DECLARE_UNITTEST(TestFillConstIteratorCompilationError); 29 | 30 | -------------------------------------------------------------------------------- /thrust/cmake/thrust-header-search.cmake.in: -------------------------------------------------------------------------------- 1 | # Parse version information from version.h: 2 | unset(_THRUST_VERSION_INCLUDE_DIR CACHE) # Clear old result to force search 3 | 4 | # Find CMAKE_INSTALL_INCLUDEDIR=@CMAKE_INSTALL_INCLUDEDIR@ directory" 5 | set(from_install_prefix "@install_location@") 6 | 7 | # Transform to a list of directories, replace each directoy with "../" 8 | # and convert back to a string 9 | string(REGEX REPLACE "/" ";" from_install_prefix "${from_install_prefix}") 10 | list(TRANSFORM from_install_prefix REPLACE ".+" "../") 11 | list(JOIN from_install_prefix "" from_install_prefix) 12 | 13 | find_path(_THRUST_VERSION_INCLUDE_DIR thrust/version.h 14 | NO_DEFAULT_PATH # Only search explicit paths below: 15 | PATHS 16 | "${CMAKE_CURRENT_LIST_DIR}/${from_install_prefix}/@CMAKE_INSTALL_INCLUDEDIR@" 17 | ) 18 | set_property(CACHE _THRUST_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL) 19 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/scan_by_key.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits the scan_by_key algorithms 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/uninitialized_copy.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits uninitialized_copy 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/omp/detail/uninitialized_fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits uninitialized_fill 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/uninitialized_copy.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits uninitialized_copy 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/tbb/detail/uninitialized_fill.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits uninitialized_fill 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/adjacent_difference.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits adjacent_difference 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/event.h: -------------------------------------------------------------------------------- 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 thrust/event.h 18 | * \brief `thrust::event`, an asynchronous handle type. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include 24 | 25 | // TODO: Actually separate `` into two headers. 26 | 27 | -------------------------------------------------------------------------------- /thrust/system/cpp/detail/binary_search.h: -------------------------------------------------------------------------------- 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 20 | 21 | // this system inherits the binary search algorithms 22 | #include 23 | 24 | -------------------------------------------------------------------------------- /thrust/universal_ptr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-2020 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | /*! \file universal_ptr.h 19 | * \brief A pointer to a variable which resides memory accessible to both 20 | * hosts and devices. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | -------------------------------------------------------------------------------- /internal/racecheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | MEMCHECK=/work/nightly/memcheck/bin/x86_64_Linux_release/cuda-memcheck 3 | 4 | ######################### 5 | 6 | files=`ls thrust.test.*`; 7 | files=`ls thrust.example.*`; 8 | 9 | ######################### 10 | 11 | nfiles=0 12 | for fn in $files; do 13 | nfiles=$((nfiles + 1)) 14 | done 15 | j=1 16 | for fn in $files; do 17 | echo " ----------------------------------------------------------------------" 18 | echo " *** MEMCHECK *** [$j/$nfiles] $fn" 19 | echo " ----------------------------------------------------------------------" 20 | $MEMCHECK --tool memcheck ./$fn --verbose 21 | echo " ----------------------------------------------------------------------" 22 | echo " *** RACECHECK *** [$j/$nfiles] $fn" 23 | echo " ----------------------------------------------------------------------" 24 | $MEMCHECK --tool racecheck ./$fn --verbose --sizes=small 25 | j=$((j+1)) 26 | done; 27 | -------------------------------------------------------------------------------- /thrust/addressof.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018 NVIDIA Corporation 2 | // Author: Bryce Adelstein Lelbach 3 | // 4 | // Distributed under the Boost Software License v1.0 (boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #if THRUST_CPP_DIALECT >= 2011 11 | # include 12 | #endif 13 | 14 | THRUST_NAMESPACE_BEGIN 15 | 16 | /////////////////////////////////////////////////////////////////////////////// 17 | 18 | /*! Obtains the actual address of the object or function arg, even in presence of overloaded operator&. 19 | */ 20 | template 21 | __host__ __device__ 22 | T* addressof(T& arg) 23 | { 24 | return reinterpret_cast( 25 | &const_cast(reinterpret_cast(arg)) 26 | ); 27 | } 28 | 29 | /////////////////////////////////////////////////////////////////////////////// 30 | 31 | THRUST_NAMESPACE_END 32 | -------------------------------------------------------------------------------- /examples/cpp_integration/README: -------------------------------------------------------------------------------- 1 | This example shows how to link a Thrust program contained in 2 | a .cu file with a C++ program contained in a .cpp file. Note 3 | that device_vector only appears in the .cu file while host_vector 4 | appears in both. This relects the fact that algorithms on device 5 | vectors are only available when the contents of the program are 6 | located in a .cu file and compiled with the nvcc compiler. 7 | 8 | On a Linux system where Thrust is installed in the default location 9 | we can use the following procedure to compile the two parts of the 10 | program and link them together. 11 | 12 | $ nvcc -O2 -c device.cu 13 | $ g++ -O2 -c host.cpp -I/usr/local/cuda/include/ 14 | $ nvcc -o tester device.o host.o 15 | 16 | Alternatively, we can use g++ to perform final linking step. 17 | 18 | $ nvcc -O2 -c device.cu 19 | $ g++ -O2 -c host.cpp -I/usr/local/cuda/include/ 20 | $ g++ -o tester device.o host.o -L/usr/local/cuda/lib64 -lcudart 21 | 22 | -------------------------------------------------------------------------------- /.github/workflows/deploy-documentation-github-pages.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Documentation GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - "main" 7 | 8 | # Trigger on request. 9 | workflow_dispatch: 10 | 11 | jobs: 12 | deploy-documentation-github-pages: 13 | runs-on: ubuntu-latest 14 | container: gpuci/cccl:cuda11.7.0-devel-ubuntu20.04-gcc9 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v3 18 | - name: Generate documentation markdown 19 | run: ./docs/generate_markdown.bash --clean 20 | - name: Deploy generated documentation markdown to gh-pages branch 21 | uses: peaceiris/actions-gh-pages@v3 22 | if: github.ref == 'refs/heads/main' 23 | with: 24 | github_token: ${{ secrets.GITHUB_TOKEN }} 25 | publish_dir: ./build_docs/github_pages 26 | enable_jekyll: true 27 | commit_message: "Deploy Documentation: ${{ github.event.head_commit.message }}" 28 | -------------------------------------------------------------------------------- /examples/cmake/add_subdir/dummy.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | std::cout << "Hello from Thrust version " << THRUST_VERSION << ":\n" 8 | 9 | << "Host system: " 10 | #if THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_CPP 11 | << "CPP\n" 12 | #elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_OMP 13 | << "OMP\n" 14 | #elif THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_TBB 15 | << "TBB\n" 16 | #else 17 | << "Unknown\n" 18 | #endif 19 | 20 | << "Device system: " 21 | #if THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CPP 22 | << "CPP\n"; 23 | #elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA 24 | << "CUDA\n"; 25 | #elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP 26 | << "OMP\n"; 27 | #elif THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB 28 | << "TBB\n"; 29 | #else 30 | << "Unknown\n"; 31 | #endif 32 | } 33 | -------------------------------------------------------------------------------- /examples/fill_copy_sequence.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | int main(void) 10 | { 11 | // initialize all ten integers of a device_vector to 1 12 | thrust::device_vector D(10, 1); 13 | 14 | // set the first seven elements of a vector to 9 15 | thrust::fill(D.begin(), D.begin() + 7, 9); 16 | 17 | // initialize a host_vector with the first five elements of D 18 | thrust::host_vector H(D.begin(), D.begin() + 5); 19 | 20 | // set the elements of H to 0, 1, 2, 3, ... 21 | thrust::sequence(H.begin(), H.end()); 22 | 23 | // copy all of H back to the beginning of D 24 | thrust::copy(H.begin(), H.end(), D.begin()); 25 | 26 | // print D 27 | for(size_t i = 0; i < D.size(); i++) 28 | std::cout << "D[" << i << "] = " << D[i] << std::endl; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /testing/unittest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | foreach(thrust_target IN LISTS THRUST_TARGETS) 2 | thrust_get_target_property(config_device ${thrust_target} DEVICE) 3 | thrust_get_target_property(config_prefix ${thrust_target} PREFIX) 4 | 5 | set(framework_target ${config_prefix}.test.framework) 6 | 7 | if ("CUDA" STREQUAL "${config_device}") 8 | set(framework_srcs 9 | testframework.cu 10 | cuda/testframework.cu 11 | ) 12 | else() 13 | # Wrap the cu file inside a .cpp file for non-CUDA builds 14 | thrust_wrap_cu_in_cpp(framework_srcs testframework.cu ${thrust_target}) 15 | endif() 16 | 17 | add_library(${framework_target} STATIC ${framework_srcs}) 18 | target_link_libraries(${framework_target} PUBLIC ${thrust_target}) 19 | target_include_directories(${framework_target} PRIVATE "${Thrust_SOURCE_DIR}/testing") 20 | thrust_clone_target_properties(${framework_target} ${thrust_target}) 21 | 22 | thrust_fix_clang_nvcc_build_for(${framework_target}) 23 | 24 | endforeach() 25 | -------------------------------------------------------------------------------- /thrust/detail/reference_forward_declaration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2008-2020 NVIDIA Corporation 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | THRUST_NAMESPACE_BEGIN 23 | 24 | template 25 | class reference; 26 | 27 | THRUST_NAMESPACE_END 28 | 29 | --------------------------------------------------------------------------------