### Install Pangolin to a Custom Location Source: https://github.com/c3sr/pangolin/blob/master/README.md Clones Pangolin, builds it with a specified installation prefix, and installs it. This is the first step for using Pangolin as an external library. ```bash git clone https://github.com/c3sr/pangolin.git mkdir pangolin/build && cd pangolin/build cmake .. -DCMAKE_INSTALL_PREFIX= make install ``` -------------------------------- ### Install Doxygen and Graphviz Source: https://github.com/c3sr/pangolin/blob/master/README.md Installs Doxygen and Graphviz on Ubuntu/Debian systems for generating API documentation. This is an optional step. ```bash sudo apt install doxygen graphviz ``` -------------------------------- ### Add Main Test Suite Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_test` to define the main test suite, including multiple CUDA source files. ```cmake pangolin_add_test( NAME test_main SRCS test_main.cu test_array_view.cu test_search.cu test_bmtx_stream.cu test_complete.cu test_double_buffer.cu test_generator_hubspoke.cu test_merge_path.cu test_numa.cu test_single_header.cu ) ``` -------------------------------- ### Initialize Pangolin Library Source: https://github.com/c3sr/pangolin/blob/master/README.md Include the necessary Pangolin headers and call `pangolin::init()` before using the library's functionalities. This is a basic setup for C++ applications. ```c++ #include "pangolin.hpp" #include "pangolin.cuh" int main(int argc, char **argv) { pangolin::init(); // your code here. } ``` -------------------------------- ### Install Java 8 for Nsight Eclipse Edition Source: https://github.com/c3sr/pangolin/blob/master/README.md On Ubuntu 18.04, install Java 8 JRE to resolve potential conflicts with the default Java runtime. This is a prerequisite for running Nsight Eclipse Edition. ```bash sudo apt install openjdk-8-jre ``` -------------------------------- ### Add GPU Test: Load Balance Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for load balancing, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_load_balance SRCS test_load_balance.cu ) ``` -------------------------------- ### Add GPU Test: Zero Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for zero-related operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_zero SRCS test_zero.cu ) ``` -------------------------------- ### Add GPU Test: Buffer Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for buffer operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_buffer SRCS test_buffer.cu ) ``` -------------------------------- ### Add GPU Test: Topology Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for topology-related operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_topology SRCS test_topology.cu ) ``` -------------------------------- ### Add GPU Test: Broadcast Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for broadcast functionality, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_broadcast SRCS test_broadcast.cu ) ``` -------------------------------- ### Add GPU Test: Logger Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for the logger functionality, including both the main CUDA file and a helper file. ```cmake pangolin_add_gpu_test( NAME test_logger SRCS test_logger.cu test_logger_helper.cu ) ``` -------------------------------- ### Add GPU Test: Vector Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for vector operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_vector SRCS test_vector.cu ) ``` -------------------------------- ### Add GPU Test: Count Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for count operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_count SRCS test_count.cu ) ``` -------------------------------- ### Configure Nsight Eclipse Edition Java Path Source: https://github.com/c3sr/pangolin/blob/master/README.md Add the path to the Java 8 runtime to the `nsight.ini` file to ensure Nsight Eclipse Edition uses the correct Java version. This is necessary after installing Java 8. ```bash -vm /usr/lib/jvm/java-8-openjdk-amd64/jre/bin ``` -------------------------------- ### Add GPU Test: Device Buffer Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for device buffer operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_device_buffer SRCS test_device_buffer.cu ) ``` -------------------------------- ### Add GPU Test: Device Vector Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for device vector operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_device_vector SRCS test_device_vector.cu ) ``` -------------------------------- ### Add GPU Test: TC Bissonfatica18 Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test related to the Bisson-Fatica 2018 algorithm, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_bissonfatica18 SRCS test_tc_bissonfatica18.cu ) ``` -------------------------------- ### Integrate Pangolin as an External Library in CMake Source: https://github.com/c3sr/pangolin/blob/master/README.md Configures your CMake project to find the installed Pangolin library using CMAKE_PREFIX_PATH and links against the pangolin::pangolin target. ```cmake # CMakeLists.txt find_package(pangolin CONFIG REQUIRED) ... target_link_libraries(... pangolin::pangolin) ``` -------------------------------- ### Add GPU Test: TC Anjur Iyer Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test related to the Anjur-Iyer algorithm, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_anjur_iyer SRCS test_tc_anjur_iyer.cu ) ``` -------------------------------- ### Add GPU Test: Load Balance GPU Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test specifically for GPU-accelerated load balancing, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_load_balance_gpu SRCS test_load_balance_gpu.cu ) ``` -------------------------------- ### Add MPI GPU Test: MPI Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_mpi_gpu_test` to define a test that requires both MPI and GPU, specifying its CUDA source file. ```cmake pangolin_add_mpi_gpu_test( NAME test-mpi SRCS test_mpi.cu ) ``` -------------------------------- ### Add GPU Test: TC Vertex Dyn Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for dynamic vertex processing, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_vertex_dyn SRCS test_tc_vertex_dyn.cu ) ``` -------------------------------- ### Get Git Revision Description Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Retrieves the Git revision description and hash, and checks for local changes. This information is useful for build versioning. ```cmake include("${CMAKE_CURRENT_LIST_DIR}/cmake/GetGitRevisionDescription.cmake") get_git_head_revision(GIT_REFSPEC GIT_HASH) git_local_changes(GIT_LOCAL_CHANGES) message(STATUS GIT_REFSPEC=${GIT_REFSPEC}) message(STATUS GIT_HASH=${GIT_HASH}) message(STATUS GIT_LOCAL_CHANGES=${GIT_LOCAL_CHANGES}) ``` -------------------------------- ### Add GPU Test: CSR Binned Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for binned CSR operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_csr_binned SRCS test_csr_binned.cu ) ``` -------------------------------- ### Add GPU Test: TC Edge Binary Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for binary edge processing, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_edge_binary SRCS test_tc_edge_binary.cu ) ``` -------------------------------- ### Add GPU Test: RC Stream Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for RC stream operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_rc_stream SRCS test_rc_stream.cu ) ``` -------------------------------- ### Add GPU Test: CSR Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for CSR (Compressed Sparse Row) format, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_csr SRCS test_csr.cu ) ``` -------------------------------- ### Add GPU Test: CSR Value Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for CSR value operations, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_csr_val SRCS test_csr_val.cu ) ``` -------------------------------- ### Add GPU Test: TC Edge Merge Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for merging edge data, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_edge_merge SRCS test_tc_edge_merge.cu ) ``` -------------------------------- ### Add GPU Test: TC Vertex Blocks Binary Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for vertex processing using multiple binary blocks, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_vertex_blocks_binary SRCS test_tc_vertex_blocks_binary.cu ) ``` -------------------------------- ### Add GPU Test: TC Vertex Block Binary Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for vertex processing using binary blocks, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_vertex_block_binary SRCS test_tc_vertex_block_binary.cu ) ``` -------------------------------- ### Add GPU Test: CSR COO Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for CSR to COO (Coordinate List) conversion, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_csr_coo SRCS test_csr_coo.cu ) ``` -------------------------------- ### Add GPU Test: TC Edge Linear Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for linear edge processing, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_edge_linear SRCS test_tc_edge_linear.cu ) ``` -------------------------------- ### Add GPU Test: TC Edge Warp Dyn Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for dynamic edge processing using warps, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_edge_warp_dyn SRCS test_tc_edge_warp_dyn.cu ) ``` -------------------------------- ### Add GPU Test: TC Vertex Blocks Cache Block Binary Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for vertex processing using cached binary blocks, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_vertex_blocks_cache_block_binary SRCS test_tc_vertex_blocks_cache_block_binary.cu ) ``` -------------------------------- ### Add GPU Test: TC Vertex Bitvector Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for vertex processing using bitvectors, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_vertex_bitvector SRCS test_tc_vertex_bitvector.cu ) ``` -------------------------------- ### Add GPU Test: TC Edge Warp Dysel Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt Example of using `pangolin_add_gpu_test` to define a test for edge processing using warps and dynamic selection, specifying its CUDA source file. ```cmake pangolin_add_gpu_test( NAME test_tc_edge_warp_dysel SRCS test_tc_edge_warp_dysel.cu ) ``` -------------------------------- ### Build and Test Pangolin Source: https://github.com/c3sr/pangolin/blob/master/README.md Standard build and test commands for the Pangolin library using Make. Ensure you are in the build directory. ```shell mkdir -p build && cd build make make test ``` -------------------------------- ### Build Pangolin Tests on Ubuntu/Debian Source: https://github.com/c3sr/pangolin/blob/master/README.md Builds the Pangolin library and its tests. This involves creating a build directory, navigating into it, and then running CMake and make commands. ```bash mkdir -p build cd build cmake .. make make tests ``` -------------------------------- ### Run Pangolin Tests Source: https://github.com/c3sr/pangolin/blob/master/README.md Builds and runs all tests for Pangolin. Some tests may require a GPU or MPI. ```bash make make test ``` -------------------------------- ### Generate Non-interactive Detailed Profile with Nsight Compute CLI Source: https://github.com/c3sr/pangolin/blob/master/README.md Utilize the Nsight Compute command-line interface (CLI) to generate a detailed performance profile. The output file can be opened in the NVIDIA Nsight Compute GUI. ```bash /usr/local/cuda/NsightCompute-1.0/nv-nsight-cu-cli -o ./my-binary ``` -------------------------------- ### BibTeX Entry for 'Update on k-truss Decomposition on GPU' Source: https://github.com/c3sr/pangolin/blob/master/README.md A BibTeX entry for a publication detailing k-truss decomposition on GPUs. ```bibtex @INPROCEEDINGS{8916285, author={M. {Almasri} and O. {Anjum} and C. {Pearson} and Z. {Qureshi} and V. S. {Mailthody} and R. {Nagi} and J. {Xiong} and W. {Hwu}}, booktitle={2019 IEEE High Performance Extreme Computing Conference (HPEC)}, title={Update on k-truss Decomposition on GPU}, year={2019}, volume={}, number={}, pages={1-7}, } ``` -------------------------------- ### Add System and Interface Include Directories Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Specifies system and interface include directories for the pangolin target. SYSTEM ensures these are not treated as user include directories, while INTERFACE applies to targets that link to pangolin. ```cmake target_include_directories(pangolin SYSTEM INTERFACE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) target_include_directories(pangolin INTERFACE $ $ ) ``` -------------------------------- ### Non-interactive Profiling with nvprof (CC <= 7.2) Source: https://github.com/c3sr/pangolin/blob/master/README.md Generates timeline and metrics profiling files using nvprof for GPUs with Compute Capability less than or equal to 7.2. These files can be opened in nvvp. ```bash nvprof -o timeline.nvvp -f ./ ... nvprof -o metrics.nvvp -f --analysis-metrics ./ ``` -------------------------------- ### Generate Nsight Compute CLI Report Source: https://github.com/c3sr/pangolin/blob/master/README.md Generates a profiling report using the Nsight Compute CLI for GPUs with Compute Capability greater than 7.2. The report can be opened in NVIDIA Nsight Compute. ```bash /usr/local/cuda/NsightCompute-1.0/nv-nsight-cu-cli -o profile -f ... ``` -------------------------------- ### BibTeX Entry for 'Collaborative (CPU + GPU) Algorithms for Triangle Counting and Truss Decomposition' Source: https://github.com/c3sr/pangolin/blob/master/README.md A BibTeX entry for a publication on collaborative CPU+GPU algorithms for triangle counting and truss decomposition. ```bibtex @INPROCEEDINGS{8547517, author={V. S. {Mailthody} and K. {Date} and Z. {Qureshi} and C. {Pearson} and R. {Nagi} and J. {Xiong} and W. {Hwu}}, booktitle={2018 IEEE High Performance extreme Computing Conference (HPEC)}, title={Collaborative (CPU + GPU) Algorithms for Triangle Counting and Truss Decomposition}, year={2018}, volume={}, number={}, pages={1-7}, } ``` -------------------------------- ### Run Individual Pangolin Test Source: https://github.com/c3sr/pangolin/blob/master/README.md Builds Pangolin and then runs a specific test executable, such as test_csr. ```bash make test/test_csr ``` -------------------------------- ### Enable Testing and Add Test Subdirectory Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Enables testing infrastructure for the project using CTest and includes tests from a subdirectory. This command should be placed at the root of the source directory. ```cmake enable_testing() # "this command should be in the source directory root for CTest to find the test file" add_subdirectory(test) ``` -------------------------------- ### Project Options Configuration Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Defines boolean options for the project, allowing users to enable or disable features like Hunter, OpenMP, NUMA, and CUSparse support during configuration. ```cmake option(USE_HUNTER "Turn on to enable using the hunter package manager" ON) option(USE_OPENMP "compile with OpenMP support" ON) option(USE_NUMA "compile with NUMA support" ON) option(USE_CUSPARSE "compile with CUSparse" ON) ``` -------------------------------- ### Configure Build Type Specific Definitions and Verbosity Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Sets specific compile definitions and enables verbose build output for Debug builds. Release builds define NDEBUG and enable SPDLOG_DEBUG_ON. ```cmake if (CMAKE_BUILD_TYPE MATCHES Debug) message(STATUS "Setting verbose build during Debug") set(CMAKE_VERBOSE_MAKEFILE ON) target_compile_definitions(pangolin INTERFACE -DSPDLOG_TRACE_ON) target_compile_definitions(pangolin INTERFACE -DSPDLOG_DEBUG_ON) elseif (CMAKE_BUILD_TYPE MATCHES Release) target_compile_definitions(pangolin INTERFACE -DNDEBUG) target_compile_definitions(pangolin INTERFACE -DSPDLOG_DEBUG_ON) endif() ``` -------------------------------- ### Set Build Configuration Options Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Configures build-related settings such as exporting compile commands and enabling colored output for the Makefile generator. ```cmake set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_COLOR_MAKEFILE ON) set_property(GLOBAL PROPERTY USE_FOLDERS OFF) ``` -------------------------------- ### Add and Find spdlog Package Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Adds the 'spdlog' package using Hunter if USE_HUNTER is enabled, and then finds the package configuration. This makes the spdlog library available for use. ```cmake if(USE_HUNTER) hunter_add_package(spdlog) endif() find_package(spdlog CONFIG REQUIRED) ``` -------------------------------- ### BibTeX Entry for 'Update on Triangle Counting on GPU' Source: https://github.com/c3sr/pangolin/blob/master/README.md A BibTeX entry for a publication discussing triangle counting on GPUs. ```bibtex @INPROCEEDINGS{8916547, author={C. {Pearson} and M. {Almasri} and O. {Anjum} and V. S. {Mailthody} and Z. {Qureshi} and R. {Nagi} and J. {Xiong} and W. {Hwu}}, booktitle={2019 IEEE High Performance Extreme Computing Conference (HPEC)}, title={Update on Triangle Counting on GPU}, year={2019}, volume={}, number={}, pages={1-7}, } ``` -------------------------------- ### Add and Find fmt Package Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Adds the 'fmt' package using Hunter if USE_HUNTER is enabled, and then finds the package configuration. This makes the fmt library available for use. ```cmake if(USE_HUNTER) hunter_add_package(fmt) endif() find_package(fmt CONFIG REQUIRED) ``` -------------------------------- ### Add Doxygen Documentation Target Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Configures a custom target 'docs' to generate API documentation using Doxygen. It requires Doxygen to be found and uses a Doxyfile template. ```cmake find_package(Doxygen) if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) add_custom_target(docs ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation with Doxygen" VERBATIM ) # install docs if they exist install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/ DESTINATION docs COMPONENT docs OPTIONAL ) endif(DOXYGEN_FOUND) ``` -------------------------------- ### Project Definition and Version Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Defines the project name, supported languages (C++, CUDA), and its version. The version is set to 0.1.0.0. ```cmake project(pangolin LANGUAGES CXX CUDA VERSION 0.1.0.0) ``` -------------------------------- ### Generate Non-interactive Timeline with nvprof Source: https://github.com/c3sr/pangolin/blob/master/README.md Use the `nvprof` command-line tool to generate a timeline profiling file. This file can later be imported into Nsight Eclipse Edition for analysis. ```bash nvprof -o timeline.nvvp -f ./mybin ``` -------------------------------- ### Add Build Interface Include Directory Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Adds an include directory that is only relevant during the build process. This is typically used for generated header files. ```cmake target_include_directories(pangolin INTERFACE $ $ ) ``` -------------------------------- ### Add and Find cub Package Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Adds the 'cub' package using Hunter if USE_HUNTER is enabled, and then finds the package configuration. This makes the cub library available for use. ```cmake if(USE_HUNTER) hunter_add_package(cub) endif() find_package(cub CONFIG REQUIRED) ``` -------------------------------- ### Add Pangolin Interface Library Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Creates an interface library target named 'pangolin' and an alias 'pangolin::pangolin'. This allows other targets to easily link against Pangolin headers. ```cmake add_library(pangolin INTERFACE) add_library(pangolin::pangolin ALIAS pangolin) ``` -------------------------------- ### Define Pangolin C++ Headers Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Lists the C++ header files for the Pangolin library. These are used to build the interface library. ```cmake set(PANGOLIN_CPP_HEADERS include/pangolin/bounded_buffer.hpp include/pangolin/config.hpp include/pangolin/cusparse.hpp include/pangolin/dag_lowertriangular_csr.hpp include/pangolin/edge.hpp include/pangolin/init.hpp include/pangolin/logger.hpp include/pangolin/numa.hpp include/pangolin/pangolin.hpp include/pangolin/par_graph.hpp include/pangolin/utilities.hpp include/pangolin/allocator/cuda_managed.hpp include/pangolin/allocator/cuda_zero_copy.hpp include/pangolin/dense/cuda_managed_vector.hpp include/pangolin/dense/cuda_zero_copy_vector.hpp include/pangolin/file/edge_list_file.hpp include/pangolin/generator/complete.hpp include/pangolin/sparse/gpu_csr.hpp include/pangolin/sparse/gpu_csr-impl.hpp include/pangolin/sparse/csr_coo.hpp include/pangolin/sparse/coo-impl.hpp include/pangolin/sparse/unified_memory_csr.hpp include/pangolin/reader/bel_reader.hpp include/pangolin/reader/edge_list_reader.hpp include/pangolin/reader/gc_tsv_reader.hpp ) ``` -------------------------------- ### Run Pangolin MPI Tests Source: https://github.com/c3sr/pangolin/blob/master/README.md Runs tests that require MPI using ctest with the -L "mpi" flag. ```bash ctest -L "mpi" ``` -------------------------------- ### Set Minimum CMake Version Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Specifies the minimum required version of CMake for the project. It will exit with an error if the version is insufficient. ```cmake cmake_minimum_required(VERSION 3.13 FATAL_ERROR) ``` -------------------------------- ### Set C++ Standard Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Requests that the pangolin target and any dependent targets be built with the C++11 standard. This ensures consistent language features across the project. ```cmake target_compile_features(pangolin INTERFACE cxx_std_11) ``` -------------------------------- ### Define Pangolin CUDA Headers Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Lists the CUDA header files for the Pangolin library. These are used in conjunction with C++ headers for CUDA-enabled features. ```cmake set(PANGOLIN_CU_HEADERS include/pangolin/atomic_add.cuh include/pangolin/sparse/cusparse_csr.hu include/pangolin/dense/vector.cuh include/pangolin/dense/vector-impl.hu ) ``` -------------------------------- ### Define a Pangolin GPU Test Target Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt This function extends `pangolin_add_test` to specifically define GPU test targets. It adds the 'gpu' label to the test properties. ```cmake function(pangolin_add_gpu_test) cmake_parse_arguments( PARSED_ARGS # prefix of output variables "" # list of names of boolean arguments "NAME" # list of names of mono-valued arguments "SRCS" # list of names of nuluti-valued arguments ${ARGN} # arguments of the function to parse ) pangolin_add_test(${ARGN}) set_tests_properties(${PARSED_ARGS_NAME} PROPERTIES LABELS "gpu") endfunction() ``` -------------------------------- ### Conditional Linking and Definitions for CUSPARSE Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Conditionally adds definitions and links the cusparse library if the USE_CUSPARSE flag is enabled. This allows for optional CUDA sparse matrix support. ```cmake if (USE_CUSPARSE) target_compile_definitions(pangolin INTERFACE -DPANGOLIN_USE_CUSPARSE=1) target_link_libraries(pangolin INTERFACE cusparse) endif() ``` -------------------------------- ### Add CXX Target Compile Options Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Applies standard C++ compile options to the Pangolin target. These include a comprehensive set of warnings for better code quality. ```cmake target_compile_options( pangolin INTERFACE $<\: -Wall; -Wextra; -Wcast-align; -Wstrict-aliasing; -Wpointer-arith; -Winit-self; -Wswitch-enum; -Wfloat-equal; -Wundef; -Wvla; -Wshadow; -Wformat=2; -Wconversion; -Wpedantic; > ) ``` -------------------------------- ### Add Pangolin as a Git Submodule Source: https://github.com/c3sr/pangolin/blob/master/README.md Adds Pangolin as a git submodule to your project and checks out a specific commit or branch. This is the first step for using Pangolin as a subdirectory. ```bash git submodule add https://github.com/c3sr/pangolin.git thirdparty/pangolin cd thirdparty/pangolin git checkout ``` -------------------------------- ### Integrate Pangolin as a Subdirectory in CMake Source: https://github.com/c3sr/pangolin/blob/master/README.md Includes Pangolin as a subdirectory in your CMake project and links against the pangolin::pangolin32 target. This is used after adding Pangolin as a git submodule. ```cmake # CMakeLists.txt add_subdirectory(thirdparty/pangolin) ... target_link_libraries(... pangolin::pangolin32) ``` -------------------------------- ### Find OpenMP Package Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Finds the OpenMP package. This is necessary to enable OpenMP support if the USE_OPENMP option is turned on. ```cmake find_package(OpenMP) ``` -------------------------------- ### Run Pangolin Tests Excluding GPU Source: https://github.com/c3sr/pangolin/blob/master/README.md Runs tests that do not require a GPU using ctest with the -LE "gpu" flag. ```bash ctest -LE "gpu" ``` -------------------------------- ### Find NUMA Package Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Finds the NUMA package if the USE_NUMA option is enabled. This is required for NUMA support. ```cmake if (USE_NUMA) find_package(NUMA) endif(USE_NUMA) ``` -------------------------------- ### Add Custom CMake Module Path Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Adds a custom directory to the CMake module search path, allowing custom modules to be found and included. ```cmake set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) ``` -------------------------------- ### Define a Pangolin Test Target Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt This function defines a test executable target. It parses arguments for name and source files, and conditionally adds the executable based on the project name. It also sets CUDA separable compilation and links against the pangolin library. ```cmake function(pangolin_add_test) cmake_parse_arguments( PARSED_ARGS # prefix of output variables "" # list of names of boolean arguments "NAME" # list of names of mono-valued arguments "SRCS" # list of names of nuluti-valued arguments ${ARGN} # arguments of the function to parse ) # only add tests as targets if we're in the "pangolin" project # if we're included in some other project, don't build tests if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) add_executable(${PARSED_ARGS_NAME} ${PARSED_ARGS_SRCS}) else() add_executable(${PARSED_ARGS_NAME} EXCLUDE_FROM_ALL ${PARSED_ARGS_SRCS}) endif() set_target_properties(${PARSED_ARGS_NAME} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(${PARSED_ARGS_NAME} PUBLIC pangolin::pangolin) # On the NCSA P9 system, CMake won't link C++ targets against CUDA's link directories # maybe the header-only target needs to have the CUDA link language target_link_directories(${PARSED_ARGS_NAME} PUBLIC "${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}") add_test(NAME ${PARSED_ARGS_NAME} COMMAND ${PARSED_ARGS_NAME} -a) endfunction() ``` -------------------------------- ### Link Interface Libraries Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Links various interface libraries to the pangolin target. These libraries are required for targets that depend on pangolin. ```cmake target_link_libraries(pangolin INTERFACE spdlog::spdlog) target_link_libraries(pangolin INTERFACE cub::cub) target_link_libraries(pangolin INTERFACE nvgraph) target_link_libraries(pangolin INTERFACE nvToolsExt) target_link_libraries(pangolin INTERFACE nvidia-ml) ``` -------------------------------- ### Control Pangolin Logging Level Source: https://github.com/c3sr/pangolin/blob/master/README.md Set the logging level for Pangolin to control the verbosity of output. Use this to filter messages based on severity. ```c++ pangolin::logger::set_level(pangolin::logger::Level::ERR) ``` -------------------------------- ### Include Hunter Package Manager Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Includes the Hunter package manager configuration. This is used for managing external dependencies. ```cmake include("${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake") HunterGate( URL "https://github.com/ruslo/hunter/archive/v0.23.115.tar.gz" SHA1 "1b3f3addc801405769edbb7ebbe701223db3efa6" LOCAL ) ``` -------------------------------- ### Add CUDA Target Compile Options Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Applies specific compile options to the Pangolin target when compiling CUDA code. These include warnings and extended lambda support. ```cmake target_compile_options( pangolin INTERFACE $<\: --Wno-deprecated-gpu-targets; --expt-extended-lambda; -Xcompiler=-Wall; -Xcompiler=-Wextra; -Xcompiler=-Wcast-align; -Xcompiler=-Wstrict-aliasing; -Xcompiler=-Wpointer-arith; -Xcompiler=-Winit-self; -Xcompiler=-Wswitch-enum; -Xcompiler=-Wfloat-equal; -Xcompiler=-Wvla; -Xcompiler=-Wshadow; > ) ``` -------------------------------- ### Define a Pangolin MPI GPU Test Target Source: https://github.com/c3sr/pangolin/blob/master/test/CMakeLists.txt This function defines test targets that require both MPI and GPU capabilities. It conditionally adds the test if MPI is found and applies 'gpu' and 'mpi' labels. ```cmake function(pangolin_add_mpi_gpu_test) if (MPI_FOUND) cmake_parse_arguments( PARSED_ARGS # prefix of output variables "" # list of names of boolean arguments "NAME" # list of names of mono-valued arguments "SRCS" # list of names of nuluti-valued arguments ${ARGN} # arguments of the function to parse ) pangolin_add_test(${ARGN}) set_tests_properties(${PARSED_ARGS_NAME} PROPERTIES LABELS "gpu;mpi") endif() endfunction() ``` -------------------------------- ### Set CUDA Compiler Flags Based on Version Source: https://github.com/c3sr/pangolin/blob/master/CMakeLists.txt Configures CUDA compiler flags based on the detected CUDA compiler version. This ensures compatibility and enables specific features for different GPU architectures. ```cmake if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 10) set(CMAKE_CUDA_FLAGS "-arch=compute_35 -code=compute_35,sm_61,sm_70,sm_75") elseif(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 9) set(CMAKE_CUDA_FLAGS "-arch=compute_35 -code=compute_35,sm_61,sm_70") elseif(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 8) set(CMAKE_CUDA_FLAGS "-arch=compute_35 -code=compute_35,sm_61") else() set(CMAKE_CUDA_FLAGS "-arch=compute_35") # -code implicitly is also compute_35 endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.