├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── LICENSE ├── R-package ├── .Rbuildignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── R │ ├── aliases.R │ ├── callback.R │ ├── lgb.Booster.R │ ├── lgb.Dataset.R │ ├── lgb.Predictor.R │ ├── lgb.cv.R │ ├── lgb.importance.R │ ├── lgb.interprete.R │ ├── lgb.model.dt.tree.R │ ├── lgb.plot.importance.R │ ├── lgb.plot.interpretation.R │ ├── lgb.prepare.R │ ├── lgb.prepare2.R │ ├── lgb.prepare_rules.R │ ├── lgb.prepare_rules2.R │ ├── lgb.train.R │ ├── lgb.unloader.R │ ├── lightgbm.R │ ├── readRDS.lgb.Booster.R │ ├── saveRDS.lgb.Booster.R │ └── utils.R ├── README.md ├── data │ ├── agaricus.test.rda │ ├── agaricus.train.rda │ └── bank.rda ├── demo │ ├── 00Index │ ├── basic_walkthrough.R │ ├── boost_from_prediction.R │ ├── categorical_features_prepare.R │ ├── categorical_features_rules.R │ ├── cross_validation.R │ ├── early_stopping.R │ ├── efficient_many_training.R │ ├── leaf_stability.R │ ├── multiclass.R │ ├── multiclass_custom_objective.R │ └── weight_param.R ├── inst │ └── bin │ │ └── .gitkeep ├── man │ ├── agaricus.test.Rd │ ├── agaricus.train.Rd │ ├── bank.Rd │ ├── dim.Rd │ ├── dimnames.lgb.Dataset.Rd │ ├── getinfo.Rd │ ├── lgb.Dataset.Rd │ ├── lgb.Dataset.construct.Rd │ ├── lgb.Dataset.create.valid.Rd │ ├── lgb.Dataset.save.Rd │ ├── lgb.Dataset.set.categorical.Rd │ ├── lgb.Dataset.set.reference.Rd │ ├── lgb.cv.Rd │ ├── lgb.dump.Rd │ ├── lgb.get.eval.result.Rd │ ├── lgb.importance.Rd │ ├── lgb.interprete.Rd │ ├── lgb.load.Rd │ ├── lgb.model.dt.tree.Rd │ ├── lgb.plot.importance.Rd │ ├── lgb.plot.interpretation.Rd │ ├── lgb.prepare.Rd │ ├── lgb.prepare2.Rd │ ├── lgb.prepare_rules.Rd │ ├── lgb.prepare_rules2.Rd │ ├── lgb.save.Rd │ ├── lgb.train.Rd │ ├── lgb.unloader.Rd │ ├── lgb_shared_params.Rd │ ├── lightgbm.Rd │ ├── predict.lgb.Booster.Rd │ ├── readRDS.lgb.Booster.Rd │ ├── saveRDS.lgb.Booster.Rd │ ├── setinfo.Rd │ └── slice.Rd ├── pkgdown │ ├── _pkgdown.yml │ └── extra.js ├── src │ ├── Makevars │ ├── Makevars.win │ └── install.libs.R └── tests │ ├── testthat.R │ └── testthat │ ├── test_basic.R │ ├── test_custom_objective.R │ ├── test_dataset.R │ ├── test_lgb.importance.R │ ├── test_lgb.interprete.R │ ├── test_lgb.plot.interpretation.R │ └── test_parameters.R ├── README.md ├── README_CH.md ├── VERSION.txt ├── build_r.R ├── build_r_site.R ├── compute ├── .appveyor.yml ├── .coveralls.yml ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE_1_0.txt ├── README.md ├── cmake │ ├── BoostComputeConfig.cmake.in │ ├── FindBolt.cmake │ ├── FindEigen.cmake │ ├── FindTBB.cmake │ └── opencl │ │ └── FindOpenCL.cmake ├── doc │ ├── Jamfile.v2 │ ├── advanced_topics.qbk │ ├── compute.qbk │ ├── design.qbk │ ├── faq.qbk │ ├── getting_started.qbk │ ├── interop.qbk │ ├── introduction.qbk │ ├── performance.qbk │ ├── platforms_and_compilers.qbk │ ├── porting_guide.qbk │ ├── reference.qbk │ └── tutorial.qbk ├── example │ ├── CMakeLists.txt │ ├── amd_cpp_kernel.cpp │ ├── batched_determinant.cpp │ ├── black_scholes.cpp │ ├── copy_data.cpp │ ├── fizz_buzz.cpp │ ├── hello_world.cpp │ ├── host_sort.cpp │ ├── inline_ptx.cpp │ ├── k_means.cpp │ ├── list_devices.cpp │ ├── longest_vector.cpp │ ├── mandelbrot.cpp │ ├── mapped_view.cpp │ ├── matrix_transpose.cpp │ ├── memory_limits.cpp │ ├── monte_carlo.cpp │ ├── nbody.cpp │ ├── opencl_test.cpp │ ├── opencv_convolution.cpp │ ├── opencv_flip.cpp │ ├── opencv_histogram.cpp │ ├── opencv_optical_flow.cpp │ ├── opencv_sobel_filter.cpp │ ├── opengl_sphere.cpp │ ├── point_centroid.cpp │ ├── price_cross.cpp │ ├── print_vector.cpp │ ├── qimage_blur.cpp │ ├── random_walk.cpp │ ├── resize_image.cpp │ ├── simple_kernel.cpp │ ├── simple_moving_average.cpp │ ├── sort_vector.cpp │ ├── threefry_engine.cpp │ ├── time_copy.cpp │ ├── transform_sqrt.cpp │ └── vector_addition.cpp ├── include │ └── boost │ │ ├── compute.hpp │ │ └── compute │ │ ├── algorithm.hpp │ │ ├── algorithm │ │ ├── accumulate.hpp │ │ ├── adjacent_difference.hpp │ │ ├── adjacent_find.hpp │ │ ├── all_of.hpp │ │ ├── any_of.hpp │ │ ├── binary_search.hpp │ │ ├── copy.hpp │ │ ├── copy_if.hpp │ │ ├── copy_n.hpp │ │ ├── count.hpp │ │ ├── count_if.hpp │ │ ├── detail │ │ │ ├── balanced_path.hpp │ │ │ ├── binary_find.hpp │ │ │ ├── compact.hpp │ │ │ ├── copy_on_device.hpp │ │ │ ├── copy_to_device.hpp │ │ │ ├── copy_to_host.hpp │ │ │ ├── count_if_with_ballot.hpp │ │ │ ├── count_if_with_reduce.hpp │ │ │ ├── count_if_with_threads.hpp │ │ │ ├── find_extrema.hpp │ │ │ ├── find_extrema_on_cpu.hpp │ │ │ ├── find_extrema_with_atomics.hpp │ │ │ ├── find_extrema_with_reduce.hpp │ │ │ ├── find_if_with_atomics.hpp │ │ │ ├── inplace_reduce.hpp │ │ │ ├── insertion_sort.hpp │ │ │ ├── merge_path.hpp │ │ │ ├── merge_sort_on_cpu.hpp │ │ │ ├── merge_sort_on_gpu.hpp │ │ │ ├── merge_with_merge_path.hpp │ │ │ ├── radix_sort.hpp │ │ │ ├── random_fill.hpp │ │ │ ├── reduce_by_key.hpp │ │ │ ├── reduce_by_key_with_scan.hpp │ │ │ ├── reduce_on_cpu.hpp │ │ │ ├── reduce_on_gpu.hpp │ │ │ ├── scan.hpp │ │ │ ├── scan_on_cpu.hpp │ │ │ ├── scan_on_gpu.hpp │ │ │ ├── search_all.hpp │ │ │ ├── serial_accumulate.hpp │ │ │ ├── serial_count_if.hpp │ │ │ ├── serial_find_extrema.hpp │ │ │ ├── serial_merge.hpp │ │ │ ├── serial_reduce.hpp │ │ │ ├── serial_reduce_by_key.hpp │ │ │ └── serial_scan.hpp │ │ ├── equal.hpp │ │ ├── equal_range.hpp │ │ ├── exclusive_scan.hpp │ │ ├── fill.hpp │ │ ├── fill_n.hpp │ │ ├── find.hpp │ │ ├── find_end.hpp │ │ ├── find_if.hpp │ │ ├── find_if_not.hpp │ │ ├── for_each.hpp │ │ ├── for_each_n.hpp │ │ ├── gather.hpp │ │ ├── generate.hpp │ │ ├── generate_n.hpp │ │ ├── includes.hpp │ │ ├── inclusive_scan.hpp │ │ ├── inner_product.hpp │ │ ├── inplace_merge.hpp │ │ ├── iota.hpp │ │ ├── is_partitioned.hpp │ │ ├── is_permutation.hpp │ │ ├── is_sorted.hpp │ │ ├── lexicographical_compare.hpp │ │ ├── lower_bound.hpp │ │ ├── max_element.hpp │ │ ├── merge.hpp │ │ ├── min_element.hpp │ │ ├── minmax_element.hpp │ │ ├── mismatch.hpp │ │ ├── next_permutation.hpp │ │ ├── none_of.hpp │ │ ├── nth_element.hpp │ │ ├── partial_sum.hpp │ │ ├── partition.hpp │ │ ├── partition_copy.hpp │ │ ├── partition_point.hpp │ │ ├── prev_permutation.hpp │ │ ├── random_shuffle.hpp │ │ ├── reduce.hpp │ │ ├── reduce_by_key.hpp │ │ ├── remove.hpp │ │ ├── remove_if.hpp │ │ ├── replace.hpp │ │ ├── replace_copy.hpp │ │ ├── reverse.hpp │ │ ├── reverse_copy.hpp │ │ ├── rotate.hpp │ │ ├── rotate_copy.hpp │ │ ├── scatter.hpp │ │ ├── scatter_if.hpp │ │ ├── search.hpp │ │ ├── search_n.hpp │ │ ├── set_difference.hpp │ │ ├── set_intersection.hpp │ │ ├── set_symmetric_difference.hpp │ │ ├── set_union.hpp │ │ ├── sort.hpp │ │ ├── sort_by_key.hpp │ │ ├── stable_partition.hpp │ │ ├── stable_sort.hpp │ │ ├── stable_sort_by_key.hpp │ │ ├── swap_ranges.hpp │ │ ├── transform.hpp │ │ ├── transform_if.hpp │ │ ├── transform_reduce.hpp │ │ ├── unique.hpp │ │ ├── unique_copy.hpp │ │ └── upper_bound.hpp │ │ ├── allocator.hpp │ │ ├── allocator │ │ ├── buffer_allocator.hpp │ │ └── pinned_allocator.hpp │ │ ├── async.hpp │ │ ├── async │ │ ├── future.hpp │ │ ├── wait.hpp │ │ └── wait_guard.hpp │ │ ├── buffer.hpp │ │ ├── cl.hpp │ │ ├── cl_ext.hpp │ │ ├── closure.hpp │ │ ├── command_queue.hpp │ │ ├── config.hpp │ │ ├── container.hpp │ │ ├── container │ │ ├── array.hpp │ │ ├── basic_string.hpp │ │ ├── detail │ │ │ └── scalar.hpp │ │ ├── dynamic_bitset.hpp │ │ ├── flat_map.hpp │ │ ├── flat_set.hpp │ │ ├── mapped_view.hpp │ │ ├── stack.hpp │ │ ├── string.hpp │ │ ├── valarray.hpp │ │ └── vector.hpp │ │ ├── context.hpp │ │ ├── core.hpp │ │ ├── detail │ │ ├── assert_cl_success.hpp │ │ ├── buffer_value.hpp │ │ ├── cl_versions.hpp │ │ ├── device_ptr.hpp │ │ ├── diagnostic.hpp │ │ ├── duration.hpp │ │ ├── get_object_info.hpp │ │ ├── getenv.hpp │ │ ├── global_static.hpp │ │ ├── is_buffer_iterator.hpp │ │ ├── is_contiguous_iterator.hpp │ │ ├── iterator_plus_distance.hpp │ │ ├── iterator_range_size.hpp │ │ ├── iterator_traits.hpp │ │ ├── literal.hpp │ │ ├── lru_cache.hpp │ │ ├── meta_kernel.hpp │ │ ├── mpl_vector_to_tuple.hpp │ │ ├── nvidia_compute_capability.hpp │ │ ├── parameter_cache.hpp │ │ ├── path.hpp │ │ ├── print_range.hpp │ │ ├── read_write_single_value.hpp │ │ ├── sha1.hpp │ │ ├── variadic_macros.hpp │ │ ├── vendor.hpp │ │ └── work_size.hpp │ │ ├── device.hpp │ │ ├── event.hpp │ │ ├── exception.hpp │ │ ├── exception │ │ ├── context_error.hpp │ │ ├── no_device_found.hpp │ │ ├── opencl_error.hpp │ │ ├── program_build_failure.hpp │ │ └── unsupported_extension_error.hpp │ │ ├── experimental │ │ ├── clamp_range.hpp │ │ ├── malloc.hpp │ │ ├── sort_by_transform.hpp │ │ └── tabulate.hpp │ │ ├── function.hpp │ │ ├── functional.hpp │ │ ├── functional │ │ ├── as.hpp │ │ ├── atomic.hpp │ │ ├── bind.hpp │ │ ├── common.hpp │ │ ├── convert.hpp │ │ ├── detail │ │ │ ├── macros.hpp │ │ │ ├── nvidia_ballot.hpp │ │ │ ├── nvidia_popcount.hpp │ │ │ └── unpack.hpp │ │ ├── field.hpp │ │ ├── geometry.hpp │ │ ├── get.hpp │ │ ├── hash.hpp │ │ ├── identity.hpp │ │ ├── integer.hpp │ │ ├── logical.hpp │ │ ├── math.hpp │ │ ├── operator.hpp │ │ ├── popcount.hpp │ │ └── relational.hpp │ │ ├── image.hpp │ │ ├── image │ │ ├── image1d.hpp │ │ ├── image2d.hpp │ │ ├── image3d.hpp │ │ ├── image_format.hpp │ │ ├── image_object.hpp │ │ └── image_sampler.hpp │ │ ├── image2d.hpp │ │ ├── image3d.hpp │ │ ├── image_format.hpp │ │ ├── image_sampler.hpp │ │ ├── interop │ │ ├── eigen.hpp │ │ ├── eigen │ │ │ └── core.hpp │ │ ├── opencv.hpp │ │ ├── opencv │ │ │ ├── core.hpp │ │ │ ├── highgui.hpp │ │ │ └── ocl.hpp │ │ ├── opengl.hpp │ │ ├── opengl │ │ │ ├── acquire.hpp │ │ │ ├── cl_gl.hpp │ │ │ ├── cl_gl_ext.hpp │ │ │ ├── context.hpp │ │ │ ├── gl.hpp │ │ │ ├── opengl_buffer.hpp │ │ │ ├── opengl_renderbuffer.hpp │ │ │ └── opengl_texture.hpp │ │ ├── qt.hpp │ │ ├── qt │ │ │ ├── qimage.hpp │ │ │ ├── qpoint.hpp │ │ │ ├── qpointf.hpp │ │ │ ├── qtcore.hpp │ │ │ ├── qtgui.hpp │ │ │ └── qvector.hpp │ │ ├── vtk.hpp │ │ └── vtk │ │ │ ├── bounds.hpp │ │ │ ├── data_array.hpp │ │ │ ├── matrix4x4.hpp │ │ │ └── points.hpp │ │ ├── iterator.hpp │ │ ├── iterator │ │ ├── buffer_iterator.hpp │ │ ├── constant_buffer_iterator.hpp │ │ ├── constant_iterator.hpp │ │ ├── counting_iterator.hpp │ │ ├── detail │ │ │ ├── get_base_iterator_buffer.hpp │ │ │ └── swizzle_iterator.hpp │ │ ├── discard_iterator.hpp │ │ ├── function_input_iterator.hpp │ │ ├── permutation_iterator.hpp │ │ ├── strided_iterator.hpp │ │ ├── transform_iterator.hpp │ │ └── zip_iterator.hpp │ │ ├── kernel.hpp │ │ ├── lambda.hpp │ │ ├── lambda │ │ ├── context.hpp │ │ ├── functional.hpp │ │ ├── get.hpp │ │ ├── make_pair.hpp │ │ ├── make_tuple.hpp │ │ ├── placeholder.hpp │ │ ├── placeholders.hpp │ │ └── result_of.hpp │ │ ├── memory.hpp │ │ ├── memory │ │ ├── local_buffer.hpp │ │ └── svm_ptr.hpp │ │ ├── memory_object.hpp │ │ ├── pipe.hpp │ │ ├── platform.hpp │ │ ├── program.hpp │ │ ├── random.hpp │ │ ├── random │ │ ├── bernoulli_distribution.hpp │ │ ├── default_random_engine.hpp │ │ ├── discrete_distribution.hpp │ │ ├── linear_congruential_engine.hpp │ │ ├── mersenne_twister_engine.hpp │ │ ├── normal_distribution.hpp │ │ ├── threefry_engine.hpp │ │ ├── uniform_int_distribution.hpp │ │ └── uniform_real_distribution.hpp │ │ ├── source.hpp │ │ ├── svm.hpp │ │ ├── system.hpp │ │ ├── type_traits.hpp │ │ ├── type_traits │ │ ├── common_type.hpp │ │ ├── detail │ │ │ └── capture_traits.hpp │ │ ├── is_device_iterator.hpp │ │ ├── is_fundamental.hpp │ │ ├── is_vector_type.hpp │ │ ├── make_vector_type.hpp │ │ ├── result_of.hpp │ │ ├── scalar_type.hpp │ │ ├── type_definition.hpp │ │ ├── type_name.hpp │ │ └── vector_size.hpp │ │ ├── types.hpp │ │ ├── types │ │ ├── builtin.hpp │ │ ├── complex.hpp │ │ ├── fundamental.hpp │ │ ├── pair.hpp │ │ ├── size_t.hpp │ │ ├── struct.hpp │ │ └── tuple.hpp │ │ ├── user_event.hpp │ │ ├── utility.hpp │ │ ├── utility │ │ ├── dim.hpp │ │ ├── extents.hpp │ │ ├── invoke.hpp │ │ ├── program_cache.hpp │ │ ├── source.hpp │ │ └── wait_list.hpp │ │ ├── version.hpp │ │ └── wait_list.hpp ├── index.html ├── meta │ └── libraries.json ├── perf │ ├── CMakeLists.txt │ ├── perf.hpp │ ├── perf.py │ ├── perf_accumulate.cpp │ ├── perf_bernoulli_distribution.cpp │ ├── perf_binary_find.cpp │ ├── perf_bolt_accumulate.cpp │ ├── perf_bolt_count.cpp │ ├── perf_bolt_exclusive_scan.cpp │ ├── perf_bolt_fill.cpp │ ├── perf_bolt_inner_product.cpp │ ├── perf_bolt_max_element.cpp │ ├── perf_bolt_merge.cpp │ ├── perf_bolt_partial_sum.cpp │ ├── perf_bolt_reduce_by_key.cpp │ ├── perf_bolt_saxpy.cpp │ ├── perf_bolt_sort.cpp │ ├── perf_cart_to_polar.cpp │ ├── perf_comparison_sort.cpp │ ├── perf_copy_if.cpp │ ├── perf_copy_to_device.cpp │ ├── perf_count.cpp │ ├── perf_discrete_distribution.cpp │ ├── perf_erase_remove.cpp │ ├── perf_exclusive_scan.cpp │ ├── perf_fill.cpp │ ├── perf_find.cpp │ ├── perf_find_end.cpp │ ├── perf_host_sort.cpp │ ├── perf_includes.cpp │ ├── perf_inner_product.cpp │ ├── perf_is_permutation.cpp │ ├── perf_is_sorted.cpp │ ├── perf_max_element.cpp │ ├── perf_merge.cpp │ ├── perf_next_permutation.cpp │ ├── perf_nth_element.cpp │ ├── perf_partial_sum.cpp │ ├── perf_partition.cpp │ ├── perf_partition_point.cpp │ ├── perf_prev_permutation.cpp │ ├── perf_random_number_engine.cpp │ ├── perf_reduce_by_key.cpp │ ├── perf_reverse.cpp │ ├── perf_reverse_copy.cpp │ ├── perf_rotate.cpp │ ├── perf_rotate_copy.cpp │ ├── perf_saxpy.cpp │ ├── perf_search.cpp │ ├── perf_search_n.cpp │ ├── perf_set_difference.cpp │ ├── perf_set_intersection.cpp │ ├── perf_set_symmetric_difference.cpp │ ├── perf_set_union.cpp │ ├── perf_sort.cpp │ ├── perf_sort_by_key.cpp │ ├── perf_sort_float.cpp │ ├── perf_stable_partition.cpp │ ├── perf_stl_accumulate.cpp │ ├── perf_stl_count.cpp │ ├── perf_stl_find.cpp │ ├── perf_stl_find_end.cpp │ ├── perf_stl_includes.cpp │ ├── perf_stl_inner_product.cpp │ ├── perf_stl_is_permutation.cpp │ ├── perf_stl_max_element.cpp │ ├── perf_stl_merge.cpp │ ├── perf_stl_next_permutation.cpp │ ├── perf_stl_partial_sum.cpp │ ├── perf_stl_partition.cpp │ ├── perf_stl_partition_point.cpp │ ├── perf_stl_prev_permutation.cpp │ ├── perf_stl_reverse.cpp │ ├── perf_stl_reverse_copy.cpp │ ├── perf_stl_rotate.cpp │ ├── perf_stl_rotate_copy.cpp │ ├── perf_stl_saxpy.cpp │ ├── perf_stl_search.cpp │ ├── perf_stl_search_n.cpp │ ├── perf_stl_set_difference.cpp │ ├── perf_stl_set_intersection.cpp │ ├── perf_stl_set_symmetric_difference.cpp │ ├── perf_stl_set_union.cpp │ ├── perf_stl_sort.cpp │ ├── perf_stl_stable_partition.cpp │ ├── perf_stl_unique.cpp │ ├── perf_stl_unique_copy.cpp │ ├── perf_tbb_accumulate.cpp │ ├── perf_tbb_merge.cpp │ ├── perf_tbb_sort.cpp │ ├── perf_thrust_accumulate.cu │ ├── perf_thrust_count.cu │ ├── perf_thrust_exclusive_scan.cu │ ├── perf_thrust_find.cu │ ├── perf_thrust_inner_product.cu │ ├── perf_thrust_merge.cu │ ├── perf_thrust_partial_sum.cu │ ├── perf_thrust_partition.cu │ ├── perf_thrust_reduce_by_key.cu │ ├── perf_thrust_reverse.cu │ ├── perf_thrust_reverse_copy.cu │ ├── perf_thrust_rotate.cu │ ├── perf_thrust_saxpy.cu │ ├── perf_thrust_set_difference.cu │ ├── perf_thrust_sort.cu │ ├── perf_thrust_unique.cu │ ├── perf_uniform_int_distribution.cpp │ ├── perf_unique.cpp │ ├── perf_unique_copy.cpp │ └── perfdoc.py └── test │ ├── CMakeLists.txt │ ├── Jamfile.v2 │ ├── check │ └── has_opencl.cpp │ ├── check_macros.hpp │ ├── context_setup.hpp │ ├── data │ ├── invalid_program.cl │ ├── program.cl │ ├── program.spirv32 │ └── program.spirv64 │ ├── extra │ ├── CMakeLists.txt │ ├── test_interop_eigen.cpp │ ├── test_interop_opencv.cpp │ ├── test_interop_opengl.cpp │ ├── test_interop_qt.cpp │ ├── test_interop_vtk.cpp │ ├── test_multiple_objects1.cpp │ └── test_multiple_objects2.cpp │ ├── opencl_version_check.hpp │ ├── quirks.hpp │ ├── test_accumulate.cpp │ ├── test_adjacent_difference.cpp │ ├── test_adjacent_find.cpp │ ├── test_amd_cpp_kernel_language.cpp │ ├── test_any_all_none_of.cpp │ ├── test_array.cpp │ ├── test_async_wait.cpp │ ├── test_async_wait_guard.cpp │ ├── test_bernoulli_distribution.cpp │ ├── test_binary_search.cpp │ ├── test_buffer.cpp │ ├── test_buffer_allocator.cpp │ ├── test_buffer_iterator.cpp │ ├── test_clamp_range.cpp │ ├── test_closure.cpp │ ├── test_command_queue.cpp │ ├── test_complex.cpp │ ├── test_constant_iterator.cpp │ ├── test_context.cpp │ ├── test_context_error.cpp │ ├── test_copy.cpp │ ├── test_copy_if.cpp │ ├── test_copy_type_mismatch.cpp │ ├── test_count.cpp │ ├── test_counting_iterator.cpp │ ├── test_device.cpp │ ├── test_discard_iterator.cpp │ ├── test_discrete_distribution.cpp │ ├── test_dynamic_bitset.cpp │ ├── test_equal.cpp │ ├── test_equal_range.cpp │ ├── test_event.cpp │ ├── test_extents.cpp │ ├── test_extrema.cpp │ ├── test_fill.cpp │ ├── test_find.cpp │ ├── test_find_end.cpp │ ├── test_flat_map.cpp │ ├── test_flat_set.cpp │ ├── test_for_each.cpp │ ├── test_function.cpp │ ├── test_function_input_iterator.cpp │ ├── test_functional_as.cpp │ ├── test_functional_bind.cpp │ ├── test_functional_convert.cpp │ ├── test_functional_get.cpp │ ├── test_functional_hash.cpp │ ├── test_functional_identity.cpp │ ├── test_functional_popcount.cpp │ ├── test_functional_unpack.cpp │ ├── test_gather.cpp │ ├── test_generate.cpp │ ├── test_image1d.cpp │ ├── test_image2d.cpp │ ├── test_image3d.cpp │ ├── test_image_sampler.cpp │ ├── test_includes.cpp │ ├── test_inner_product.cpp │ ├── test_inplace_merge.cpp │ ├── test_inplace_reduce.cpp │ ├── test_insertion_sort.cpp │ ├── test_invoke.cpp │ ├── test_iota.cpp │ ├── test_is_permutation.cpp │ ├── test_is_sorted.cpp │ ├── test_kernel.cpp │ ├── test_lambda.cpp │ ├── test_lexicographical_compare.cpp │ ├── test_linear_congruential_engine.cpp │ ├── test_literal_conversion.cpp │ ├── test_local_buffer.cpp │ ├── test_malloc.cpp │ ├── test_mapped_view.cpp │ ├── test_merge.cpp │ ├── test_merge_sort_gpu.cpp │ ├── test_mersenne_twister_engine.cpp │ ├── test_mismatch.cpp │ ├── test_next_permutation.cpp │ ├── test_no_device_found.cpp │ ├── test_normal_distribution.cpp │ ├── test_nth_element.cpp │ ├── test_opencl_error.cpp │ ├── test_pair.cpp │ ├── test_partial_sum.cpp │ ├── test_partition.cpp │ ├── test_partition_point.cpp │ ├── test_permutation_iterator.cpp │ ├── test_pinned_allocator.cpp │ ├── test_pipe.cpp │ ├── test_platform.cpp │ ├── test_prev_permutation.cpp │ ├── test_program.cpp │ ├── test_program_cache.cpp │ ├── test_radix_sort.cpp │ ├── test_radix_sort_by_key.cpp │ ├── test_random_fill.cpp │ ├── test_random_shuffle.cpp │ ├── test_reduce.cpp │ ├── test_reduce_by_key.cpp │ ├── test_remove.cpp │ ├── test_replace.cpp │ ├── test_result_of.cpp │ ├── test_reverse.cpp │ ├── test_rotate.cpp │ ├── test_rotate_copy.cpp │ ├── test_scan.cpp │ ├── test_scatter.cpp │ ├── test_scatter_if.cpp │ ├── test_search.cpp │ ├── test_search_n.cpp │ ├── test_set_difference.cpp │ ├── test_set_intersection.cpp │ ├── test_set_symmetric_difference.cpp │ ├── test_set_union.cpp │ ├── test_sort.cpp │ ├── test_sort_by_key.cpp │ ├── test_sort_by_transform.cpp │ ├── test_stable_partition.cpp │ ├── test_stable_sort.cpp │ ├── test_stable_sort_by_key.cpp │ ├── test_stack.cpp │ ├── test_strided_iterator.cpp │ ├── test_string.cpp │ ├── test_struct.cpp │ ├── test_svm_ptr.cpp │ ├── test_system.cpp │ ├── test_tabulate.cpp │ ├── test_threefry_engine.cpp │ ├── test_transform.cpp │ ├── test_transform_if.cpp │ ├── test_transform_iterator.cpp │ ├── test_transform_reduce.cpp │ ├── test_tuple.cpp │ ├── test_type_traits.cpp │ ├── test_types.cpp │ ├── test_uniform_int_distribution.cpp │ ├── test_uniform_real_distribution.cpp │ ├── test_unique.cpp │ ├── test_unique_copy.cpp │ ├── test_unsupported_extension.cpp │ ├── test_user_defined_types.cpp │ ├── test_user_event.cpp │ ├── test_valarray.cpp │ ├── test_vector.cpp │ ├── test_wait_list.cpp │ └── test_zip_iterator.cpp ├── docker ├── README.md ├── dockerfile-cli ├── dockerfile-python ├── dockerfile-r └── gpu │ ├── README.md │ └── dockerfile.gpu ├── docs ├── .linkcheckerrc ├── Advanced-Topics.rst ├── C-API.rst ├── Development-Guide.rst ├── Experiments.rst ├── FAQ.rst ├── Features.rst ├── GPU-Performance.rst ├── GPU-Targets.rst ├── GPU-Tutorial.rst ├── GPU-Windows.rst ├── Installation-Guide.rst ├── Key-Events.md ├── Makefile ├── Parallel-Learning-Guide.rst ├── Parameters-Tuning.rst ├── Parameters.rst ├── Python-API.rst ├── Python-Intro.rst ├── Quick-Start.rst ├── README.rst ├── _static │ ├── images │ │ ├── artifacts-download.svg │ │ ├── artifacts-fetching.svg │ │ ├── artifacts-not-available.svg │ │ ├── gcc-bars.png │ │ ├── gcc-chart.png │ │ ├── gcc-comparison-1.png │ │ ├── gcc-comparison-2.png │ │ ├── gcc-meetup-1.png │ │ ├── gcc-meetup-2.png │ │ ├── gcc-table.png │ │ ├── gpu-performance-comparison.png │ │ ├── leaf-wise.png │ │ ├── level-wise.png │ │ ├── screenshot-added-manual-entry-in-cmake.png │ │ ├── screenshot-advanced-system-settings.png │ │ ├── screenshot-boost-compiled.png │ │ ├── screenshot-configured-and-generated-cmake.png │ │ ├── screenshot-configured-lightgbm.png │ │ ├── screenshot-create-directory.png │ │ ├── screenshot-debug-run.png │ │ ├── screenshot-downloading-cmake.png │ │ ├── screenshot-environment-variables.png │ │ ├── screenshot-files-to-remove.png │ │ ├── screenshot-git-for-windows.png │ │ ├── screenshot-lightgbm-in-cli-with-gpu.png │ │ ├── screenshot-lightgbm-with-gpu-support-compiled.png │ │ ├── screenshot-mingw-installation.png │ │ ├── screenshot-mingw-makefiles-to-use.png │ │ ├── screenshot-r-mingw-used.png │ │ ├── screenshot-segmentation-fault.png │ │ ├── screenshot-system.png │ │ └── screenshot-use-gpu.png │ └── js │ │ └── script.js ├── conf.py ├── gcc-Tips.rst ├── index.rst ├── make.bat ├── requirements.txt └── requirements_base.txt ├── examples ├── .gitignore ├── example1 │ ├── .ipynb_checkpoints │ │ └── 0_run-checkpoint.ipynb │ ├── 0_run.ipynb │ └── raw_data.csv └── example2 │ ├── .ipynb_checkpoints │ └── 0_run-checkpoint.ipynb │ ├── 0_run.ipynb │ ├── README.md │ └── kaggle-ieee │ └── model │ ├── f3_deepwalk.py │ ├── fd_key.py │ ├── fe_V307.py │ └── fi_yu.py ├── helpers ├── check_dynamic_dependencies.py └── parameter_generator.py ├── include └── LightGBM │ ├── R_object_helper.h │ ├── application.h │ ├── bin.h │ ├── boosting.h │ ├── c_api.h │ ├── config.h │ ├── dataset.h │ ├── dataset_loader.h │ ├── export.h │ ├── feature_group.h │ ├── json11.hpp │ ├── lightgbm_R.h │ ├── meta.h │ ├── metric.h │ ├── network.h │ ├── objective_function.h │ ├── prediction_early_stop.h │ ├── tree.h │ ├── tree_learner.h │ └── utils │ ├── array_args.h │ ├── common.h │ ├── file_io.h │ ├── log.h │ ├── openmp_wrapper.h │ ├── pipeline_reader.h │ ├── random.h │ ├── text_reader.h │ └── threading.h ├── pmml └── README.md ├── python-package ├── .ipynb_checkpoints │ └── cccccc-checkpoint.ipynb ├── LICENSE ├── MANIFEST.in ├── README.rst ├── build │ └── lib │ │ └── lightgbmmt │ │ ├── __init__.py │ │ ├── basic.py │ │ ├── callback.py │ │ ├── compat.py │ │ ├── engine.py │ │ ├── libpath.py │ │ ├── plotting.py │ │ └── sklearn.py ├── build_cpp │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.10.2 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── FindOpenMP │ │ │ ├── OpenMPCheckVersion.c │ │ │ ├── OpenMPCheckVersion.cpp │ │ │ ├── OpenMPTryFlag.c │ │ │ ├── OpenMPTryFlag.cpp │ │ │ ├── ompver_C.bin │ │ │ └── ompver_CXX.bin │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── _lightgbm.dir │ │ │ ├── CXX.includecache │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.internal │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── progress.make │ │ │ └── src │ │ │ │ ├── application │ │ │ │ └── application.cpp.o │ │ │ │ ├── boosting │ │ │ │ ├── boosting.cpp.o │ │ │ │ ├── gbdt.cpp.o │ │ │ │ ├── gbdt_model_text.cpp.o │ │ │ │ ├── gbdt_prediction.cpp.o │ │ │ │ └── prediction_early_stop.cpp.o │ │ │ │ ├── c_api.cpp.o │ │ │ │ ├── io │ │ │ │ ├── bin.cpp.o │ │ │ │ ├── config.cpp.o │ │ │ │ ├── config_auto.cpp.o │ │ │ │ ├── dataset.cpp.o │ │ │ │ ├── dataset_loader.cpp.o │ │ │ │ ├── file_io.cpp.o │ │ │ │ ├── json11.cpp.o │ │ │ │ ├── metadata.cpp.o │ │ │ │ ├── parser.cpp.o │ │ │ │ └── tree.cpp.o │ │ │ │ ├── lightgbm_R.cpp.o │ │ │ │ ├── metric │ │ │ │ ├── dcg_calculator.cpp.o │ │ │ │ └── metric.cpp.o │ │ │ │ ├── network │ │ │ │ ├── linker_topo.cpp.o │ │ │ │ ├── linkers_mpi.cpp.o │ │ │ │ ├── linkers_socket.cpp.o │ │ │ │ └── network.cpp.o │ │ │ │ ├── objective │ │ │ │ └── objective_function.cpp.o │ │ │ │ └── treelearner │ │ │ │ ├── data_parallel_tree_learner.cpp.o │ │ │ │ ├── feature_parallel_tree_learner.cpp.o │ │ │ │ ├── gpu_tree_learner.cpp.o │ │ │ │ ├── serial_tree_learner.cpp.o │ │ │ │ ├── serial_tree_learner2.cpp.o │ │ │ │ ├── tree_learner.cpp.o │ │ │ │ └── voting_parallel_tree_learner.cpp.o │ │ ├── cmake.check_cache │ │ ├── feature_tests.bin │ │ ├── feature_tests.c │ │ ├── feature_tests.cxx │ │ ├── lightgbm.dir │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ └── progress.make │ │ └── progress.marks │ ├── Makefile │ └── cmake_install.cmake ├── compile │ ├── CMakeLists.txt │ ├── include │ │ └── LightGBM │ │ │ ├── R_object_helper.h │ │ │ ├── application.h │ │ │ ├── bin.h │ │ │ ├── boosting.h │ │ │ ├── c_api.h │ │ │ ├── config.h │ │ │ ├── dataset.h │ │ │ ├── dataset_loader.h │ │ │ ├── export.h │ │ │ ├── feature_group.h │ │ │ ├── json11.hpp │ │ │ ├── lightgbm_R.h │ │ │ ├── meta.h │ │ │ ├── metric.h │ │ │ ├── network.h │ │ │ ├── objective_function.h │ │ │ ├── prediction_early_stop.h │ │ │ ├── tree.h │ │ │ ├── tree_learner.h │ │ │ └── utils │ │ │ ├── array_args.h │ │ │ ├── common.h │ │ │ ├── file_io.h │ │ │ ├── log.h │ │ │ ├── openmp_wrapper.h │ │ │ ├── pipeline_reader.h │ │ │ ├── random.h │ │ │ ├── text_reader.h │ │ │ └── threading.h │ ├── lib_lightgbm.so │ ├── src │ │ ├── application │ │ │ ├── application.cpp │ │ │ └── predictor.hpp │ │ ├── boosting │ │ │ ├── boosting.cpp │ │ │ ├── dart.hpp │ │ │ ├── gbdt.cpp │ │ │ ├── gbdt.h │ │ │ ├── gbdt_model_text.cpp │ │ │ ├── gbdt_prediction.cpp │ │ │ ├── goss.hpp │ │ │ ├── prediction_early_stop.cpp │ │ │ ├── rf.hpp │ │ │ └── score_updater.hpp │ │ ├── c_api.cpp │ │ ├── io │ │ │ ├── bin.cpp │ │ │ ├── config.cpp │ │ │ ├── config_auto.cpp │ │ │ ├── dataset.cpp │ │ │ ├── dataset_loader.cpp │ │ │ ├── dense_bin.hpp │ │ │ ├── dense_nbits_bin.hpp │ │ │ ├── file_io.cpp │ │ │ ├── json11.cpp │ │ │ ├── metadata.cpp │ │ │ ├── ordered_sparse_bin.hpp │ │ │ ├── parser.cpp │ │ │ ├── parser.hpp │ │ │ ├── sparse_bin.hpp │ │ │ └── tree.cpp │ │ ├── lightgbm_R.cpp │ │ ├── main.cpp │ │ ├── metric │ │ │ ├── binary_metric.hpp │ │ │ ├── dcg_calculator.cpp │ │ │ ├── map_metric.hpp │ │ │ ├── metric.cpp │ │ │ ├── multiclass_metric.hpp │ │ │ ├── rank_metric.hpp │ │ │ ├── regression_metric.hpp │ │ │ └── xentropy_metric.hpp │ │ ├── network │ │ │ ├── linker_topo.cpp │ │ │ ├── linkers.h │ │ │ ├── linkers_mpi.cpp │ │ │ ├── linkers_socket.cpp │ │ │ ├── network.cpp │ │ │ └── socket_wrapper.hpp │ │ ├── objective │ │ │ ├── binary_objective.hpp │ │ │ ├── multiclass_objective.hpp │ │ │ ├── objective_function.cpp │ │ │ ├── rank_objective.hpp │ │ │ ├── regression_objective.hpp │ │ │ └── xentropy_objective.hpp │ │ └── treelearner │ │ │ ├── cost_effective_gradient_boosting.hpp │ │ │ ├── cost_effective_gradient_boosting2.hpp │ │ │ ├── data_parallel_tree_learner.cpp │ │ │ ├── data_partition.hpp │ │ │ ├── feature_histogram.hpp │ │ │ ├── feature_parallel_tree_learner.cpp │ │ │ ├── gpu_tree_learner.cpp │ │ │ ├── gpu_tree_learner.h │ │ │ ├── leaf_splits.hpp │ │ │ ├── ocl │ │ │ ├── histogram16.cl │ │ │ ├── histogram256.cl │ │ │ └── histogram64.cl │ │ │ ├── parallel_tree_learner.h │ │ │ ├── serial_tree_learner.cpp │ │ │ ├── serial_tree_learner.h │ │ │ ├── serial_tree_learner2.cpp │ │ │ ├── serial_tree_learner2.h │ │ │ ├── split_info.hpp │ │ │ ├── tree_learner.cpp │ │ │ └── voting_parallel_tree_learner.cpp │ └── windows │ │ ├── LightGBM.sln │ │ └── LightGBM.vcxproj ├── lightgbmmt.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── not-zip-safe │ ├── requires.txt │ └── top_level.txt ├── lightgbmmt │ ├── VERSION.txt │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ ├── __init__.cpython-38.pyc │ │ ├── basic.cpython-36.pyc │ │ ├── basic.cpython-38.pyc │ │ ├── callback.cpython-36.pyc │ │ ├── callback.cpython-38.pyc │ │ ├── compat.cpython-36.pyc │ │ ├── compat.cpython-38.pyc │ │ ├── engine.cpython-36.pyc │ │ ├── engine.cpython-38.pyc │ │ ├── libpath.cpython-36.pyc │ │ ├── libpath.cpython-38.pyc │ │ ├── plotting.cpython-36.pyc │ │ ├── plotting.cpython-38.pyc │ │ ├── sklearn.cpython-36.pyc │ │ └── sklearn.cpython-38.pyc │ ├── basic.py │ ├── callback.py │ ├── compat.py │ ├── engine.py │ ├── libpath.py │ ├── plotting.py │ └── sklearn.py └── setup.py ├── src ├── application │ ├── application.cpp │ └── predictor.hpp ├── boosting │ ├── boosting.cpp │ ├── dart.hpp │ ├── gbdt.cpp │ ├── gbdt.h │ ├── gbdt_model_text.cpp │ ├── gbdt_prediction.cpp │ ├── goss.hpp │ ├── prediction_early_stop.cpp │ ├── rf.hpp │ └── score_updater.hpp ├── c_api.cpp ├── io │ ├── bin.cpp │ ├── config.cpp │ ├── config_auto.cpp │ ├── dataset.cpp │ ├── dataset_loader.cpp │ ├── dense_bin.hpp │ ├── dense_nbits_bin.hpp │ ├── file_io.cpp │ ├── json11.cpp │ ├── metadata.cpp │ ├── ordered_sparse_bin.hpp │ ├── parser.cpp │ ├── parser.hpp │ ├── sparse_bin.hpp │ └── tree.cpp ├── lightgbm_R.cpp ├── main.cpp ├── metric │ ├── binary_metric.hpp │ ├── dcg_calculator.cpp │ ├── map_metric.hpp │ ├── metric.cpp │ ├── multiclass_metric.hpp │ ├── rank_metric.hpp │ ├── regression_metric.hpp │ └── xentropy_metric.hpp ├── network │ ├── linker_topo.cpp │ ├── linkers.h │ ├── linkers_mpi.cpp │ ├── linkers_socket.cpp │ ├── network.cpp │ └── socket_wrapper.hpp ├── objective │ ├── binary_objective.hpp │ ├── multiclass_objective.hpp │ ├── objective_function.cpp │ ├── rank_objective.hpp │ ├── regression_objective.hpp │ └── xentropy_objective.hpp └── treelearner │ ├── cost_effective_gradient_boosting.hpp │ ├── cost_effective_gradient_boosting2.hpp │ ├── data_parallel_tree_learner.cpp │ ├── data_partition.hpp │ ├── feature_histogram.hpp │ ├── feature_parallel_tree_learner.cpp │ ├── gpu_tree_learner.cpp │ ├── gpu_tree_learner.h │ ├── leaf_splits.hpp │ ├── ocl │ ├── histogram16.cl │ ├── histogram256.cl │ └── histogram64.cl │ ├── parallel_tree_learner.h │ ├── serial_tree_learner.cpp │ ├── serial_tree_learner.h │ ├── serial_tree_learner2.cpp │ ├── serial_tree_learner2.h │ ├── split_info.hpp │ ├── tree_learner.cpp │ └── voting_parallel_tree_learner.cpp ├── swig └── lightgbmlib.i ├── tests ├── c_api_test │ └── test_.py ├── cpp_test │ ├── predict.conf │ ├── test.py │ └── train.conf ├── data │ └── categorical.data └── python_package_test │ ├── test_basic.py │ ├── test_consistency.py │ ├── test_engine.py │ ├── test_plotting.py │ └── test_sklearn.py └── windows ├── LightGBM.sln ├── LightGBM.vcxproj └── LightGBM.vcxproj.filters /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /R-package/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^build_package.R$ 2 | \.gitkeep$ 3 | ^docs$ 4 | ^pkgdown$ 5 | 6 | # Objects created by compilation 7 | \.o$ 8 | \.so$ 9 | \.dll$ 10 | \.out$ 11 | \.bin$ 12 | 13 | # Code copied in at build time 14 | ^src/CMakeLists.txt$ 15 | -------------------------------------------------------------------------------- /R-package/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /R-package/data/agaricus.test.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/R-package/data/agaricus.test.rda -------------------------------------------------------------------------------- /R-package/data/agaricus.train.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/R-package/data/agaricus.train.rda -------------------------------------------------------------------------------- /R-package/data/bank.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/R-package/data/bank.rda -------------------------------------------------------------------------------- /R-package/demo/00Index: -------------------------------------------------------------------------------- 1 | basic_walkthrough Basic feature walkthrough 2 | boost_from_prediction Boosting from existing prediction 3 | categorical_features_prepare Categorical Feature Preparation 4 | categorical_features_rules Categorical Feature Preparation with Rules 5 | cross_validation Cross Validation 6 | early_stopping Early Stop in training 7 | efficient_many_training Efficiency for Many Model Trainings 8 | multiclass Multiclass training/prediction 9 | multiclass_custom_objective Multiclass with Custom Objective Function 10 | leaf_stability Leaf (in)Stability example 11 | weight_param Weight-Parameter adjustment relationship 12 | -------------------------------------------------------------------------------- /R-package/demo/boost_from_prediction.R: -------------------------------------------------------------------------------- 1 | require(lightgbm) 2 | require(methods) 3 | 4 | # Load in the agaricus dataset 5 | data(agaricus.train, package = "lightgbm") 6 | data(agaricus.test, package = "lightgbm") 7 | dtrain <- lgb.Dataset(agaricus.train$data, label = agaricus.train$label) 8 | dtest <- lgb.Dataset.create.valid(dtrain, data = agaricus.test$data, label = agaricus.test$label) 9 | 10 | valids <- list(eval = dtest, train = dtrain) 11 | #--------------------Advanced features --------------------------- 12 | # advanced: start from an initial base prediction 13 | print("Start running example to start from an initial prediction") 14 | 15 | # Train lightgbm for 1 round 16 | param <- list( 17 | num_leaves = 4L 18 | , learning_rate = 1.0 19 | , nthread = 2L 20 | , objective = "binary" 21 | ) 22 | bst <- lgb.train(param, dtrain, 1L, valids = valids) 23 | 24 | # Note: we need the margin value instead of transformed prediction in set_init_score 25 | ptrain <- predict(bst, agaricus.train$data, rawscore = TRUE) 26 | ptest <- predict(bst, agaricus.test$data, rawscore = TRUE) 27 | 28 | # set the init_score property of dtrain and dtest 29 | # base margin is the base prediction we will boost from 30 | setinfo(dtrain, "init_score", ptrain) 31 | setinfo(dtest, "init_score", ptest) 32 | 33 | print("This is result of boost from initial prediction") 34 | bst <- lgb.train( 35 | params = param 36 | , data = dtrain 37 | , nrounds = 5L 38 | , valids = valids 39 | ) 40 | -------------------------------------------------------------------------------- /R-package/inst/bin/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/R-package/inst/bin/.gitkeep -------------------------------------------------------------------------------- /R-package/man/agaricus.test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lightgbm.R 3 | \docType{data} 4 | \name{agaricus.test} 5 | \alias{agaricus.test} 6 | \title{Test part from Mushroom Data Set} 7 | \format{A list containing a label vector, and a dgCMatrix object with 1611 8 | rows and 126 variables} 9 | \usage{ 10 | data(agaricus.test) 11 | } 12 | \description{ 13 | This data set is originally from the Mushroom data set, 14 | UCI Machine Learning Repository. 15 | } 16 | \details{ 17 | This data set includes the following fields: 18 | 19 | \itemize{ 20 | \item \code{label} the label for each record 21 | \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 126 columns. 22 | } 23 | } 24 | \references{ 25 | https://archive.ics.uci.edu/ml/datasets/Mushroom 26 | 27 | Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository 28 | [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, 29 | School of Information and Computer Science. 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /R-package/man/agaricus.train.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lightgbm.R 3 | \docType{data} 4 | \name{agaricus.train} 5 | \alias{agaricus.train} 6 | \title{Training part from Mushroom Data Set} 7 | \format{A list containing a label vector, and a dgCMatrix object with 6513 8 | rows and 127 variables} 9 | \usage{ 10 | data(agaricus.train) 11 | } 12 | \description{ 13 | This data set is originally from the Mushroom data set, 14 | UCI Machine Learning Repository. 15 | } 16 | \details{ 17 | This data set includes the following fields: 18 | 19 | \itemize{ 20 | \item \code{label} the label for each record 21 | \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 126 columns. 22 | } 23 | } 24 | \references{ 25 | https://archive.ics.uci.edu/ml/datasets/Mushroom 26 | 27 | Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository 28 | [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, 29 | School of Information and Computer Science. 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /R-package/man/bank.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lightgbm.R 3 | \docType{data} 4 | \name{bank} 5 | \alias{bank} 6 | \title{Bank Marketing Data Set} 7 | \format{A data.table with 4521 rows and 17 variables} 8 | \usage{ 9 | data(bank) 10 | } 11 | \description{ 12 | This data set is originally from the Bank Marketing data set, 13 | UCI Machine Learning Repository. 14 | } 15 | \details{ 16 | It contains only the following: bank.csv with 10% of the examples and 17 inputs, 17 | randomly selected from 3 (older version of this dataset with less inputs). 18 | } 19 | \references{ 20 | http://archive.ics.uci.edu/ml/datasets/Bank+Marketing 21 | 22 | S. Moro, P. Cortez and P. Rita. (2014) 23 | A Data-Driven Approach to Predict the Success of Bank Telemarketing. Decision Support Systems 24 | } 25 | \keyword{datasets} 26 | -------------------------------------------------------------------------------- /R-package/man/dim.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{dim.lgb.Dataset} 4 | \alias{dim.lgb.Dataset} 5 | \title{Dimensions of an \code{lgb.Dataset}} 6 | \usage{ 7 | \method{dim}{lgb.Dataset}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Object of class \code{lgb.Dataset}} 11 | 12 | \item{...}{other parameters} 13 | } 14 | \value{ 15 | a vector of numbers of rows and of columns 16 | } 17 | \description{ 18 | Returns a vector of numbers of rows and of columns in an \code{lgb.Dataset}. 19 | } 20 | \details{ 21 | Note: since \code{nrow} and \code{ncol} internally use \code{dim}, they can also 22 | be directly used with an \code{lgb.Dataset} object. 23 | } 24 | \examples{ 25 | library(lightgbm) 26 | data(agaricus.train, package = "lightgbm") 27 | train <- agaricus.train 28 | dtrain <- lgb.Dataset(train$data, label = train$label) 29 | 30 | stopifnot(nrow(dtrain) == nrow(train$data)) 31 | stopifnot(ncol(dtrain) == ncol(train$data)) 32 | stopifnot(all(dim(dtrain) == dim(train$data))) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /R-package/man/dimnames.lgb.Dataset.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{dimnames.lgb.Dataset} 4 | \alias{dimnames.lgb.Dataset} 5 | \alias{dimnames<-.lgb.Dataset} 6 | \title{Handling of column names of \code{lgb.Dataset}} 7 | \usage{ 8 | \method{dimnames}{lgb.Dataset}(x) 9 | 10 | \method{dimnames}{lgb.Dataset}(x) <- value 11 | } 12 | \arguments{ 13 | \item{x}{object of class \code{lgb.Dataset}} 14 | 15 | \item{value}{a list of two elements: the first one is ignored 16 | and the second one is column names} 17 | } 18 | \description{ 19 | Only column names are supported for \code{lgb.Dataset}, thus setting of 20 | row names would have no effect and returned row names would be NULL. 21 | } 22 | \details{ 23 | Generic \code{dimnames} methods are used by \code{colnames}. 24 | Since row names are irrelevant, it is recommended to use \code{colnames} directly. 25 | } 26 | \examples{ 27 | library(lightgbm) 28 | data(agaricus.train, package = "lightgbm") 29 | train <- agaricus.train 30 | dtrain <- lgb.Dataset(train$data, label = train$label) 31 | lgb.Dataset.construct(dtrain) 32 | dimnames(dtrain) 33 | colnames(dtrain) 34 | colnames(dtrain) <- make.names(seq_len(ncol(train$data))) 35 | print(dtrain, verbose = TRUE) 36 | 37 | } 38 | -------------------------------------------------------------------------------- /R-package/man/getinfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{getinfo} 4 | \alias{getinfo} 5 | \alias{getinfo.lgb.Dataset} 6 | \title{Get information of an \code{lgb.Dataset} object} 7 | \usage{ 8 | getinfo(dataset, ...) 9 | 10 | \method{getinfo}{lgb.Dataset}(dataset, name, ...) 11 | } 12 | \arguments{ 13 | \item{dataset}{Object of class \code{lgb.Dataset}} 14 | 15 | \item{...}{other parameters} 16 | 17 | \item{name}{the name of the information field to get (see details)} 18 | } 19 | \value{ 20 | info data 21 | } 22 | \description{ 23 | Get information of an \code{lgb.Dataset} object 24 | } 25 | \details{ 26 | The \code{name} field can be one of the following: 27 | 28 | \itemize{ 29 | \item \code{label}: label lightgbm learn from ; 30 | \item \code{weight}: to do a weight rescale ; 31 | \item \code{group}: group size ; 32 | \item \code{init_score}: initial score is the base prediction lightgbm will boost from. 33 | } 34 | } 35 | \examples{ 36 | library(lightgbm) 37 | data(agaricus.train, package = "lightgbm") 38 | train <- agaricus.train 39 | dtrain <- lgb.Dataset(train$data, label = train$label) 40 | lgb.Dataset.construct(dtrain) 41 | 42 | labels <- lightgbm::getinfo(dtrain, "label") 43 | lightgbm::setinfo(dtrain, "label", 1 - labels) 44 | 45 | labels2 <- lightgbm::getinfo(dtrain, "label") 46 | stopifnot(all(labels2 == 1 - labels)) 47 | 48 | } 49 | -------------------------------------------------------------------------------- /R-package/man/lgb.Dataset.construct.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{lgb.Dataset.construct} 4 | \alias{lgb.Dataset.construct} 5 | \title{Construct Dataset explicitly} 6 | \usage{ 7 | lgb.Dataset.construct(dataset) 8 | } 9 | \arguments{ 10 | \item{dataset}{Object of class \code{lgb.Dataset}} 11 | } 12 | \description{ 13 | Construct Dataset explicitly 14 | } 15 | \examples{ 16 | library(lightgbm) 17 | data(agaricus.train, package = "lightgbm") 18 | train <- agaricus.train 19 | dtrain <- lgb.Dataset(train$data, label = train$label) 20 | lgb.Dataset.construct(dtrain) 21 | 22 | } 23 | -------------------------------------------------------------------------------- /R-package/man/lgb.Dataset.create.valid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{lgb.Dataset.create.valid} 4 | \alias{lgb.Dataset.create.valid} 5 | \title{Construct validation data} 6 | \usage{ 7 | lgb.Dataset.create.valid(dataset, data, info = list(), ...) 8 | } 9 | \arguments{ 10 | \item{dataset}{\code{lgb.Dataset} object, training data} 11 | 12 | \item{data}{a \code{matrix} object, a \code{dgCMatrix} object or a character representing a filename} 13 | 14 | \item{info}{a list of information of the \code{lgb.Dataset} object} 15 | 16 | \item{...}{other information to pass to \code{info}.} 17 | } 18 | \value{ 19 | constructed dataset 20 | } 21 | \description{ 22 | Construct validation data according to training data 23 | } 24 | \examples{ 25 | library(lightgbm) 26 | data(agaricus.train, package = "lightgbm") 27 | train <- agaricus.train 28 | dtrain <- lgb.Dataset(train$data, label = train$label) 29 | data(agaricus.test, package = "lightgbm") 30 | test <- agaricus.test 31 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 32 | 33 | } 34 | -------------------------------------------------------------------------------- /R-package/man/lgb.Dataset.save.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{lgb.Dataset.save} 4 | \alias{lgb.Dataset.save} 5 | \title{Save \code{lgb.Dataset} to a binary file} 6 | \usage{ 7 | lgb.Dataset.save(dataset, fname) 8 | } 9 | \arguments{ 10 | \item{dataset}{object of class \code{lgb.Dataset}} 11 | 12 | \item{fname}{object filename of output file} 13 | } 14 | \value{ 15 | passed dataset 16 | } 17 | \description{ 18 | Save \code{lgb.Dataset} to a binary file 19 | } 20 | \examples{ 21 | library(lightgbm) 22 | data(agaricus.train, package = "lightgbm") 23 | train <- agaricus.train 24 | dtrain <- lgb.Dataset(train$data, label = train$label) 25 | lgb.Dataset.save(dtrain, "data.bin") 26 | 27 | } 28 | -------------------------------------------------------------------------------- /R-package/man/lgb.Dataset.set.categorical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{lgb.Dataset.set.categorical} 4 | \alias{lgb.Dataset.set.categorical} 5 | \title{Set categorical feature of \code{lgb.Dataset}} 6 | \usage{ 7 | lgb.Dataset.set.categorical(dataset, categorical_feature) 8 | } 9 | \arguments{ 10 | \item{dataset}{object of class \code{lgb.Dataset}} 11 | 12 | \item{categorical_feature}{categorical features} 13 | } 14 | \value{ 15 | passed dataset 16 | } 17 | \description{ 18 | Set categorical feature of \code{lgb.Dataset} 19 | } 20 | \examples{ 21 | library(lightgbm) 22 | data(agaricus.train, package = "lightgbm") 23 | train <- agaricus.train 24 | dtrain <- lgb.Dataset(train$data, label = train$label) 25 | lgb.Dataset.save(dtrain, "lgb.Dataset.data") 26 | dtrain <- lgb.Dataset("lgb.Dataset.data") 27 | lgb.Dataset.set.categorical(dtrain, 1L:2L) 28 | 29 | } 30 | -------------------------------------------------------------------------------- /R-package/man/lgb.Dataset.set.reference.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{lgb.Dataset.set.reference} 4 | \alias{lgb.Dataset.set.reference} 5 | \title{Set reference of \code{lgb.Dataset}} 6 | \usage{ 7 | lgb.Dataset.set.reference(dataset, reference) 8 | } 9 | \arguments{ 10 | \item{dataset}{object of class \code{lgb.Dataset}} 11 | 12 | \item{reference}{object of class \code{lgb.Dataset}} 13 | } 14 | \value{ 15 | passed dataset 16 | } 17 | \description{ 18 | If you want to use validation data, you should set reference to training data 19 | } 20 | \examples{ 21 | library(lightgbm) 22 | data(agaricus.train, package ="lightgbm") 23 | train <- agaricus.train 24 | dtrain <- lgb.Dataset(train$data, label = train$label) 25 | data(agaricus.test, package = "lightgbm") 26 | test <- agaricus.test 27 | dtest <- lgb.Dataset(test$data, test = train$label) 28 | lgb.Dataset.set.reference(dtest, dtrain) 29 | 30 | } 31 | -------------------------------------------------------------------------------- /R-package/man/lgb.dump.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Booster.R 3 | \name{lgb.dump} 4 | \alias{lgb.dump} 5 | \title{Dump LightGBM model to json} 6 | \usage{ 7 | lgb.dump(booster, num_iteration = NULL) 8 | } 9 | \arguments{ 10 | \item{booster}{Object of class \code{lgb.Booster}} 11 | 12 | \item{num_iteration}{number of iteration want to predict with, NULL or <= 0 means use best iteration} 13 | } 14 | \value{ 15 | json format of model 16 | } 17 | \description{ 18 | Dump LightGBM model to json 19 | } 20 | \examples{ 21 | library(lightgbm) 22 | data(agaricus.train, package = "lightgbm") 23 | train <- agaricus.train 24 | dtrain <- lgb.Dataset(train$data, label = train$label) 25 | data(agaricus.test, package = "lightgbm") 26 | test <- agaricus.test 27 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 28 | params <- list(objective = "regression", metric = "l2") 29 | valids <- list(test = dtest) 30 | model <- lgb.train( 31 | params = params 32 | , data = dtrain 33 | , nrounds = 10L 34 | , valids = valids 35 | , min_data = 1L 36 | , learning_rate = 1.0 37 | , early_stopping_rounds = 5L 38 | ) 39 | json_model <- lgb.dump(model) 40 | 41 | } 42 | -------------------------------------------------------------------------------- /R-package/man/lgb.get.eval.result.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Booster.R 3 | \name{lgb.get.eval.result} 4 | \alias{lgb.get.eval.result} 5 | \title{Get record evaluation result from booster} 6 | \usage{ 7 | lgb.get.eval.result( 8 | booster, 9 | data_name, 10 | eval_name, 11 | iters = NULL, 12 | is_err = FALSE 13 | ) 14 | } 15 | \arguments{ 16 | \item{booster}{Object of class \code{lgb.Booster}} 17 | 18 | \item{data_name}{name of dataset} 19 | 20 | \item{eval_name}{name of evaluation} 21 | 22 | \item{iters}{iterations, NULL will return all} 23 | 24 | \item{is_err}{TRUE will return evaluation error instead} 25 | } 26 | \value{ 27 | vector of evaluation result 28 | } 29 | \description{ 30 | Get record evaluation result from booster 31 | } 32 | \examples{ 33 | library(lightgbm) 34 | data(agaricus.train, package = "lightgbm") 35 | train <- agaricus.train 36 | dtrain <- lgb.Dataset(train$data, label = train$label) 37 | data(agaricus.test, package = "lightgbm") 38 | test <- agaricus.test 39 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 40 | params <- list(objective = "regression", metric = "l2") 41 | valids <- list(test = dtest) 42 | model <- lgb.train( 43 | params = params 44 | , data = dtrain 45 | , nrounds = 10L 46 | , valids = valids 47 | , min_data = 1L 48 | , learning_rate = 1.0 49 | , early_stopping_rounds = 5L 50 | ) 51 | lgb.get.eval.result(model, "test", "l2") 52 | } 53 | -------------------------------------------------------------------------------- /R-package/man/lgb.importance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.importance.R 3 | \name{lgb.importance} 4 | \alias{lgb.importance} 5 | \title{Compute feature importance in a model} 6 | \usage{ 7 | lgb.importance(model, percentage = TRUE) 8 | } 9 | \arguments{ 10 | \item{model}{object of class \code{lgb.Booster}.} 11 | 12 | \item{percentage}{whether to show importance in relative percentage.} 13 | } 14 | \value{ 15 | For a tree model, a \code{data.table} with the following columns: 16 | \itemize{ 17 | \item \code{Feature} Feature names in the model. 18 | \item \code{Gain} The total gain of this feature's splits. 19 | \item \code{Cover} The number of observation related to this feature. 20 | \item \code{Frequency} The number of times a feature splited in trees. 21 | } 22 | } 23 | \description{ 24 | Creates a \code{data.table} of feature importances in a model. 25 | } 26 | \examples{ 27 | library(lightgbm) 28 | data(agaricus.train, package = "lightgbm") 29 | train <- agaricus.train 30 | dtrain <- lgb.Dataset(train$data, label = train$label) 31 | 32 | params <- list( 33 | objective = "binary" 34 | , learning_rate = 0.01 35 | , num_leaves = 63L 36 | , max_depth = -1L 37 | , min_data_in_leaf = 1L 38 | , min_sum_hessian_in_leaf = 1.0 39 | ) 40 | model <- lgb.train(params, dtrain, 10L) 41 | 42 | tree_imp1 <- lgb.importance(model, percentage = TRUE) 43 | tree_imp2 <- lgb.importance(model, percentage = FALSE) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /R-package/man/lgb.load.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Booster.R 3 | \name{lgb.load} 4 | \alias{lgb.load} 5 | \title{Load LightGBM model} 6 | \usage{ 7 | lgb.load(filename = NULL, model_str = NULL) 8 | } 9 | \arguments{ 10 | \item{filename}{path of model file} 11 | 12 | \item{model_str}{a str containing the model} 13 | } 14 | \value{ 15 | lgb.Booster 16 | } 17 | \description{ 18 | Load LightGBM model from saved model file or string 19 | Load LightGBM takes in either a file path or model string 20 | If both are provided, Load will default to loading from file 21 | } 22 | \examples{ 23 | library(lightgbm) 24 | data(agaricus.train, package = "lightgbm") 25 | train <- agaricus.train 26 | dtrain <- lgb.Dataset(train$data, label = train$label) 27 | data(agaricus.test, package = "lightgbm") 28 | test <- agaricus.test 29 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 30 | params <- list(objective = "regression", metric = "l2") 31 | valids <- list(test = dtest) 32 | model <- lgb.train( 33 | params = params 34 | , data = dtrain 35 | , nrounds = 10L 36 | , valids = valids 37 | , min_data = 1L 38 | , learning_rate = 1.0 39 | , early_stopping_rounds = 5L 40 | ) 41 | lgb.save(model, "model.txt") 42 | load_booster <- lgb.load(filename = "model.txt") 43 | model_string <- model$save_model_to_string(NULL) # saves best iteration 44 | load_booster_from_str <- lgb.load(model_str = model_string) 45 | 46 | } 47 | -------------------------------------------------------------------------------- /R-package/man/lgb.prepare_rules2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.prepare_rules2.R 3 | \name{lgb.prepare_rules2} 4 | \alias{lgb.prepare_rules2} 5 | \title{Data preparator for LightGBM datasets with rules (integer)} 6 | \usage{ 7 | lgb.prepare_rules2(data, rules = NULL) 8 | } 9 | \arguments{ 10 | \item{data}{A data.frame or data.table to prepare.} 11 | 12 | \item{rules}{A set of rules from the data preparator, if already used.} 13 | } 14 | \value{ 15 | A list with the cleaned dataset (\code{data}) and the rules (\code{rules}). 16 | The data must be converted to a matrix format (\code{as.matrix}) for input in 17 | \code{lgb.Dataset}. 18 | } 19 | \description{ 20 | Attempts to prepare a clean dataset to prepare to put in a \code{lgb.Dataset}. 21 | Factors and characters are converted to numeric (specifically: integer). 22 | In addition, keeps rules created so you can convert other datasets using this converter. 23 | This is useful if you have a specific need for integer dataset instead of numeric dataset. 24 | Note that there are programs which do not support integer-only input. 25 | Consider this as a half memory technique which is dangerous, especially for LightGBM. 26 | } 27 | -------------------------------------------------------------------------------- /R-package/man/lgb.save.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Booster.R 3 | \name{lgb.save} 4 | \alias{lgb.save} 5 | \title{Save LightGBM model} 6 | \usage{ 7 | lgb.save(booster, filename, num_iteration = NULL) 8 | } 9 | \arguments{ 10 | \item{booster}{Object of class \code{lgb.Booster}} 11 | 12 | \item{filename}{saved filename} 13 | 14 | \item{num_iteration}{number of iteration want to predict with, NULL or <= 0 means use best iteration} 15 | } 16 | \value{ 17 | lgb.Booster 18 | } 19 | \description{ 20 | Save LightGBM model 21 | } 22 | \examples{ 23 | library(lightgbm) 24 | data(agaricus.train, package = "lightgbm") 25 | train <- agaricus.train 26 | dtrain <- lgb.Dataset(train$data, label = train$label) 27 | data(agaricus.test, package = "lightgbm") 28 | test <- agaricus.test 29 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 30 | params <- list(objective = "regression", metric = "l2") 31 | valids <- list(test = dtest) 32 | model <- lgb.train( 33 | params = params 34 | , data = dtrain 35 | , nrounds = 10L 36 | , valids = valids 37 | , min_data = 1L 38 | , learning_rate = 1.0 39 | , early_stopping_rounds = 5L 40 | ) 41 | lgb.save(model, "model.txt") 42 | 43 | } 44 | -------------------------------------------------------------------------------- /R-package/man/lgb_shared_params.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lightgbm.R 3 | \name{lgb_shared_params} 4 | \alias{lgb_shared_params} 5 | \title{Shared parameter docs} 6 | \arguments{ 7 | \item{callbacks}{list of callback functions 8 | List of callback functions that are applied at each iteration.} 9 | 10 | \item{data}{a \code{lgb.Dataset} object, used for training} 11 | 12 | \item{early_stopping_rounds}{int. Activates early stopping. Requires at least one validation data 13 | and one metric. If there's more than one, will check all of them 14 | except the training data. Returns the model with (best_iter + early_stopping_rounds). 15 | If early stopping occurs, the model will have 'best_iter' field.} 16 | 17 | \item{eval_freq}{evaluation output frequency, only effect when verbose > 0} 18 | 19 | \item{init_model}{path of model file of \code{lgb.Booster} object, will continue training from this model} 20 | 21 | \item{nrounds}{number of training rounds} 22 | 23 | \item{params}{List of parameters} 24 | 25 | \item{verbose}{verbosity for output, if <= 0, also will disable the print of evaluation during training} 26 | } 27 | \description{ 28 | Parameter docs shared by \code{lgb.train}, \code{lgb.cv}, and \code{lightgbm} 29 | } 30 | -------------------------------------------------------------------------------- /R-package/man/readRDS.lgb.Booster.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/readRDS.lgb.Booster.R 3 | \name{readRDS.lgb.Booster} 4 | \alias{readRDS.lgb.Booster} 5 | \title{readRDS for \code{lgb.Booster} models} 6 | \usage{ 7 | readRDS.lgb.Booster(file = "", refhook = NULL) 8 | } 9 | \arguments{ 10 | \item{file}{a connection or the name of the file where the R object is saved to or read from.} 11 | 12 | \item{refhook}{a hook function for handling reference objects.} 13 | } 14 | \value{ 15 | \code{lgb.Booster}. 16 | } 17 | \description{ 18 | Attempts to load a model using RDS. 19 | } 20 | \examples{ 21 | library(lightgbm) 22 | data(agaricus.train, package = "lightgbm") 23 | train <- agaricus.train 24 | dtrain <- lgb.Dataset(train$data, label = train$label) 25 | data(agaricus.test, package = "lightgbm") 26 | test <- agaricus.test 27 | dtest <- lgb.Dataset.create.valid(dtrain, test$data, label = test$label) 28 | params <- list(objective = "regression", metric = "l2") 29 | valids <- list(test = dtest) 30 | model <- lgb.train( 31 | params = params 32 | , data = dtrain 33 | , nrounds = 10L 34 | , valids = valids 35 | , min_data = 1L 36 | , learning_rate = 1.0 37 | , early_stopping_rounds = 5L 38 | ) 39 | saveRDS.lgb.Booster(model, "model.rds") 40 | new_model <- readRDS.lgb.Booster("model.rds") 41 | 42 | } 43 | -------------------------------------------------------------------------------- /R-package/man/setinfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{setinfo} 4 | \alias{setinfo} 5 | \alias{setinfo.lgb.Dataset} 6 | \title{Set information of an \code{lgb.Dataset} object} 7 | \usage{ 8 | setinfo(dataset, ...) 9 | 10 | \method{setinfo}{lgb.Dataset}(dataset, name, info, ...) 11 | } 12 | \arguments{ 13 | \item{dataset}{Object of class \code{lgb.Dataset}} 14 | 15 | \item{...}{other parameters} 16 | 17 | \item{name}{the name of the field to get} 18 | 19 | \item{info}{the specific field of information to set} 20 | } 21 | \value{ 22 | passed object 23 | } 24 | \description{ 25 | Set information of an \code{lgb.Dataset} object 26 | } 27 | \details{ 28 | The \code{name} field can be one of the following: 29 | 30 | \itemize{ 31 | \item \code{label}: label lightgbm learn from ; 32 | \item \code{weight}: to do a weight rescale ; 33 | \item \code{init_score}: initial score is the base prediction lightgbm will boost from ; 34 | \item \code{group}. 35 | } 36 | } 37 | \examples{ 38 | library(lightgbm) 39 | data(agaricus.train, package = "lightgbm") 40 | train <- agaricus.train 41 | dtrain <- lgb.Dataset(train$data, label = train$label) 42 | lgb.Dataset.construct(dtrain) 43 | 44 | labels <- lightgbm::getinfo(dtrain, "label") 45 | lightgbm::setinfo(dtrain, "label", 1 - labels) 46 | 47 | labels2 <- lightgbm::getinfo(dtrain, "label") 48 | stopifnot(all.equal(labels2, 1 - labels)) 49 | 50 | } 51 | -------------------------------------------------------------------------------- /R-package/man/slice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/lgb.Dataset.R 3 | \name{slice} 4 | \alias{slice} 5 | \alias{slice.lgb.Dataset} 6 | \title{Slice a dataset} 7 | \usage{ 8 | slice(dataset, ...) 9 | 10 | \method{slice}{lgb.Dataset}(dataset, idxset, ...) 11 | } 12 | \arguments{ 13 | \item{dataset}{Object of class \code{lgb.Dataset}} 14 | 15 | \item{...}{other parameters (currently not used)} 16 | 17 | \item{idxset}{an integer vector of indices of rows needed} 18 | } 19 | \value{ 20 | constructed sub dataset 21 | } 22 | \description{ 23 | Get a new \code{lgb.Dataset} containing the specified rows of 24 | original \code{lgb.Dataset} object 25 | } 26 | \examples{ 27 | library(lightgbm) 28 | data(agaricus.train, package = "lightgbm") 29 | train <- agaricus.train 30 | dtrain <- lgb.Dataset(train$data, label = train$label) 31 | 32 | dsub <- lightgbm::slice(dtrain, seq_len(42L)) 33 | lgb.Dataset.construct(dsub) 34 | labels <- lightgbm::getinfo(dsub, "label") 35 | 36 | } 37 | -------------------------------------------------------------------------------- /R-package/pkgdown/extra.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | if(window.location.pathname.toLocaleLowerCase().indexOf('/r/reference') != -1) { 3 | /* Replace '/R/' with '/R-package/R/' in all external links to .R files of LightGBM GitHub repo */ 4 | $('a[href^="https://github.com/Microsoft/LightGBM/blob/master/R"][href*=".R"]').attr('href', (i, val) => { return val.replace('/R/', '/R-package/R/'); }); 5 | } 6 | }); 7 | -------------------------------------------------------------------------------- /R-package/src/Makevars: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /R-package/src/Makevars.win: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /R-package/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(lightgbm) 3 | 4 | test_check("lightgbm") 5 | -------------------------------------------------------------------------------- /R-package/tests/testthat/test_lgb.importance.R: -------------------------------------------------------------------------------- 1 | context("lgb.importance") 2 | 3 | test_that("lgb.importance() should reject bad inputs", { 4 | bad_inputs <- list( 5 | .Machine$integer.max 6 | , Inf 7 | , -Inf 8 | , NA 9 | , NA_real_ 10 | , -10L:10L 11 | , list(c("a", "b", "c")) 12 | , data.frame( 13 | x = rnorm(20L) 14 | , y = sample( 15 | x = c(1L, 2L) 16 | , size = 20L 17 | , replace = TRUE 18 | ) 19 | ) 20 | , data.table::data.table( 21 | x = rnorm(20L) 22 | , y = sample( 23 | x = c(1L, 2L) 24 | , size = 20L 25 | , replace = TRUE 26 | ) 27 | ) 28 | , lgb.Dataset( 29 | data = matrix(rnorm(100L), ncol = 2L) 30 | , label = matrix(sample(c(0L, 1L), 50L, replace = TRUE)) 31 | ) 32 | , "lightgbm.model" 33 | ) 34 | for (input in bad_inputs) { 35 | expect_error({ 36 | lgb.importance(input) 37 | }, regexp = "'model' has to be an object of class lgb\\.Booster") 38 | } 39 | }) 40 | -------------------------------------------------------------------------------- /VERSION.txt: -------------------------------------------------------------------------------- 1 | 2.3.2 2 | -------------------------------------------------------------------------------- /build_r_site.R: -------------------------------------------------------------------------------- 1 | library(pkgdown) 2 | 3 | setwd("lightgbm_r") 4 | if (!dir.exists("docs")) { 5 | dir.create("docs") 6 | } 7 | 8 | devtools::document() 9 | clean_site() 10 | init_site() 11 | build_home(preview = FALSE, quiet = FALSE) 12 | build_reference( 13 | lazy = FALSE 14 | , document = FALSE 15 | , examples = TRUE 16 | , run_dont_run = FALSE 17 | , seed = 42L 18 | , preview = FALSE 19 | ) 20 | -------------------------------------------------------------------------------- /compute/.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | -------------------------------------------------------------------------------- /compute/.gitignore: -------------------------------------------------------------------------------- 1 | # build directory 2 | build/ 3 | 4 | # python compiled files 5 | *.pyc 6 | 7 | # vim temp files 8 | .*.sw* 9 | 10 | # generated documentation 11 | bin/ 12 | doc/bin/ 13 | doc/html/ 14 | doc/autodoc.xml 15 | -------------------------------------------------------------------------------- /compute/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /compute/cmake/BoostComputeConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Config file for Boost.Compute (https://github.com/boostorg/compute) 2 | # 3 | # Sets the following variables: 4 | # BoostCompute_INCLUDE_DIRS - include directories for Boost.Compute 5 | 6 | set(BoostCompute_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include/compute") 7 | -------------------------------------------------------------------------------- /compute/doc/compute.qbk: -------------------------------------------------------------------------------- 1 | [/=========================================================================== 2 | Copyright (c) 2013-2015 Kyle Lutz 3 | 4 | Distributed under the Boost Software License, Version 1.0 5 | See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt 7 | =============================================================================/] 8 | 9 | [library Boost.Compute 10 | [quickbook 1.5] 11 | [authors [Lutz, Kyle]] 12 | [copyright 2013-2014 Kyle Lutz] 13 | [purpose A multi-core/GPGPU computing library] 14 | [category concurrent] 15 | [id compute] 16 | [dirname compute] 17 | [license 18 | Distributed under the Boost Software License, Version 1.0. 19 | (See accompanying file LICENSE_1_0.txt or copy at 20 | [@http://www.boost.org/LICENSE_1_0.txt]) 21 | ] 22 | ] 23 | 24 | [include introduction.qbk] 25 | [include getting_started.qbk] 26 | [include design.qbk] 27 | [include tutorial.qbk] 28 | [include advanced_topics.qbk] 29 | [include interop.qbk] 30 | [include porting_guide.qbk] 31 | [include platforms_and_compilers.qbk] 32 | [include reference.qbk] 33 | [include performance.qbk] 34 | [include faq.qbk] 35 | -------------------------------------------------------------------------------- /compute/doc/introduction.qbk: -------------------------------------------------------------------------------- 1 | [/=========================================================================== 2 | Copyright (c) 2013-2015 Kyle Lutz 3 | 4 | Distributed under the Boost Software License, Version 1.0 5 | See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt 7 | =============================================================================/] 8 | 9 | [section:introduction Introduction] 10 | 11 | The Boost Compute library provides a C++ interface to multi-core CPU and GPGPU 12 | computing platforms based on [@http://en.wikipedia.org/wiki/OpenCL OpenCL]. 13 | 14 | The project is hosted on GitHub at [@https://github.com/boostorg/compute]. Click 15 | the arrow below to see the guide on [link boost_compute.getting_started Getting 16 | Started]. 17 | 18 | [endsect] 19 | -------------------------------------------------------------------------------- /compute/doc/platforms_and_compilers.qbk: -------------------------------------------------------------------------------- 1 | [/=========================================================================== 2 | Copyright (c) 2013-2015 Kyle Lutz 3 | 4 | Distributed under the Boost Software License, Version 1.0 5 | See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt 7 | =============================================================================/] 8 | 9 | [section:platforms_and_compilers Platforms and Compilers] 10 | 11 | Boost.Compute has been tested on the following: 12 | 13 | [section Compilers] 14 | 15 | * GCC (>= 4.6) 16 | * Clang (>= 3.0) 17 | * MSVC (>= 2010) 18 | 19 | Boost.Compute requires variadic macro support. Variadic macros are supported by 20 | most modern C++98 compilers and all C++11 compilers. 21 | 22 | To explicitly enable variadic support for Boost.Preprocessor add 23 | `-DBOOST_PP_VARIADICS=1` to your compiler flags. 24 | 25 | [endsect] 26 | 27 | [section Platforms] 28 | 29 | * Linux 30 | * Mac OSX 31 | * Windows 32 | 33 | [endsect] 34 | 35 | [section OpenCL Implementations] 36 | 37 | * NVIDIA (NVIDIA GPUs only) 38 | * AMD (CPUs and AMD GPUs) 39 | * Intel (CPUs and Intel GPUs) 40 | * POCL (CPUs only) 41 | * Beignet (Intel GPUs only) 42 | * Apple (CPUs and GPUs) 43 | * Xilinx (FPGA) 44 | 45 | [endsect] 46 | 47 | If you have an additional platform you would like to see supported please 48 | [@https://github.com/boostorg/compute/issues/new submit] a bug-report. 49 | 50 | [endsect] 51 | -------------------------------------------------------------------------------- /compute/example/hello_world.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | //[hello_world_example 12 | 13 | #include 14 | 15 | #include 16 | 17 | namespace compute = boost::compute; 18 | 19 | int main() 20 | { 21 | // get the default device 22 | compute::device device = compute::system::default_device(); 23 | 24 | // print the device's name and platform 25 | std::cout << "hello from " << device.name(); 26 | std::cout << " (platform: " << device.platform().name() << ")" << std::endl; 27 | 28 | return 0; 29 | } 30 | //] 31 | -------------------------------------------------------------------------------- /compute/example/memory_limits.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | 13 | #include 14 | 15 | namespace compute = boost::compute; 16 | 17 | int main() 18 | { 19 | // get the default device 20 | compute::device device = compute::system::default_device(); 21 | 22 | std::cout << "device: " << device.name() << std::endl; 23 | std::cout << " global memory size: " 24 | << device.get_info(CL_DEVICE_GLOBAL_MEM_SIZE) / 1024 / 1024 25 | << " MB" 26 | << std::endl; 27 | std::cout << " local memory size: " 28 | << device.get_info(CL_DEVICE_LOCAL_MEM_SIZE) / 1024 29 | << " KB" 30 | << std::endl; 31 | std::cout << " constant memory size: " 32 | << device.get_info(CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE) / 1024 33 | << " KB" 34 | << std::endl; 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /compute/include/boost/compute/algorithm/generate_n.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP 12 | #define BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace boost { 19 | namespace compute { 20 | 21 | /// Stores the result of \p generator for each element in the range 22 | /// [\p first, \p first + \p count). 23 | /// 24 | /// Space complexity: \Omega(1) 25 | template 26 | inline void generate_n(OutputIterator first, 27 | Size count, 28 | Generator generator, 29 | command_queue &queue = system::default_queue()) 30 | { 31 | ::boost::compute::generate(first, first + count, generator, queue); 32 | } 33 | 34 | } // end compute namespace 35 | } // end boost namespace 36 | 37 | #endif // BOOST_COMPUTE_ALGORITHM_GENERATE_N_HPP 38 | -------------------------------------------------------------------------------- /compute/include/boost/compute/allocator.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_ALLOCATOR_HPP 12 | #define BOOST_COMPUTE_ALLOCATOR_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute allocator headers. 17 | 18 | #include 19 | #include 20 | 21 | #endif // BOOST_COMPUTE_ALLOCATOR_HPP 22 | -------------------------------------------------------------------------------- /compute/include/boost/compute/async.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_ASYNC_HPP 12 | #define BOOST_COMPUTE_ASYNC_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute async headers. 17 | 18 | #include 19 | #include 20 | 21 | #endif // BOOST_COMPUTE_ASYNC_HPP 22 | -------------------------------------------------------------------------------- /compute/include/boost/compute/cl_ext.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_CL_EXT_HPP 12 | #define BOOST_COMPUTE_CL_EXT_HPP 13 | 14 | #include "detail/cl_versions.hpp" 15 | 16 | #if defined(__APPLE__) 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #endif // BOOST_COMPUTE_CL_EXT_HPP 23 | -------------------------------------------------------------------------------- /compute/include/boost/compute/container.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_CONTAINER_HPP 12 | #define BOOST_COMPUTE_CONTAINER_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute container headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #endif // BOOST_COMPUTE_CONTAINER_HPP 28 | -------------------------------------------------------------------------------- /compute/include/boost/compute/container/string.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_CONTAINER_STRING_HPP 12 | #define BOOST_COMPUTE_CONTAINER_STRING_HPP 13 | 14 | #include 15 | #include 16 | 17 | namespace boost { 18 | namespace compute { 19 | 20 | typedef basic_string string; 21 | 22 | } // end compute namespace 23 | } // end boost namespace 24 | 25 | #endif // BOOST_COMPUTE_CONTAINER_STRING_HPP 26 | -------------------------------------------------------------------------------- /compute/include/boost/compute/core.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_CORE_HPP 12 | #define BOOST_COMPUTE_CORE_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute core headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #endif // BOOST_COMPUTE_CORE_HPP 34 | -------------------------------------------------------------------------------- /compute/include/boost/compute/detail/assert_cl_success.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_DETAIL_ASSERT_CL_SUCCESS_HPP 12 | #define BOOST_COMPUTE_DETAIL_ASSERT_CL_SUCCESS_HPP 13 | 14 | #include 15 | 16 | #if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG) 17 | #define BOOST_COMPUTE_ASSERT_CL_SUCCESS(function) \ 18 | function 19 | #else 20 | #define BOOST_COMPUTE_ASSERT_CL_SUCCESS(function) \ 21 | BOOST_ASSERT(function == CL_SUCCESS) 22 | #endif 23 | 24 | #endif // BOOST_COMPUTE_DETAIL_ASSERT_CL_SUCCESS_HPP 25 | -------------------------------------------------------------------------------- /compute/include/boost/compute/detail/getenv.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_DETAIL_GETENV_HPP 12 | #define BOOST_COMPUTE_DETAIL_GETENV_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | namespace detail { 19 | 20 | inline const char* getenv(const char *env_var) 21 | { 22 | #ifdef _MSC_VER 23 | # pragma warning(push) 24 | # pragma warning(disable: 4996) 25 | #endif 26 | return std::getenv(env_var); 27 | #ifdef _MSC_VER 28 | # pragma warning(pop) 29 | #endif 30 | } 31 | 32 | } // end detail namespace 33 | } // end compute namespace 34 | } // end boost namespace 35 | 36 | #endif // BOOST_COMPUTE_DETAIL_GETENV_HPP 37 | -------------------------------------------------------------------------------- /compute/include/boost/compute/detail/is_buffer_iterator.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_DETAIL_IS_BUFFER_ITERATOR_HPP 12 | #define BOOST_COMPUTE_DETAIL_IS_BUFFER_ITERATOR_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace boost { 19 | namespace compute { 20 | namespace detail { 21 | 22 | // default = false 23 | template 24 | struct is_buffer_iterator : public boost::false_type {}; 25 | 26 | } // end detail namespace 27 | } // end compute namespace 28 | } // end boost namespace 29 | 30 | #endif // BOOST_COMPUTE_DETAIL_IS_BUFFER_ITERATOR_HPP 31 | -------------------------------------------------------------------------------- /compute/include/boost/compute/detail/iterator_traits.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_DETAIL_ITERATOR_TRAITS_HPP 12 | #define BOOST_COMPUTE_DETAIL_ITERATOR_TRAITS_HPP 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | namespace boost { 20 | namespace compute { 21 | namespace detail { 22 | 23 | template 24 | struct iterator_traits : public std::iterator_traits 25 | { 26 | static const bool is_contiguous = is_contiguous_iterator::value; 27 | static const bool is_on_device = is_device_iterator::value; 28 | static const bool is_on_host = !is_on_device; 29 | }; 30 | 31 | } // end detail namespace 32 | } // end compute namespace 33 | } // end boost namespace 34 | 35 | #endif // BOOST_COMPUTE_ITERATOR_TRAITS_HPP 36 | -------------------------------------------------------------------------------- /compute/include/boost/compute/detail/work_size.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_DETAIL_WORK_SIZE_HPP 12 | #define BOOST_COMPUTE_DETAIL_WORK_SIZE_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | namespace detail { 19 | 20 | // Given a total number of values (count), a number of values to 21 | // process per thread (vtp), and a number of threads to execute per 22 | // block (tpb), this function returns the global work size to be 23 | // passed to clEnqueueNDRangeKernel() for a 1D algorithm. 24 | inline size_t calculate_work_size(size_t count, size_t vpt, size_t tpb) 25 | { 26 | size_t work_size = static_cast(std::ceil(float(count) / vpt)); 27 | if(work_size % tpb != 0){ 28 | work_size += tpb - work_size % tpb; 29 | } 30 | return work_size; 31 | } 32 | 33 | } // end detail namespace 34 | } // end compute namespace 35 | } // end boost namespace 36 | 37 | #endif // BOOST_COMPUTE_DETAIL_WORK_SIZE_HPP 38 | -------------------------------------------------------------------------------- /compute/include/boost/compute/exception.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_EXCEPTION_HPP 12 | #define BOOST_COMPUTE_EXCEPTION_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute exception headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #endif // BOOST_COMPUTE_EXCEPTION_HPP 24 | -------------------------------------------------------------------------------- /compute/include/boost/compute/functional/as.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_FUNCTIONAL_AS_HPP 12 | #define BOOST_COMPUTE_FUNCTIONAL_AS_HPP 13 | 14 | namespace boost { 15 | namespace compute { 16 | namespace detail { 17 | 18 | template 19 | struct invoked_as 20 | { 21 | invoked_as(const Arg &arg) 22 | : m_arg(arg) 23 | { 24 | } 25 | 26 | Arg m_arg; 27 | }; 28 | 29 | } // end detail namespace 30 | 31 | /// The \ref as function converts its argument to type \c T (similar to 32 | /// reinterpret_cast). 33 | /// 34 | /// \see \ref convert "convert" 35 | template 36 | struct as 37 | { 38 | typedef T result_type; 39 | 40 | /// \internal_ 41 | template 42 | detail::invoked_as operator()(const Arg &arg) const 43 | { 44 | return detail::invoked_as(arg); 45 | } 46 | }; 47 | 48 | } // end compute namespace 49 | } // end boost namespace 50 | 51 | #endif // BOOST_COMPUTE_FUNCTIONAL_AS_HPP 52 | -------------------------------------------------------------------------------- /compute/include/boost/compute/functional/common.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_FUNCTIONAL_COMMON_HPP 12 | #define BOOST_COMPUTE_FUNCTIONAL_COMMON_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | 19 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(clamp, T (T, T, T), class T) 20 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(degrees, T (T), class T) 21 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(radians, T (T), class T) 22 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(sign, T (T), class T) 23 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(smoothstep, T (T, T, T), class T) 24 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(step, T (T, T), class T) 25 | 26 | } // end compute namespace 27 | } // end boost namespace 28 | 29 | #endif // BOOST_COMPUTE_FUNCTIONAL_COMMON_HPP 30 | -------------------------------------------------------------------------------- /compute/include/boost/compute/functional/detail/macros.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 12 | #define BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 13 | 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(name, signature, template_args) \ 20 | template \ 21 | class name : public function \ 22 | { \ 23 | public: \ 24 | (name)() : function(BOOST_PP_STRINGIZE(name)) { } \ 25 | }; 26 | 27 | #define BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION_UNDERSCORE(name, signature, template_args) \ 28 | template \ 29 | class BOOST_PP_CAT(name, _) : public function \ 30 | { \ 31 | public: \ 32 | BOOST_PP_CAT(name, _)() : function(BOOST_PP_STRINGIZE(name)) { } \ 33 | }; 34 | 35 | #endif // BOOST_COMPUTE_FUNCTIONAL_MACROS_HPP 36 | -------------------------------------------------------------------------------- /compute/include/boost/compute/functional/detail/nvidia_popcount.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_FUNCTIONAL_DETAIL_NVIDIA_POPCOUNT_HPP 12 | #define BOOST_COMPUTE_FUNCTIONAL_DETAIL_NVIDIA_POPCOUNT_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | namespace detail { 19 | 20 | template 21 | class nvidia_popcount : public function 22 | { 23 | public: 24 | nvidia_popcount() 25 | : function("nvidia_popcount") 26 | { 27 | this->set_source( 28 | "inline uint nvidia_popcount(const uint x)\n" 29 | "{\n" 30 | " uint count;\n" 31 | " asm(\"popc.b32 %0, %1;\" : \"=r\"(count) : \"r\"(x));\n" 32 | " return count;\n" 33 | "}\n" 34 | ); 35 | } 36 | }; 37 | 38 | } // end detail namespace 39 | } // end compute namespace 40 | } // end boost namespace 41 | 42 | #endif // BOOST_COMPUTE_FUNCTIONAL_DETAIL_NVIDIA_POPCOUNT_HPP 43 | -------------------------------------------------------------------------------- /compute/include/boost/compute/functional/integer.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_FUNCTIONAL_INTEGER_HPP 12 | #define BOOST_COMPUTE_FUNCTIONAL_INTEGER_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | 19 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(abs, T (T), class T) 20 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(abs_diff, T (T, T), class T) 21 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(add_sat, T (T, T), class T) 22 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(hadd, T (T, T), class T) 23 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(rhadd, T (T, T), class T) 24 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(max, T (T, T), class T) 25 | BOOST_COMPUTE_DECLARE_BUILTIN_FUNCTION(min, T (T, T), class T) 26 | 27 | } // end compute namespace 28 | } // end boost namespace 29 | 30 | #endif // BOOST_COMPUTE_FUNCTIONAL_INTEGER_HPP 31 | -------------------------------------------------------------------------------- /compute/include/boost/compute/image.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_IMAGE_HPP 12 | #define BOOST_COMPUTE_IMAGE_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute image headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #endif // BOOST_COMPUTE_IMAGE_HPP 26 | -------------------------------------------------------------------------------- /compute/include/boost/compute/image2d.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/image3d.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/image_format.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/image_sampler.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/eigen.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_EIGEN_HPP 12 | #define BOOST_COMPUTE_INTEROP_EIGEN_HPP 13 | 14 | #include 15 | 16 | #endif // BOOST_COMPUTE_INTEROP_EIGEN_HPP 17 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opencv.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENCV_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENCV_HPP 13 | 14 | #include 15 | #include 16 | 17 | #endif // BOOST_COMPUTE_INTEROP_OPENCV_HPP 18 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opencv/highgui.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENCV_HIGHGUI_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENCV_HIGHGUI_HPP 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace boost { 19 | namespace compute { 20 | 21 | inline void opencv_imshow(const std::string &winname, 22 | const image2d &image, 23 | command_queue &queue = system::default_queue()) 24 | { 25 | const cv::Mat mat = opencv_create_mat_with_image2d(image, queue); 26 | 27 | cv::imshow(winname, mat); 28 | } 29 | 30 | } // end compute namespace 31 | } // end boost namespace 32 | 33 | #endif // BOOST_COMPUTE_INTEROP_OPENCV_HIGHGUI_HPP 34 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opengl.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENGL_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENGL_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute OpenGL interop headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #endif // BOOST_COMPUTE_INTEROP_OPENGL_HPP 25 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opengl/cl_gl.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_HPP 13 | 14 | #include 15 | 16 | #if defined(__APPLE__) 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #endif // BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_HPP 23 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opengl/cl_gl_ext.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_EXT_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_EXT_HPP 13 | 14 | #include 15 | 16 | #if defined(__APPLE__) 17 | #include 18 | #else 19 | #include 20 | #endif 21 | 22 | #endif // BOOST_COMPUTE_INTEROP_OPENGL_CL_GL_EXT_HPP 23 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/opengl/gl.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_OPENGL_GL_HPP 12 | #define BOOST_COMPUTE_INTEROP_OPENGL_GL_HPP 13 | 14 | #if defined(__APPLE__) 15 | #include 16 | #else 17 | #include 18 | #endif 19 | 20 | #endif // BOOST_COMPUTE_INTEROP_OPENGL_GL_HPP 21 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/qt.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_QT_HPP 12 | #define BOOST_COMPUTE_INTEROP_QT_HPP 13 | 14 | #include 15 | #include 16 | 17 | #endif // BOOST_COMPUTE_INTEROP_QT_HPP 18 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/qt/qpoint.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_QT_QPOINT_HPP 12 | #define BOOST_COMPUTE_INTEROP_QT_QPOINT_HPP 13 | 14 | #include 15 | 16 | #include 17 | 18 | BOOST_COMPUTE_TYPE_NAME(QPoint, "int2") 19 | 20 | #endif // BOOST_COMPUTE_INTEROP_QT_QPOINT_HPP 21 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/qt/qpointf.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_QT_QPOINTF_HPP 12 | #define BOOST_COMPUTE_INTEROP_QT_QPOINTF_HPP 13 | 14 | #include 15 | 16 | #include 17 | 18 | BOOST_COMPUTE_TYPE_NAME(QPointF, "float2") 19 | 20 | #endif // BOOST_COMPUTE_INTEROP_QT_QPOINTF_HPP 21 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/qt/qtcore.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_QT_QTCORE_HPP 12 | #define BOOST_COMPUTE_INTEROP_QT_QTCORE_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #endif // BOOST_COMPUTE_INTEROP_QT_QTCORE_HPP 19 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/qt/qtgui.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_QT_QTGUI_HPP 12 | #define BOOST_COMPUTE_INTEROP_QT_QTGUI_HPP 13 | 14 | #include 15 | 16 | #endif // BOOST_COMPUTE_INTEROP_QT_QTGUI_HPP 17 | -------------------------------------------------------------------------------- /compute/include/boost/compute/interop/vtk.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_INTEROP_VTK_HPP 12 | #define BOOST_COMPUTE_INTEROP_VTK_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #endif // BOOST_COMPUTE_INTEROP_VTK_HPP 20 | -------------------------------------------------------------------------------- /compute/include/boost/compute/iterator.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_ITERATOR_HPP 12 | #define BOOST_COMPUTE_ITERATOR_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute iterator headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif // BOOST_COMPUTE_ITERATOR_HPP 29 | -------------------------------------------------------------------------------- /compute/include/boost/compute/lambda.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_LAMBDA_HPP 12 | #define BOOST_COMPUTE_LAMBDA_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #endif // BOOST_COMPUTE_LAMBDA_HPP 23 | -------------------------------------------------------------------------------- /compute/include/boost/compute/lambda/placeholder.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_LAMBDA_PLACEHOLDER_HPP 12 | #define BOOST_COMPUTE_LAMBDA_PLACEHOLDER_HPP 13 | 14 | namespace boost { 15 | namespace compute { 16 | namespace lambda { 17 | 18 | // lambda placeholder type 19 | template 20 | struct placeholder 21 | { 22 | }; 23 | 24 | } // end lambda namespace 25 | } // end compute namespace 26 | } // end boost namespace 27 | 28 | #endif // BOOST_COMPUTE_LAMBDA_PLACEHOLDER_HPP 29 | -------------------------------------------------------------------------------- /compute/include/boost/compute/memory.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_MEMORY_HPP 12 | #define BOOST_COMPUTE_MEMORY_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute memory headers. 17 | 18 | #include 19 | #include 20 | 21 | #endif // BOOST_COMPUTE_MEMORY_HPP 22 | -------------------------------------------------------------------------------- /compute/include/boost/compute/random.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_RANDOM_HPP 12 | #define BOOST_COMPUTE_RANDOM_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute random headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #endif // BOOST_COMPUTE_RANDOM_HPP 29 | -------------------------------------------------------------------------------- /compute/include/boost/compute/random/default_random_engine.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_RANDOM_DEFAULT_RANDOM_ENGINE_HPP 12 | #define BOOST_COMPUTE_RANDOM_DEFAULT_RANDOM_ENGINE_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | 19 | typedef mt19937 default_random_engine; 20 | 21 | } // end compute namespace 22 | } // end boost namespace 23 | 24 | #endif // BOOST_COMPUTE_RANDOM_DEFAULT_RANDOM_ENGINE_HPP 25 | -------------------------------------------------------------------------------- /compute/include/boost/compute/source.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/type_traits.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TYPE_TRAITS_HPP 12 | #define BOOST_COMPUTE_TYPE_TRAITS_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #endif // BOOST_COMPUTE_TYPE_TRAITS_HPP 26 | -------------------------------------------------------------------------------- /compute/include/boost/compute/type_traits/detail/capture_traits.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TYPE_TRAITS_DETAIL_CAPTURE_TRAITS_HPP 12 | #define BOOST_COMPUTE_TYPE_TRAITS_DETAIL_CAPTURE_TRAITS_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | namespace detail { 19 | 20 | template 21 | struct capture_traits 22 | { 23 | static std::string type_name() 24 | { 25 | return ::boost::compute::type_name(); 26 | } 27 | }; 28 | 29 | } // end detail namespace 30 | } // end compute namespace 31 | } // end boost namespace 32 | 33 | #endif // BOOST_COMPUTE_TYPE_TRAITS_DETAIL_CAPTURE_TRAITS_HPP 34 | -------------------------------------------------------------------------------- /compute/include/boost/compute/type_traits/is_vector_type.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP 12 | #define BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP 13 | 14 | #include 15 | 16 | #include 17 | 18 | namespace boost { 19 | namespace compute { 20 | 21 | /// Meta-function returning \c true if \p T is a vector type. 22 | /// 23 | /// For example, 24 | /// \code 25 | /// is_vector_type::value == false 26 | /// is_vector_type::value == true 27 | /// \endcode 28 | /// 29 | /// \see make_vector_type, vector_size 30 | template 31 | struct is_vector_type : boost::mpl::bool_::value != 1> 32 | { 33 | }; 34 | 35 | } // end compute namespace 36 | } // end boost namespace 37 | 38 | #endif // BOOST_COMPUTE_TYPE_TRAITS_IS_VECTOR_TYPE_HPP 39 | -------------------------------------------------------------------------------- /compute/include/boost/compute/type_traits/type_definition.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP 12 | #define BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace compute { 18 | namespace detail { 19 | 20 | template 21 | struct type_definition_trait 22 | { 23 | static std::string value() { return std::string(); } 24 | }; 25 | 26 | } // end detail namespace 27 | 28 | /// Returns the OpenCL type definition for \c T. 29 | /// 30 | /// \return a string containing the type definition for \c T 31 | /// 32 | /// \see type_name() 33 | template 34 | inline std::string type_definition() 35 | { 36 | return detail::type_definition_trait::value(); 37 | } 38 | 39 | } // end compute namespace 40 | } // end boost namespace 41 | 42 | #endif // BOOST_COMPUTE_TYPE_TRAITS_TYPE_DEFINITION_HPP 43 | -------------------------------------------------------------------------------- /compute/include/boost/compute/types.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TYPES_HPP 12 | #define BOOST_COMPUTE_TYPES_HPP 13 | 14 | /// \file 15 | /// 16 | /// Meta-header to include all Boost.Compute types headers. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #endif // BOOST_COMPUTE_TYPES_HPP 26 | -------------------------------------------------------------------------------- /compute/include/boost/compute/types/builtin.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/include/boost/compute/utility.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_UTILITY_HPP 12 | #define BOOST_COMPUTE_UTILITY_HPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #endif // BOOST_COMPUTE_UTILITY_HPP 22 | -------------------------------------------------------------------------------- /compute/include/boost/compute/version.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_VERSION_HPP 12 | #define BOOST_COMPUTE_VERSION_HPP 13 | 14 | #define BOOST_COMPUTE_VERSION_MAJOR 0 15 | #define BOOST_COMPUTE_VERSION_MINOR 5 16 | #define BOOST_COMPUTE_VERSION_PATCH 0 17 | 18 | #endif // BOOST_COMPUTE_VERSION_HPP 19 | -------------------------------------------------------------------------------- /compute/include/boost/compute/wait_list.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | // deprecated, use instead 12 | #include 13 | -------------------------------------------------------------------------------- /compute/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Automatic redirection failed, please go to 7 | doc/html/index.html 8 |
9 | 10 | Boost.Compute
11 |
12 | Copyright (C) 2013-2015 Kyle Lutz
13 |
14 | Distributed under the Boost Software License, Version 1.0. (See 15 | accompanying file LICENSE_1_0.txt or copy at 16 | http://www.boost.org/LICENSE_1_0.txt)
17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /compute/meta/libraries.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "compute", 3 | "name": "Compute", 4 | "authors": [ 5 | "Kyle Lutz" 6 | ], 7 | "description": "Parallel/GPU-computing library", 8 | "category": [ 9 | "Concurrent" 10 | ], 11 | "maintainers": [ 12 | "Kyle Lutz " 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /compute/perf/perf_bolt_fill.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2015 Jakub Szuppe 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include "perf.hpp" 20 | 21 | int main(int argc, char *argv[]) 22 | { 23 | perf_parse_args(argc, argv); 24 | 25 | std::cout << "size: " << PERF_N << std::endl; 26 | 27 | bolt::cl::control ctrl = bolt::cl::control::getDefault(); 28 | ::cl::Device device = ctrl.getDevice(); 29 | std::cout << "device: " << device.getInfo() << std::endl; 30 | 31 | // create device vector (filled with zeros) 32 | bolt::cl::device_vector d_vec(PERF_N, 0); 33 | 34 | perf_timer t; 35 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 36 | t.start(); 37 | bolt::cl::fill(d_vec.begin(), d_vec.end(), int(trial)); 38 | t.stop(); 39 | } 40 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_accumulate.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | int sum = 0; 33 | perf_timer t; 34 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 35 | t.start(); 36 | sum = std::accumulate(host_vector.begin(), host_vector.end(), int(0)); 37 | t.stop(); 38 | } 39 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 40 | std::cout << "sum: " << sum << std::endl; 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_find_end.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | int pattern[] = {2, 6, 6, 7, 8, 4}; 33 | 34 | perf_timer t; 35 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 36 | t.start(); 37 | std::find_end(host_vector.begin(), host_vector.end(), 38 | pattern, pattern + 6); 39 | t.stop(); 40 | } 41 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_includes.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "perf.hpp" 16 | 17 | int rand_int() 18 | { 19 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 20 | } 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | perf_parse_args(argc, argv); 25 | 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | std::vector v1(PERF_N); 29 | std::generate(v1.begin(), v1.end(), rand_int); 30 | 31 | std::vector v2(v1); 32 | 33 | std::sort(v1.begin(), v1.end()); 34 | std::sort(v2.begin(), v2.end()); 35 | 36 | perf_timer t; 37 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 38 | t.start(); 39 | std::includes( 40 | v1.begin(), v1.end(), 41 | v2.begin(), v2.end() 42 | ); 43 | t.stop(); 44 | } 45 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 46 | 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_max_element.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Rastko Anicic 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "perf.hpp" 16 | 17 | int rand_int() 18 | { 19 | return static_cast(rand() % 10000000); 20 | } 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | perf_parse_args(argc, argv); 25 | std::cout << "size: " << PERF_N << std::endl; 26 | 27 | // create vector of random numbers on the host 28 | std::vector host_vector(PERF_N); 29 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 30 | 31 | int max = 0; 32 | 33 | perf_timer t; 34 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 35 | t.start(); 36 | max = *(std::max_element(host_vector.begin(), host_vector.end())); 37 | t.stop(); 38 | } 39 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 40 | std::cout << "max: " << max << std::endl; 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_merge.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "perf.hpp" 16 | 17 | int main(int argc, char *argv[]) 18 | { 19 | perf_parse_args(argc, argv); 20 | 21 | std::cout << "size: " << PERF_N << std::endl; 22 | std::vector v1 = generate_random_vector(std::floor(PERF_N / 2.0)); 23 | std::vector v2 = generate_random_vector(std::ceil(PERF_N / 2.0)); 24 | std::vector v3(PERF_N); 25 | 26 | std::sort(v1.begin(), v1.end()); 27 | std::sort(v2.begin(), v2.end()); 28 | 29 | perf_timer t; 30 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 31 | t.start(); 32 | std::merge(v1.begin(), v1.end(), v2.begin(), v2.end(), v3.begin()); 33 | t.stop(); 34 | } 35 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_partition.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | bool less_than_10(int value) 24 | { 25 | return value < 10; 26 | } 27 | 28 | int main(int argc, char *argv[]) 29 | { 30 | perf_parse_args(argc, argv); 31 | std::cout << "size: " << PERF_N << std::endl; 32 | 33 | // create vector of random numbers on the host 34 | std::vector host_vector(PERF_N); 35 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 36 | 37 | perf_timer t; 38 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 39 | t.start(); 40 | std::partition(host_vector.begin(), host_vector.end(), less_than_10); 41 | t.stop(); 42 | } 43 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_reverse.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | perf_timer t; 33 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 34 | t.start(); 35 | std::reverse(host_vector.begin(), host_vector.end()); 36 | t.stop(); 37 | } 38 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_rotate.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | perf_timer t; 33 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 34 | t.start(); 35 | std::rotate(host_vector.begin(), host_vector.begin()+(PERF_N/2), host_vector.end()); 36 | t.stop(); 37 | } 38 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_search.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | int pattern[] = {2, 6, 6, 7, 8, 4}; 33 | 34 | perf_timer t; 35 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 36 | t.start(); 37 | std::search(host_vector.begin(), host_vector.end(), 38 | pattern, pattern + 6); 39 | t.stop(); 40 | } 41 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_search_n.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 31 | 32 | perf_timer t; 33 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 34 | t.start(); 35 | std::search_n(host_vector.begin(), host_vector.end(), 5, 2); 36 | t.stop(); 37 | } 38 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_sort.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | 14 | #include "perf.hpp" 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | perf_parse_args(argc, argv); 19 | 20 | std::cout << "size: " << PERF_N << std::endl; 21 | 22 | std::vector v; 23 | perf_timer t; 24 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 25 | v = generate_random_vector(PERF_N); 26 | t.start(); 27 | std::sort(v.begin(), v.end()); 28 | t.stop(); 29 | } 30 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /compute/perf/perf_stl_unique.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int rand_int() 19 | { 20 | return static_cast((rand() / double(RAND_MAX)) * 25.0); 21 | } 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | perf_parse_args(argc, argv); 26 | std::cout << "size: " << PERF_N << std::endl; 27 | 28 | // create vector of random numbers on the host 29 | std::vector host_vector(PERF_N); 30 | 31 | perf_timer t; 32 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 33 | std::generate(host_vector.begin(), host_vector.end(), rand_int); 34 | t.start(); 35 | std::unique(host_vector.begin(), host_vector.end()); 36 | t.stop(); 37 | } 38 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /compute/perf/perf_tbb_sort.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #include "perf.hpp" 17 | 18 | int main(int argc, char *argv[]) 19 | { 20 | perf_parse_args(argc, argv); 21 | 22 | std::cout << "size: " << PERF_N << std::endl; 23 | std::vector v(PERF_N); 24 | 25 | perf_timer t; 26 | for(size_t trial = 0; trial < PERF_TRIALS; trial++){ 27 | v = generate_random_vector(PERF_N); 28 | t.start(); 29 | tbb::parallel_sort(v.begin(), v.end()); 30 | t.stop(); 31 | } 32 | std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /compute/test/check/has_opencl.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2017 Kohei Takahashi 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /compute/test/context_setup.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Denis Demidov 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP 12 | #define BOOST_COMPUTE_TEST_CONTEXT_SETUP_HPP 13 | 14 | #include 15 | #include 16 | 17 | #include "opencl_version_check.hpp" 18 | 19 | struct Context { 20 | boost::compute::device device; 21 | boost::compute::context context; 22 | boost::compute::command_queue queue; 23 | 24 | Context() : 25 | device ( boost::compute::system::default_device() ), 26 | context( boost::compute::system::default_context() ), 27 | queue ( boost::compute::system::default_queue() ) 28 | {} 29 | }; 30 | 31 | BOOST_FIXTURE_TEST_SUITE(compute_test, Context) 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /compute/test/data/invalid_program.cl: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2017 Kristian Popov 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | __kernel void foo(__global int *input) { !@#$%^&*() } 11 | -------------------------------------------------------------------------------- /compute/test/data/program.cl: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2017 Jakub Szuppe 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | __kernel void foobar(__global int* x) 12 | { 13 | const int gid = get_global_id(0); 14 | x[gid] = gid; 15 | } 16 | -------------------------------------------------------------------------------- /compute/test/data/program.spirv32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/compute/test/data/program.spirv32 -------------------------------------------------------------------------------- /compute/test/data/program.spirv64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/compute/test/data/program.spirv64 -------------------------------------------------------------------------------- /compute/test/extra/test_interop_opengl.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestInteropOpenGL 12 | #include 13 | 14 | #include 15 | 16 | BOOST_AUTO_TEST_CASE(opengl_buffer) 17 | { 18 | } 19 | 20 | BOOST_AUTO_TEST_CASE(type_name) 21 | { 22 | BOOST_CHECK_EQUAL( 23 | boost::compute::type_name(), "image2d_t" 24 | ); 25 | BOOST_CHECK_EQUAL( 26 | boost::compute::type_name(), "image2d_t" 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /compute/test/extra/test_multiple_objects1.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestMultipleObjects 12 | #include 13 | #include 14 | 15 | bool dummy_function(); 16 | 17 | BOOST_AUTO_TEST_CASE(multiple_objects) 18 | { 19 | // It is enough if the test compiles. 20 | BOOST_CHECK( dummy_function() ); 21 | } 22 | -------------------------------------------------------------------------------- /compute/test/extra/test_multiple_objects2.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #include 12 | 13 | bool dummy_function() { 14 | return true; 15 | } 16 | -------------------------------------------------------------------------------- /compute/test/opencl_version_check.hpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Denis Demidov 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #ifndef BOOST_COMPUTE_TEST_OPENCL_VERSION_CHECK_HPP 12 | #define BOOST_COMPUTE_TEST_OPENCL_VERSION_CHECK_HPP 13 | 14 | #define REQUIRES_OPENCL_VERSION(major, minor) \ 15 | if (!device.check_version(major, minor)) return 16 | 17 | #define REQUIRES_OPENCL_PLATFORM_VERSION(major, minor) \ 18 | if (!device.platform().check_version(major, minor)) return 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /compute/test/test_buffer_allocator.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestBufferAllocator 12 | #include 13 | 14 | #include 15 | 16 | #include "context_setup.hpp" 17 | 18 | namespace compute = boost::compute; 19 | 20 | BOOST_AUTO_TEST_CASE(allocate) 21 | { 22 | compute::buffer_allocator allocator(context); 23 | 24 | typedef compute::buffer_allocator::pointer pointer; 25 | pointer x = allocator.allocate(10); 26 | allocator.deallocate(x, 10); 27 | } 28 | 29 | BOOST_AUTO_TEST_SUITE_END() 30 | -------------------------------------------------------------------------------- /compute/test/test_clamp_range.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestClampRange 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include "check_macros.hpp" 19 | #include "context_setup.hpp" 20 | 21 | namespace compute = boost::compute; 22 | 23 | BOOST_AUTO_TEST_CASE(clamp_float_range) 24 | { 25 | float data[] = { 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f }; 26 | compute::vector input(data, data + 8, queue); 27 | 28 | compute::vector result(8, context); 29 | compute::experimental::clamp_range( 30 | input.begin(), 31 | input.end(), 32 | result.begin(), 33 | 3.f, // low 34 | 6.f, // high 35 | queue 36 | ); 37 | CHECK_RANGE_EQUAL( 38 | float, 8, result, 39 | (3.f, 3.f, 3.f, 4.f, 5.f, 6.f, 6.f, 6.f) 40 | ); 41 | } 42 | 43 | BOOST_AUTO_TEST_SUITE_END() 44 | -------------------------------------------------------------------------------- /compute/test/test_context_error.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Fabian Köhler 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestContextError 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | BOOST_AUTO_TEST_CASE(what) 18 | { 19 | boost::compute::context context = boost::compute::system::default_context(); 20 | boost::compute::context_error error(&context, "Test", 0, 0); 21 | BOOST_CHECK_EQUAL(std::string(error.what()), std::string("Test")); 22 | BOOST_CHECK(*error.get_context_ptr() == context); 23 | BOOST_CHECK(error.get_private_info_ptr() == 0); 24 | BOOST_CHECK(error.get_private_info_size() == 0); 25 | } 26 | -------------------------------------------------------------------------------- /compute/test/test_functional_hash.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestFunctionalHash 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "check_macros.hpp" 21 | #include "context_setup.hpp" 22 | 23 | namespace compute = boost::compute; 24 | 25 | BOOST_AUTO_TEST_CASE(hash_int) 26 | { 27 | using compute::ulong_; 28 | 29 | int data[] = { 1, 2, 3, 4 }; 30 | compute::vector input_values(data, data + 4, queue); 31 | compute::vector hash_values(4, context); 32 | 33 | compute::transform( 34 | input_values.begin(), 35 | input_values.end(), 36 | hash_values.begin(), 37 | compute::hash(), 38 | queue 39 | ); 40 | } 41 | 42 | BOOST_AUTO_TEST_SUITE_END() 43 | -------------------------------------------------------------------------------- /compute/test/test_functional_identity.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestFunctionalIdentity 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include "check_macros.hpp" 20 | #include "context_setup.hpp" 21 | 22 | namespace compute = boost::compute; 23 | 24 | BOOST_AUTO_TEST_CASE(copy_with_identity_transform) 25 | { 26 | int data[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; 27 | compute::vector input(data, data + 8, queue); 28 | compute::vector output(8, context); 29 | 30 | compute::transform( 31 | input.begin(), input.end(), output.begin(), compute::identity(), queue 32 | ); 33 | 34 | CHECK_RANGE_EQUAL( 35 | int, 8, output, (1, 2, 3, 4, 5, 6, 7, 8) 36 | ); 37 | } 38 | 39 | BOOST_AUTO_TEST_SUITE_END() 40 | -------------------------------------------------------------------------------- /compute/test/test_image3d.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestImage3D 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include "context_setup.hpp" 18 | 19 | namespace compute = boost::compute; 20 | 21 | BOOST_AUTO_TEST_CASE(image3d_get_supported_formats) 22 | { 23 | const std::vector formats = 24 | compute::image3d::get_supported_formats(context); 25 | } 26 | 27 | // check type_name() for image3d 28 | BOOST_AUTO_TEST_CASE(image3d_type_name) 29 | { 30 | BOOST_CHECK( 31 | std::strcmp( 32 | boost::compute::type_name(), "image3d_t" 33 | ) == 0 34 | ); 35 | } 36 | 37 | BOOST_AUTO_TEST_SUITE_END() 38 | -------------------------------------------------------------------------------- /compute/test/test_malloc.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestMalloc 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include "context_setup.hpp" 18 | 19 | namespace bc = boost::compute; 20 | 21 | BOOST_AUTO_TEST_CASE(malloc_int) 22 | { 23 | bc::experimental::device_ptr ptr = bc::experimental::malloc(5, context); 24 | 25 | int input_data[] = { 2, 5, 8, 3, 6 }; 26 | bc::copy(input_data, input_data + 5, ptr, queue); 27 | 28 | int output_data[5]; 29 | bc::copy(ptr, ptr + 5, output_data, queue); 30 | 31 | BOOST_CHECK_EQUAL(output_data[0], 2); 32 | BOOST_CHECK_EQUAL(output_data[1], 5); 33 | BOOST_CHECK_EQUAL(output_data[2], 8); 34 | BOOST_CHECK_EQUAL(output_data[3], 3); 35 | BOOST_CHECK_EQUAL(output_data[4], 6); 36 | 37 | bc::experimental::free(ptr); 38 | } 39 | 40 | BOOST_AUTO_TEST_SUITE_END() 41 | -------------------------------------------------------------------------------- /compute/test/test_no_device_found.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2015 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestNoDeviceFound 12 | #include 13 | 14 | #include 15 | 16 | void throw_no_device_found() 17 | { 18 | throw boost::compute::no_device_found(); 19 | } 20 | 21 | BOOST_AUTO_TEST_CASE(what) 22 | { 23 | try { 24 | throw_no_device_found(); 25 | 26 | BOOST_REQUIRE(false); // should not get here 27 | } 28 | catch(boost::compute::no_device_found& e){ 29 | BOOST_CHECK_EQUAL(std::string(e.what()), "No OpenCL device found"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /compute/test/test_opencl_error.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestOpenCLError 12 | #include 13 | 14 | #include 15 | 16 | #include "check_macros.hpp" 17 | #include "context_setup.hpp" 18 | 19 | BOOST_AUTO_TEST_CASE(error_to_string) 20 | { 21 | using boost::compute::opencl_error; 22 | 23 | BOOST_CHECK_EQUAL(opencl_error::to_string(CL_SUCCESS), "Success"); 24 | BOOST_CHECK_EQUAL(opencl_error::to_string(CL_INVALID_VALUE), "Invalid Value"); 25 | BOOST_CHECK_EQUAL(opencl_error::to_string(-123456), "Unknown OpenCL Error (-123456)"); 26 | } 27 | 28 | BOOST_AUTO_TEST_CASE(error_code) 29 | { 30 | boost::compute::opencl_error e(CL_INVALID_DEVICE); 31 | BOOST_CHECK_EQUAL(e.error_code(), CL_INVALID_DEVICE); 32 | BOOST_CHECK_EQUAL(e.error_string(), "Invalid Device"); 33 | } 34 | 35 | BOOST_AUTO_TEST_SUITE_END() 36 | -------------------------------------------------------------------------------- /compute/test/test_partition_point.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestPartitionPoint 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include "check_macros.hpp" 22 | #include "context_setup.hpp" 23 | 24 | namespace bc = boost::compute; 25 | 26 | BOOST_AUTO_TEST_CASE(partition_point_int) 27 | { 28 | int dataset[] = {1, 1, 5, 2, 4, -2, 0, -1, 0, -1}; 29 | bc::vector vector(dataset, dataset + 10, queue); 30 | 31 | bc::vector::iterator iter = 32 | bc::partition_point(vector.begin(), vector.begin() + 10, 33 | bc::_1 > 0, queue); 34 | 35 | BOOST_VERIFY(iter == vector.begin()+5); 36 | } 37 | 38 | BOOST_AUTO_TEST_SUITE_END() 39 | -------------------------------------------------------------------------------- /compute/test/test_pinned_allocator.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestPinnedAllocator 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include "context_setup.hpp" 18 | 19 | namespace compute = boost::compute; 20 | 21 | BOOST_AUTO_TEST_CASE(vector_with_pinned_allocator) 22 | { 23 | compute::vector > vector(context); 24 | vector.push_back(12, queue); 25 | } 26 | 27 | BOOST_AUTO_TEST_SUITE_END() 28 | -------------------------------------------------------------------------------- /compute/test/test_pipe.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestPipe 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include "context_setup.hpp" 18 | 19 | namespace compute = boost::compute; 20 | 21 | BOOST_AUTO_TEST_CASE(empty) 22 | { 23 | } 24 | 25 | #ifdef BOOST_COMPUTE_CL_VERSION_2_0 26 | BOOST_AUTO_TEST_CASE(create_pipe) 27 | { 28 | REQUIRES_OPENCL_VERSION(2, 0); 29 | 30 | compute::pipe pipe(context, 16 * sizeof(float), 128); 31 | BOOST_CHECK_EQUAL(pipe.get_info(), 64); 32 | BOOST_CHECK_EQUAL(pipe.get_info(), 128); 33 | } 34 | #endif // BOOST_COMPUTE_CL_VERSION_2_0 35 | 36 | BOOST_AUTO_TEST_SUITE_END() 37 | -------------------------------------------------------------------------------- /compute/test/test_result_of.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestResultOf 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | BOOST_AUTO_TEST_CASE(result_of_function) 19 | { 20 | using boost::compute::function; 21 | using boost::compute::result_of; 22 | 23 | BOOST_STATIC_ASSERT(( 24 | boost::is_same()>::type, int>::value 25 | )); 26 | } 27 | 28 | BOOST_AUTO_TEST_CASE(result_of_operators) 29 | { 30 | using boost::compute::plus; 31 | using boost::compute::minus; 32 | using boost::compute::result_of; 33 | 34 | BOOST_STATIC_ASSERT(( 35 | boost::is_same(int, int)>::type, int>::value 36 | )); 37 | BOOST_STATIC_ASSERT(( 38 | boost::is_same(int, int)>::type, int>::value 39 | )); 40 | } 41 | -------------------------------------------------------------------------------- /compute/test/test_system.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestSystem 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | BOOST_AUTO_TEST_CASE(platform_count) 18 | { 19 | BOOST_CHECK(boost::compute::system::platform_count() >= 1); 20 | } 21 | 22 | BOOST_AUTO_TEST_CASE(device_count) 23 | { 24 | BOOST_CHECK(boost::compute::system::device_count() >= 1); 25 | } 26 | 27 | BOOST_AUTO_TEST_CASE(default_device) 28 | { 29 | boost::compute::device device = boost::compute::system::default_device(); 30 | BOOST_CHECK(device.id() != cl_device_id()); 31 | } 32 | 33 | BOOST_AUTO_TEST_CASE(find_device) 34 | { 35 | boost::compute::device device = boost::compute::system::default_device(); 36 | const std::string &name = device.name(); 37 | BOOST_CHECK(boost::compute::system::find_device(name).name() == device.name()); 38 | } 39 | -------------------------------------------------------------------------------- /compute/test/test_tabulate.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestTabulate 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "check_macros.hpp" 21 | #include "context_setup.hpp" 22 | 23 | namespace compute = boost::compute; 24 | 25 | BOOST_AUTO_TEST_CASE(tabulate_negative_int) 26 | { 27 | BOOST_COMPUTE_FUNCTION(int, negate, (int x), 28 | { 29 | return -x; 30 | }); 31 | 32 | compute::vector vector(10, context); 33 | compute::experimental::tabulate(vector.begin(), vector.end(), negate, queue); 34 | CHECK_RANGE_EQUAL(int, 10, vector, (0, -1, -2, -3, -4, -5, -6, -7, -8, -9)); 35 | } 36 | 37 | BOOST_AUTO_TEST_SUITE_END() 38 | -------------------------------------------------------------------------------- /compute/test/test_unique_copy.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Roshan 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestUniqueCopy 12 | #include 13 | 14 | #include 15 | #include 16 | 17 | #include "check_macros.hpp" 18 | #include "context_setup.hpp" 19 | 20 | namespace bc = boost::compute; 21 | namespace compute = boost::compute; 22 | 23 | BOOST_AUTO_TEST_CASE(unique_copy_int) 24 | { 25 | int data[] = {1, 6, 6, 4, 2, 2, 4}; 26 | 27 | bc::vector input(data, data + 7, queue); 28 | bc::vector result(5, context); 29 | 30 | bc::vector::iterator iter = 31 | bc::unique_copy(input.begin(), input.end(), result.begin(), queue); 32 | 33 | BOOST_VERIFY(iter == result.begin() + 5); 34 | CHECK_RANGE_EQUAL(int, 5, result, (1, 6, 4, 2, 4)); 35 | } 36 | 37 | BOOST_AUTO_TEST_SUITE_END() 38 | -------------------------------------------------------------------------------- /compute/test/test_unsupported_extension.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2014 Fabian Köhler 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | #define BOOST_TEST_MODULE TestUnsupportedExtension 11 | #include 12 | #include 13 | 14 | BOOST_AUTO_TEST_CASE(unsupported_extension_error_what) 15 | { 16 | boost::compute::unsupported_extension_error error("CL_DUMMY_EXTENSION"); 17 | BOOST_CHECK_EQUAL(std::string(error.what()), std::string("OpenCL extension CL_DUMMY_EXTENSION not supported")); 18 | } 19 | -------------------------------------------------------------------------------- /compute/test/test_user_event.cpp: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------// 2 | // Copyright (c) 2013-2014 Kyle Lutz 3 | // 4 | // Distributed under the Boost Software License, Version 1.0 5 | // See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt 7 | // 8 | // See http://boostorg.github.com/compute for more information. 9 | //---------------------------------------------------------------------------// 10 | 11 | #define BOOST_TEST_MODULE TestUserEvent 12 | #include 13 | 14 | #include 15 | 16 | #include "context_setup.hpp" 17 | 18 | BOOST_AUTO_TEST_CASE(empty){} 19 | 20 | #ifdef BOOST_COMPUTE_CL_VERSION_1_1 21 | BOOST_AUTO_TEST_CASE(user_event) 22 | { 23 | REQUIRES_OPENCL_VERSION(1, 1); 24 | 25 | boost::compute::user_event event(context); 26 | BOOST_CHECK(event.get() != cl_event()); 27 | BOOST_CHECK(event.status() != CL_COMPLETE); 28 | 29 | event.set_status(CL_COMPLETE); 30 | event.wait(); 31 | BOOST_CHECK(event.status() == CL_COMPLETE); 32 | } 33 | #endif // BOOST_COMPUTE_CL_VERSION_1_1 34 | 35 | BOOST_AUTO_TEST_SUITE_END() 36 | -------------------------------------------------------------------------------- /docker/dockerfile-cli: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y --no-install-recommends \ 5 | ca-certificates \ 6 | cmake \ 7 | build-essential \ 8 | gcc \ 9 | g++ \ 10 | git && \ 11 | rm -rf /var/lib/apt/lists/* 12 | 13 | RUN git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ 14 | mkdir LightGBM/build && \ 15 | cd LightGBM/build && \ 16 | cmake .. && \ 17 | make -j4 && \ 18 | make install && \ 19 | cd ../.. && \ 20 | rm -rf LightGBM 21 | 22 | ENTRYPOINT ["lightgbm"] 23 | -------------------------------------------------------------------------------- /docker/dockerfile-python: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | ARG CONDA_DIR=/opt/conda 4 | ENV PATH $CONDA_DIR/bin:$PATH 5 | 6 | RUN apt-get update && \ 7 | apt-get install -y --no-install-recommends \ 8 | ca-certificates \ 9 | cmake \ 10 | build-essential \ 11 | gcc \ 12 | g++ \ 13 | git \ 14 | wget && \ 15 | # python environment 16 | wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ 17 | /bin/bash Miniconda3-latest-Linux-x86_64.sh -f -b -p $CONDA_DIR && \ 18 | export PATH="$CONDA_DIR/bin:$PATH" && \ 19 | conda config --set always_yes yes --set changeps1 no && \ 20 | # lightgbm 21 | conda install -q -y numpy scipy scikit-learn pandas && \ 22 | git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ 23 | cd LightGBM/python-package && python setup.py install && \ 24 | # clean 25 | apt-get autoremove -y && apt-get clean && \ 26 | conda clean -a -y && \ 27 | rm -rf /usr/local/src/* 28 | -------------------------------------------------------------------------------- /docker/dockerfile-r: -------------------------------------------------------------------------------- 1 | FROM rocker/verse:latest 2 | 3 | WORKDIR /lgbm 4 | 5 | RUN apt-get update && \ 6 | apt-get install -y build-essential && \ 7 | git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ 8 | cd LightGBM && \ 9 | Rscript build_r.R 10 | -------------------------------------------------------------------------------- /docker/gpu/README.md: -------------------------------------------------------------------------------- 1 | # Dockerfile for LightGBM GPU Version with Python 2 | 3 | A docker file with LightGBM utilizing nvidia-docker. The file is based on the `nvidia/cuda:8.0-cudnn5-devel` image. 4 | LightGBM can be utilized in GPU and CPU modes and via Python (2.7 & 3.6). 5 | 6 | ## Contents 7 | 8 | - LightGBM (cpu + gpu) 9 | - Python 2.7 (conda) + scikit-learn, notebooks, pandas, matplotlib 10 | - Python 3.6 (conda) + scikit-learn, notebooks, pandas, matplotlib 11 | 12 | Running the container starts a Jupyter Notebook at `localhost:8888`. 13 | 14 | Jupyter password: `keras`. 15 | 16 | ## Requirements 17 | 18 | Requires docker and [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) on host machine. 19 | 20 | ## Quickstart 21 | 22 | ### Build Docker Image 23 | 24 | ```sh 25 | mkdir lightgbm-docker 26 | cd lightgbm-docker 27 | wget https://raw.githubusercontent.com/Microsoft/LightGBM/master/docker/gpu/dockerfile.gpu 28 | docker build -f dockerfile.gpu -t lightgbm-gpu . 29 | ``` 30 | 31 | ### Run Image 32 | 33 | ```sh 34 | nvidia-docker run --rm -d --name lightgbm-gpu -p 8888:8888 -v /home:/home lightgbm-gpu 35 | ``` 36 | 37 | ### Attach with Command Line Access (if required) 38 | 39 | ```sh 40 | docker exec -it lightgbm-gpu bash 41 | ``` 42 | 43 | ### Jupyter Notebook 44 | 45 | ```sh 46 | localhost:8888 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/.linkcheckerrc: -------------------------------------------------------------------------------- 1 | [checking] 2 | recursionlevel=1 3 | anchors=1 4 | sslverify=0 5 | 6 | [filtering] 7 | ignore= 8 | pythonapi/lightgbm\..*\.html.* 9 | ignorewarnings=http-robots-denied,https-certificate-error 10 | checkextern=1 11 | 12 | [output] 13 | # Set to 1 if you want see the full output, not only warnings and errors 14 | verbose=0 15 | 16 | [AnchorCheck] 17 | -------------------------------------------------------------------------------- /docs/C-API.rst: -------------------------------------------------------------------------------- 1 | C API 2 | ===== 3 | 4 | .. doxygenfile:: c_api.h 5 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = -W 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = LightGBM 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/Python-API.rst: -------------------------------------------------------------------------------- 1 | Python API 2 | ========== 3 | 4 | .. currentmodule:: lightgbm 5 | 6 | Data Structure API 7 | ------------------ 8 | 9 | .. autosummary:: 10 | :toctree: pythonapi/ 11 | 12 | Dataset 13 | Booster 14 | 15 | Training API 16 | ------------ 17 | 18 | .. autosummary:: 19 | :toctree: pythonapi/ 20 | 21 | train 22 | cv 23 | 24 | Scikit-learn API 25 | ---------------- 26 | 27 | .. autosummary:: 28 | :toctree: pythonapi/ 29 | 30 | LGBMModel 31 | LGBMClassifier 32 | LGBMRegressor 33 | LGBMRanker 34 | 35 | Callbacks 36 | --------- 37 | 38 | .. autosummary:: 39 | :toctree: pythonapi/ 40 | 41 | early_stopping 42 | print_evaluation 43 | record_evaluation 44 | reset_parameter 45 | 46 | Plotting 47 | -------- 48 | 49 | .. autosummary:: 50 | :toctree: pythonapi/ 51 | 52 | plot_importance 53 | plot_split_value_histogram 54 | plot_metric 55 | plot_tree 56 | create_tree_digraph 57 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | Documentation 2 | ============= 3 | 4 | Documentation for LightGBM is generated using `Sphinx `__ 5 | and `Breathe `__, which works on top of `Doxygen `__ output. 6 | 7 | List of parameters and their descriptions in `Parameters.rst <./Parameters.rst>`__ 8 | is generated automatically from comments in `config file `__ 9 | by `this script `__. 10 | 11 | After each commit on ``master``, documentation is updated and published to `Read the Docs `__. 12 | 13 | Build 14 | ----- 15 | 16 | You can build the documentation locally. Just install Doxygen and run in ``docs`` folder 17 | 18 | .. code:: sh 19 | 20 | pip install -r requirements.txt 21 | make html 22 | 23 | Unfortunately, documentation for R code is built only on our site, and commands above will not build it for you locally. 24 | Consider using common R utilities for documentation generation, if you need it. 25 | 26 | If you faced any problems with Doxygen installation or you simply do not need documentation for C code, it is possible to build the documentation without it: 27 | 28 | .. code:: sh 29 | 30 | pip install -r requirements_base.txt 31 | export C_API=NO || set C_API=NO 32 | make html 33 | -------------------------------------------------------------------------------- /docs/_static/images/artifacts-download.svg: -------------------------------------------------------------------------------- 1 | artifactsartifactsdownloaddownload -------------------------------------------------------------------------------- /docs/_static/images/artifacts-fetching.svg: -------------------------------------------------------------------------------- 1 | artifactsartifactsfetching...fetching... -------------------------------------------------------------------------------- /docs/_static/images/artifacts-not-available.svg: -------------------------------------------------------------------------------- 1 | artifactsartifactslink is available only on Read the Docs sitelink is available only on Read the Docs site -------------------------------------------------------------------------------- /docs/_static/images/gcc-bars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-bars.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-chart.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-comparison-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-comparison-1.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-comparison-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-comparison-2.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-meetup-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-meetup-1.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-meetup-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-meetup-2.png -------------------------------------------------------------------------------- /docs/_static/images/gcc-table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gcc-table.png -------------------------------------------------------------------------------- /docs/_static/images/gpu-performance-comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/gpu-performance-comparison.png -------------------------------------------------------------------------------- /docs/_static/images/leaf-wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/leaf-wise.png -------------------------------------------------------------------------------- /docs/_static/images/level-wise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/level-wise.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-added-manual-entry-in-cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-added-manual-entry-in-cmake.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-advanced-system-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-advanced-system-settings.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-boost-compiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-boost-compiled.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-configured-and-generated-cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-configured-and-generated-cmake.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-configured-lightgbm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-configured-lightgbm.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-create-directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-create-directory.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-debug-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-debug-run.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-downloading-cmake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-downloading-cmake.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-environment-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-environment-variables.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-files-to-remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-files-to-remove.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-git-for-windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-git-for-windows.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-lightgbm-in-cli-with-gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-lightgbm-in-cli-with-gpu.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-lightgbm-with-gpu-support-compiled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-lightgbm-with-gpu-support-compiled.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-mingw-installation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-mingw-installation.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-mingw-makefiles-to-use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-mingw-makefiles-to-use.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-r-mingw-used.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-r-mingw-used.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-segmentation-fault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-segmentation-fault.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-system.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-system.png -------------------------------------------------------------------------------- /docs/_static/images/screenshot-use-gpu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/docs/_static/images/screenshot-use-gpu.png -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | set SPHINXPROJ=LightGBM 13 | set SPHINXOPTS=-W 14 | 15 | if "%1" == "" goto help 16 | 17 | %SPHINXBUILD% >NUL 2>NUL 18 | if errorlevel 9009 ( 19 | echo. 20 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 21 | echo.installed, then set the SPHINXBUILD environment variable to point 22 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 23 | echo.may add the Sphinx directory to PATH. 24 | echo. 25 | echo.If you don't have Sphinx installed, grab it from 26 | echo.http://sphinx-doc.org/ 27 | exit /b 1 28 | ) 29 | 30 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 31 | goto end 32 | 33 | :help 34 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 35 | 36 | :end 37 | popd 38 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | -r requirements_base.txt 2 | breathe 3 | -------------------------------------------------------------------------------- /docs/requirements_base.txt: -------------------------------------------------------------------------------- 1 | sphinx 2 | sphinx_rtd_theme >= 0.3 3 | mock; python_version < '3' 4 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | -------------------------------------------------------------------------------- /include/LightGBM/export.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2017 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #ifndef LIGHTGBM_EXPORT_H_ 6 | #define LIGHTGBM_EXPORT_H_ 7 | 8 | /** Macros for exporting symbols in MSVC/GCC/CLANG **/ 9 | 10 | #ifdef __cplusplus 11 | #define LIGHTGBM_EXTERN_C extern "C" 12 | #else 13 | #define LIGHTGBM_EXTERN_C 14 | #endif 15 | 16 | 17 | #ifdef _MSC_VER 18 | #define LIGHTGBM_EXPORT __declspec(dllexport) 19 | #define LIGHTGBM_C_EXPORT LIGHTGBM_EXTERN_C __declspec(dllexport) 20 | #else 21 | #define LIGHTGBM_EXPORT 22 | #define LIGHTGBM_C_EXPORT LIGHTGBM_EXTERN_C 23 | #endif 24 | 25 | #endif /** LIGHTGBM_EXPORT_H_ **/ 26 | -------------------------------------------------------------------------------- /include/LightGBM/prediction_early_stop.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2017 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #ifndef LIGHTGBM_PREDICTION_EARLY_STOP_H_ 6 | #define LIGHTGBM_PREDICTION_EARLY_STOP_H_ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace LightGBM { 14 | 15 | struct PredictionEarlyStopInstance { 16 | /// Callback function type for early stopping. 17 | /// Takes current prediction and number of elements in prediction 18 | /// @returns true if prediction should stop according to criterion 19 | using FunctionType = std::function; 20 | 21 | FunctionType callback_function; // callback function itself 22 | int round_period; // call callback_function every `runPeriod` iterations 23 | }; 24 | 25 | struct PredictionEarlyStopConfig { 26 | int round_period; 27 | double margin_threshold; 28 | }; 29 | 30 | /// Create an early stopping algorithm of type `type`, with given round_period and margin threshold 31 | LIGHTGBM_EXPORT PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const std::string& type, 32 | const PredictionEarlyStopConfig& config); 33 | 34 | } // namespace LightGBM 35 | 36 | #endif // LIGHTGBM_PREDICTION_EARLY_STOP_H_ 37 | -------------------------------------------------------------------------------- /include/LightGBM/utils/threading.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2016 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #ifndef LIGHTGBM_UTILS_THREADING_H_ 6 | #define LIGHTGBM_UTILS_THREADING_H_ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace LightGBM { 14 | 15 | class Threading { 16 | public: 17 | template 18 | static inline void For(INDEX_T start, INDEX_T end, const std::function& inner_fun) { 19 | int num_threads = 1; 20 | #pragma omp parallel 21 | #pragma omp master 22 | { 23 | num_threads = omp_get_num_threads(); 24 | } 25 | INDEX_T num_inner = (end - start + num_threads - 1) / num_threads; 26 | if (num_inner <= 0) { num_inner = 1; } 27 | OMP_INIT_EX(); 28 | #pragma omp parallel for schedule(static, 1) 29 | for (int i = 0; i < num_threads; ++i) { 30 | OMP_LOOP_EX_BEGIN(); 31 | INDEX_T inner_start = start + num_inner * i; 32 | INDEX_T inner_end = inner_start + num_inner; 33 | if (inner_end > end) { inner_end = end; } 34 | if (inner_start < end) { 35 | inner_fun(i, inner_start, inner_end); 36 | } 37 | OMP_LOOP_EX_END(); 38 | } 39 | OMP_THROW_EX(); 40 | } 41 | }; 42 | 43 | } // namespace LightGBM 44 | 45 | #endif // LightGBM_UTILS_THREADING_H_ 46 | -------------------------------------------------------------------------------- /pmml/README.md: -------------------------------------------------------------------------------- 1 | PMML Generator 2 | ============== 3 | 4 | The old Python convert script is removed due to it cannot support the new format of categorical features. 5 | 6 | Please refer to https://github.com/jpmml/jpmml-lightgbm. 7 | -------------------------------------------------------------------------------- /python-package/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /python-package/MANIFEST.in: -------------------------------------------------------------------------------- 1 | prune build 2 | include LICENSE 3 | include *.rst *.txt 4 | recursive-include lightgbm *.py *.txt *.so 5 | recursive-include compile *.txt *.so 6 | recursive-include compile/Release *.dll 7 | recursive-include compile/compute * 8 | recursive-include compile/include * 9 | recursive-include compile/src * 10 | recursive-include compile/windows LightGBM.sln LightGBM.vcxproj 11 | recursive-include compile/windows/x64/DLL *.dll 12 | global-exclude *.py[co] 13 | -------------------------------------------------------------------------------- /python-package/build/lib/lightgbmmt/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | """LightGBM, Light Gradient Boosting Machine. 3 | 4 | Contributors: https://github.com/microsoft/LightGBM/graphs/contributors. 5 | """ 6 | from __future__ import absolute_import 7 | 8 | from .basic import Booster, Dataset 9 | from .callback import (early_stopping, print_evaluation, record_evaluation, 10 | reset_parameter) 11 | from .engine import cv, train 12 | 13 | import os 14 | 15 | try: 16 | from .sklearn import LGBMModel, LGBMRegressor, LGBMClassifier, LGBMRanker 17 | except ImportError: 18 | pass 19 | try: 20 | from .plotting import (plot_importance, plot_split_value_histogram, plot_metric, 21 | plot_tree, create_tree_digraph) 22 | except ImportError: 23 | pass 24 | 25 | 26 | dir_path = os.path.dirname(os.path.realpath(__file__)) 27 | 28 | if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')): 29 | with open(os.path.join(dir_path, 'VERSION.txt')) as version_file: 30 | __version__ = version_file.read().strip() 31 | 32 | __all__ = ['Dataset', 'Booster', 33 | 'train', 'cv', 34 | 'LGBMModel', 'LGBMRegressor', 'LGBMClassifier', 'LGBMRanker', 35 | 'print_evaluation', 'record_evaluation', 'reset_parameter', 'early_stopping', 36 | 'plot_importance', 'plot_split_value_histogram', 'plot_metric', 'plot_tree', 'create_tree_digraph'] 37 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/3.10.2/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-5.4.0-72-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "5.4.0-72-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-5.4.0-72-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "5.4.0-72-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/3.10.2/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/3.10.2/CompilerIdC/a.out -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/3.10.2/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/3.10.2/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/yingzhenzhe/lightgbm_mgbm/python-package/compile") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/OpenMPCheckVersion.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | const char ompver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M', 5 | 'P', '-', 'd', 'a', 't', 'e', '[', 6 | ('0' + ((_OPENMP/100000)%10)), 7 | ('0' + ((_OPENMP/10000)%10)), 8 | ('0' + ((_OPENMP/1000)%10)), 9 | ('0' + ((_OPENMP/100)%10)), 10 | ('0' + ((_OPENMP/10)%10)), 11 | ('0' + ((_OPENMP/1)%10)), 12 | ']', '\0' }; 13 | int main() 14 | { 15 | puts(ompver_str); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/OpenMPCheckVersion.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | const char ompver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M', 5 | 'P', '-', 'd', 'a', 't', 'e', '[', 6 | ('0' + ((_OPENMP/100000)%10)), 7 | ('0' + ((_OPENMP/10000)%10)), 8 | ('0' + ((_OPENMP/1000)%10)), 9 | ('0' + ((_OPENMP/100)%10)), 10 | ('0' + ((_OPENMP/10)%10)), 11 | ('0' + ((_OPENMP/1)%10)), 12 | ']', '\0' }; 13 | int main() 14 | { 15 | puts(ompver_str); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/OpenMPTryFlag.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | int main() { 4 | #ifdef _OPENMP 5 | return 0; 6 | #else 7 | breaks_on_purpose 8 | #endif 9 | } 10 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/OpenMPTryFlag.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | int main() { 4 | #ifdef _OPENMP 5 | return 0; 6 | #else 7 | breaks_on_purpose 8 | #endif 9 | } 10 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/ompver_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/FindOpenMP/ompver_C.bin -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/FindOpenMP/ompver_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/FindOpenMP/ompver_CXX.bin -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/install/strip.dir 2 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/install/local.dir 3 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/lightgbm.dir 4 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/_lightgbm.dir 5 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/edit_cache.dir 6 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/rebuild_cache.dir 7 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/list_install_components.dir 8 | /home/yingzhenzhe/lightgbm_mgbm/python-package/build_cpp/CMakeFiles/install.dir 9 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -fopenmp -std=c++11 -pthread -O3 -Wextra -Wall -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-return-type -fPIC -funroll-loops -fPIC 6 | 7 | CXX_DEFINES = -DUSE_SOCKET -D_lightgbm_EXPORTS 8 | 9 | CXX_INCLUDES = -I/home/yingzhenzhe/lightgbm_mgbm/python-package/compile/include 10 | 11 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | CMAKE_PROGRESS_3 = 3 4 | CMAKE_PROGRESS_4 = 4 5 | CMAKE_PROGRESS_5 = 5 6 | CMAKE_PROGRESS_6 = 6 7 | CMAKE_PROGRESS_7 = 7 8 | CMAKE_PROGRESS_8 = 8 9 | CMAKE_PROGRESS_9 = 9 10 | CMAKE_PROGRESS_10 = 10 11 | CMAKE_PROGRESS_11 = 11 12 | CMAKE_PROGRESS_12 = 12 13 | CMAKE_PROGRESS_13 = 13 14 | CMAKE_PROGRESS_14 = 14 15 | CMAKE_PROGRESS_15 = 15 16 | CMAKE_PROGRESS_16 = 16 17 | CMAKE_PROGRESS_17 = 17 18 | CMAKE_PROGRESS_18 = 18 19 | CMAKE_PROGRESS_19 = 19 20 | CMAKE_PROGRESS_20 = 20 21 | CMAKE_PROGRESS_21 = 21 22 | CMAKE_PROGRESS_22 = 22 23 | CMAKE_PROGRESS_23 = 23 24 | CMAKE_PROGRESS_24 = 24 25 | CMAKE_PROGRESS_25 = 25 26 | CMAKE_PROGRESS_26 = 26 27 | CMAKE_PROGRESS_27 = 27 28 | CMAKE_PROGRESS_28 = 28 29 | CMAKE_PROGRESS_29 = 29 30 | CMAKE_PROGRESS_30 = 30 31 | CMAKE_PROGRESS_31 = 31 32 | CMAKE_PROGRESS_32 = 32 33 | CMAKE_PROGRESS_33 = 33 34 | 35 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/application/application.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/application/application.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/boosting.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/boosting.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt_model_text.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt_model_text.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt_prediction.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/gbdt_prediction.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/prediction_early_stop.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/boosting/prediction_early_stop.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/c_api.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/c_api.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/bin.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/bin.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/config.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/config.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/config_auto.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/config_auto.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/dataset.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/dataset.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/dataset_loader.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/dataset_loader.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/file_io.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/file_io.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/json11.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/json11.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/metadata.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/metadata.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/parser.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/parser.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/tree.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/io/tree.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/lightgbm_R.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/lightgbm_R.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/metric/dcg_calculator.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/metric/dcg_calculator.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/metric/metric.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/metric/metric.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linker_topo.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linker_topo.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linkers_mpi.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linkers_mpi.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linkers_socket.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/linkers_socket.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/network.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/network/network.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/objective/objective_function.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/objective/objective_function.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/data_parallel_tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/data_parallel_tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/feature_parallel_tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/feature_parallel_tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/gpu_tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/gpu_tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/serial_tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/serial_tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/serial_tree_learner2.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/serial_tree_learner2.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/voting_parallel_tree_learner.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/_lightgbm.dir/src/treelearner/voting_parallel_tree_learner.cpp.o -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/feature_tests.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/build_cpp/CMakeFiles/feature_tests.bin -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/feature_tests.c: -------------------------------------------------------------------------------- 1 | 2 | const char features[] = {"\n" 3 | "C_FEATURE:" 4 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 5 | "1" 6 | #else 7 | "0" 8 | #endif 9 | "c_function_prototypes\n" 10 | "C_FEATURE:" 11 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 12 | "1" 13 | #else 14 | "0" 15 | #endif 16 | "c_restrict\n" 17 | "C_FEATURE:" 18 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L 19 | "1" 20 | #else 21 | "0" 22 | #endif 23 | "c_static_assert\n" 24 | "C_FEATURE:" 25 | #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 26 | "1" 27 | #else 28 | "0" 29 | #endif 30 | "c_variadic_macros\n" 31 | 32 | }; 33 | 34 | int main(int argc, char** argv) { (void)argv; return features[argc]; } 35 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/lightgbm.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for lightgbm. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/lightgbm.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.10 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_FLAGS = -fopenmp -std=c++11 -pthread -O3 -Wextra -Wall -Wno-ignored-attributes -Wno-unknown-pragmas -Wno-return-type -fPIC -funroll-loops 6 | 7 | CXX_DEFINES = -DUSE_SOCKET 8 | 9 | CXX_INCLUDES = -I/home/yingzhenzhe/lightgbm_mgbm/python-package/compile/include 10 | 11 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/lightgbm.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 34 2 | CMAKE_PROGRESS_2 = 35 3 | CMAKE_PROGRESS_3 = 36 4 | CMAKE_PROGRESS_4 = 37 5 | CMAKE_PROGRESS_5 = 38 6 | CMAKE_PROGRESS_6 = 39 7 | CMAKE_PROGRESS_7 = 40 8 | CMAKE_PROGRESS_8 = 41 9 | CMAKE_PROGRESS_9 = 42 10 | CMAKE_PROGRESS_10 = 43 11 | CMAKE_PROGRESS_11 = 44 12 | CMAKE_PROGRESS_12 = 45 13 | CMAKE_PROGRESS_13 = 46 14 | CMAKE_PROGRESS_14 = 47 15 | CMAKE_PROGRESS_15 = 48 16 | CMAKE_PROGRESS_16 = 49 17 | CMAKE_PROGRESS_17 = 50 18 | CMAKE_PROGRESS_18 = 51 19 | CMAKE_PROGRESS_19 = 52 20 | CMAKE_PROGRESS_20 = 53 21 | CMAKE_PROGRESS_21 = 54 22 | CMAKE_PROGRESS_22 = 55 23 | CMAKE_PROGRESS_23 = 56 24 | CMAKE_PROGRESS_24 = 57 25 | CMAKE_PROGRESS_25 = 58 26 | CMAKE_PROGRESS_26 = 59 27 | CMAKE_PROGRESS_27 = 60 28 | CMAKE_PROGRESS_28 = 61 29 | CMAKE_PROGRESS_29 = 62 30 | CMAKE_PROGRESS_30 = 63 31 | CMAKE_PROGRESS_31 = 64 32 | CMAKE_PROGRESS_32 = 65 33 | 34 | -------------------------------------------------------------------------------- /python-package/build_cpp/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 65 2 | -------------------------------------------------------------------------------- /python-package/compile/include/LightGBM/export.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2017 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #ifndef LIGHTGBM_EXPORT_H_ 6 | #define LIGHTGBM_EXPORT_H_ 7 | 8 | /** Macros for exporting symbols in MSVC/GCC/CLANG **/ 9 | 10 | #ifdef __cplusplus 11 | #define LIGHTGBM_EXTERN_C extern "C" 12 | #else 13 | #define LIGHTGBM_EXTERN_C 14 | #endif 15 | 16 | 17 | #ifdef _MSC_VER 18 | #define LIGHTGBM_EXPORT __declspec(dllexport) 19 | #define LIGHTGBM_C_EXPORT LIGHTGBM_EXTERN_C __declspec(dllexport) 20 | #else 21 | #define LIGHTGBM_EXPORT 22 | #define LIGHTGBM_C_EXPORT LIGHTGBM_EXTERN_C 23 | #endif 24 | 25 | #endif /** LIGHTGBM_EXPORT_H_ **/ 26 | -------------------------------------------------------------------------------- /python-package/compile/include/LightGBM/prediction_early_stop.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2017 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #ifndef LIGHTGBM_PREDICTION_EARLY_STOP_H_ 6 | #define LIGHTGBM_PREDICTION_EARLY_STOP_H_ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace LightGBM { 14 | 15 | struct PredictionEarlyStopInstance { 16 | /// Callback function type for early stopping. 17 | /// Takes current prediction and number of elements in prediction 18 | /// @returns true if prediction should stop according to criterion 19 | using FunctionType = std::function; 20 | 21 | FunctionType callback_function; // callback function itself 22 | int round_period; // call callback_function every `runPeriod` iterations 23 | }; 24 | 25 | struct PredictionEarlyStopConfig { 26 | int round_period; 27 | double margin_threshold; 28 | }; 29 | 30 | /// Create an early stopping algorithm of type `type`, with given round_period and margin threshold 31 | LIGHTGBM_EXPORT PredictionEarlyStopInstance CreatePredictionEarlyStopInstance(const std::string& type, 32 | const PredictionEarlyStopConfig& config); 33 | 34 | } // namespace LightGBM 35 | 36 | #endif // LIGHTGBM_PREDICTION_EARLY_STOP_H_ 37 | -------------------------------------------------------------------------------- /python-package/compile/lib_lightgbm.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/compile/lib_lightgbm.so -------------------------------------------------------------------------------- /python-package/compile/src/main.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2016 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #include 6 | #include "network/linkers.h" 7 | 8 | #include 9 | 10 | int main(int argc, char** argv) { 11 | bool success = false; 12 | try { 13 | LightGBM::Application app(argc, argv); 14 | app.Run(); 15 | 16 | #ifdef USE_MPI 17 | LightGBM::Linkers::MpiFinalizeIfIsParallel(); 18 | #endif 19 | 20 | success = true; 21 | } 22 | catch (const std::exception& ex) { 23 | std::cerr << "Met Exceptions:" << std::endl; 24 | std::cerr << ex.what() << std::endl; 25 | } 26 | catch (const std::string& ex) { 27 | std::cerr << "Met Exceptions:" << std::endl; 28 | std::cerr << ex << std::endl; 29 | } 30 | catch (...) { 31 | std::cerr << "Unknown Exceptions" << std::endl; 32 | } 33 | 34 | if (!success) { 35 | #ifdef USE_MPI 36 | LightGBM::Linkers::MpiAbortIfIsParallel(); 37 | #endif 38 | 39 | exit(-1); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /python-package/lightgbmmt.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /python-package/lightgbmmt.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /python-package/lightgbmmt.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | scipy 3 | scikit-learn 4 | -------------------------------------------------------------------------------- /python-package/lightgbmmt.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | lightgbmmt 2 | -------------------------------------------------------------------------------- /python-package/lightgbmmt/VERSION.txt: -------------------------------------------------------------------------------- 1 | 2.3.2 2 | -------------------------------------------------------------------------------- /python-package/lightgbmmt/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | """LightGBM, Light Gradient Boosting Machine. 3 | 4 | Contributors: https://github.com/microsoft/LightGBM/graphs/contributors. 5 | """ 6 | from __future__ import absolute_import 7 | 8 | from .basic import Booster, Dataset 9 | from .callback import (early_stopping, print_evaluation, record_evaluation, 10 | reset_parameter) 11 | from .engine import cv, train 12 | 13 | import os 14 | 15 | try: 16 | from .sklearn import LGBMModel, LGBMRegressor, LGBMClassifier, LGBMRanker 17 | except ImportError: 18 | pass 19 | try: 20 | from .plotting import (plot_importance, plot_split_value_histogram, plot_metric, 21 | plot_tree, create_tree_digraph) 22 | except ImportError: 23 | pass 24 | 25 | 26 | dir_path = os.path.dirname(os.path.realpath(__file__)) 27 | 28 | if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')): 29 | with open(os.path.join(dir_path, 'VERSION.txt')) as version_file: 30 | __version__ = version_file.read().strip() 31 | 32 | __all__ = ['Dataset', 'Booster', 33 | 'train', 'cv', 34 | 'LGBMModel', 'LGBMRegressor', 'LGBMClassifier', 'LGBMRanker', 35 | 'print_evaluation', 'record_evaluation', 'reset_parameter', 'early_stopping', 36 | 'plot_importance', 'plot_split_value_histogram', 'plot_metric', 'plot_tree', 'create_tree_digraph'] 37 | -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/basic.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/basic.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/basic.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/basic.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/callback.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/callback.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/callback.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/callback.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/compat.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/compat.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/compat.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/compat.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/engine.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/engine.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/engine.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/engine.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/libpath.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/libpath.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/libpath.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/libpath.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/plotting.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/plotting.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/plotting.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/plotting.cpython-38.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/sklearn.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/sklearn.cpython-36.pyc -------------------------------------------------------------------------------- /python-package/lightgbmmt/__pycache__/sklearn.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antmachineintelligence/mtgbmcode/3dda8af60f1abe772a951d88499739c5f9ecd17d/python-package/lightgbmmt/__pycache__/sklearn.cpython-38.pyc -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2016 Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See LICENSE file in the project root for license information. 4 | */ 5 | #include 6 | #include "network/linkers.h" 7 | 8 | #include 9 | 10 | int main(int argc, char** argv) { 11 | bool success = false; 12 | try { 13 | LightGBM::Application app(argc, argv); 14 | app.Run(); 15 | 16 | #ifdef USE_MPI 17 | LightGBM::Linkers::MpiFinalizeIfIsParallel(); 18 | #endif 19 | 20 | success = true; 21 | } 22 | catch (const std::exception& ex) { 23 | std::cerr << "Met Exceptions:" << std::endl; 24 | std::cerr << ex.what() << std::endl; 25 | } 26 | catch (const std::string& ex) { 27 | std::cerr << "Met Exceptions:" << std::endl; 28 | std::cerr << ex << std::endl; 29 | } 30 | catch (...) { 31 | std::cerr << "Unknown Exceptions" << std::endl; 32 | } 33 | 34 | if (!success) { 35 | #ifdef USE_MPI 36 | LightGBM::Linkers::MpiAbortIfIsParallel(); 37 | #endif 38 | 39 | exit(-1); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/cpp_test/predict.conf: -------------------------------------------------------------------------------- 1 | data=../data/categorical.data 2 | 3 | input_model=LightGBM_model.txt 4 | 5 | task=predict 6 | -------------------------------------------------------------------------------- /tests/cpp_test/test.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | import glob 3 | import numpy as np 4 | 5 | preds = [np.loadtxt(name) for name in glob.glob('*.pred')] 6 | np.testing.assert_allclose(preds[0], preds[1]) 7 | -------------------------------------------------------------------------------- /tests/cpp_test/train.conf: -------------------------------------------------------------------------------- 1 | data=../data/categorical.data 2 | 3 | app=binary 4 | 5 | num_trees=10 6 | 7 | categorical_column=0,1,4,5,6 8 | --------------------------------------------------------------------------------