### Build and Run mallocMC Examples Source: https://github.com/alpaka-group/mallocmc/blob/dev/INSTALL.md Commands to clone, build, and execute the provided example applications. ```bash mkdir -p build ``` ```bash git clone https://github.com/alpaka-group/mallocMC.git ``` ```bash cd build cmake ../mallocMC -DCMAKE_INSTALL_PREFIX=$HOME/libs make examples make install ``` ```bash ./mallocMC_Example01 ``` ```bash ./mallocMC_Example02 ``` ```bash ./VerifyHeap ``` ```bash ./VerifyHeap --help ``` -------------------------------- ### Define Installable Target Source: https://github.com/alpaka-group/mallocmc/blob/dev/CMakeLists.txt Configures the project for installation using the PackageProject module. ```cmake # ---- Create an installable target ---- # this allows users to install and find the library via `find_package()`. # the location where the project's version header will be placed should match the project's regular # header paths string(TOLOWER ${PROJECT_NAME}/version.hpp VERSION_HEADER_LOCATION) packageProject( NAME ${PROJECT_NAME} VERSION ${PROJECT_VERSION} NAMESPACE ${PROJECT_NAME} BINARY_DIR ${PROJECT_BINARY_DIR} INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} VERSION_HEADER "${VERSION_HEADER_LOCATION}" COMPATIBILITY SameMajorVersion ) ``` -------------------------------- ### Install System Dependencies Source: https://github.com/alpaka-group/mallocmc/blob/dev/INSTALL.md Commands to install required build tools on Debian/Ubuntu and Arch Linux systems. ```bash sudo apt-get install gcc build-essential ``` ```bash sudo pacman -S base-devel ``` ```bash sudo apt-get install cmake file cmake-curses-gui ``` ```bash sudo pacman -S cmake ``` ```bash sudo apt-get install git ``` ```bash sudo pacman -S git ``` -------------------------------- ### Initialize Project and Options Source: https://github.com/alpaka-group/mallocmc/blob/dev/CMakeLists.txt Sets the minimum CMake version, project metadata, and defines build options for tests and examples. ```cmake cmake_minimum_required(VERSION 3.14...3.22) # ---- Project ---- project( mallocMC VERSION 3.0.0 LANGUAGES CXX ) # ---- Include guards ---- if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there." ) endif() # ---- Options ---- option(mallocMC_BUILD_TESTING "Turn on/off building the tests" OFF) option(mallocMC_BUILD_EXAMPLES "Turn on/off building the examples" OFF) if (mallocMC_BUILD_TESTING OR mallocMC_BUILD_EXAMPLES) enable_testing() endif() if (mallocMC_BUILD_TESTING) set(alpaka_ACC_CPU_B_SEQ_T_SEQ_ENABLE ON CACHE BOOL "" FORCE) endif() ``` -------------------------------- ### Configure MallocMC Examples with CMake Source: https://github.com/alpaka-group/mallocmc/blob/dev/examples/CMakeLists.txt Defines the project requirements and adds subdirectories for individual examples, with conditional logic for CUDA support. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(Examples LANGUAGES CXX) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/vectorAdd ${CMAKE_BINARY_DIR}/examples/vectorAdd ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/getAvailableSlots ${CMAKE_BINARY_DIR}/examples/getAvailableSlots ) check_language(CUDA) if (CMAKE_CUDA_COMPILER AND alpaka_ACC_GPU_CUDA_ENABLE) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/native-cuda ${CMAKE_BINARY_DIR}/examples/native-cuda ) add_custom_target( mallocMCExamples DEPENDS mallocMCExampleVectorAdd mallocMCExampleGetAvailableSlots mallocMCExampleNativeCuda COMMENT "Shortcut for building all examples." ) else() add_custom_target( mallocMCExamples DEPENDS mallocMCExampleVectorAdd mallocMCExampleGetAvailableSlots COMMENT "Shortcut for building all examples." ) endif() ``` -------------------------------- ### CMake Configuration for Vector Addition Source: https://github.com/alpaka-group/mallocmc/blob/dev/examples/vectorAdd/CMakeLists.txt Defines project requirements, dependencies, and build targets for the vector addition example. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(mallocMCExampleVectorAdd LANGUAGES CXX) # --- Import tools ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/tools.cmake) # ---- Dependencies ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../../cmake/package-lock.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/add_controlled.cmake) add_controlled("alpaka" REQUIRED PREFIX mallocMC) if(NOT TARGET mallocMC) CPMAddPackage(NAME mallocMC SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) endif() # ---- Create standalone executable ---- alpaka_add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/source/main.cpp) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 OUTPUT_NAME ${PROJECT_NAME} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_link_libraries(${PROJECT_NAME} mallocMC::mallocMC alpaka::alpaka) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) ``` -------------------------------- ### Configure CMake Project and Options Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/unit/CMakeLists.txt Sets the minimum CMake version, project name, and defines options for test coverage and installed version testing. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(mallocMCUnitTests LANGUAGES CXX) # ---- Options ---- option(mallocMC_ENABLE_TEST_COVERAGE "Enable test coverage" OFF) option(mallocMC_TEST_INSTALLED_VERSION "Test the version found by find_package" OFF) ``` -------------------------------- ### Enable Testing and Coverage Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/unit/CMakeLists.txt Initializes the testing framework and configures coverage flags if enabled. ```cmake # ---- Add mallocMCTests ---- enable_testing() add_test(${PROJECT_NAME} ${PROJECT_NAME}) # ---- code coverage ---- if(mallocMC_ENABLE_TEST_COVERAGE) target_compile_options(mallocMC INTERFACE -O0 -g -fprofile-arcs -ftest-coverage) target_link_options(mallocMC INTERFACE -fprofile-arcs -ftest-coverage) endif() ``` -------------------------------- ### Create Test Binary Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/unit/CMakeLists.txt Collects source files and defines the executable target with required libraries and C++ standard. ```cmake # ---- Create binary ---- file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp) alpaka_add_executable(${PROJECT_NAME} ${sources}) target_link_libraries(${PROJECT_NAME} mallocMC::mallocMC alpaka::alpaka Catch2::Catch2WithMain) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) ``` -------------------------------- ### Format all code in working copy Source: https://github.com/alpaka-group/mallocmc/blob/dev/CONTRIBUTING.md Use this command in bash to format all .cpp and .hpp files in the current working directory. ```bash find -iname *.cpp -o -iname *.hpp | xargs clang-format -i ``` -------------------------------- ### Download FindmallocMC Module Source: https://github.com/alpaka-group/mallocmc/blob/dev/INSTALL.md Commands to fetch the CMake module for project integration. ```bash wget https://raw.githubusercontent.com/ComputationalRadiationPhysics/cmake-modules/dev/FindmallocMC.cmake # read the documentation cmake -DCMAKE_MODULE_PATH=. --help-module FindmallocMC | less ``` -------------------------------- ### Import Tools and Dependencies Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/unit/CMakeLists.txt Includes necessary CMake modules and manages dependencies using CPM. ```cmake # --- Import tools ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/tools.cmake) # ---- Dependencies ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../../cmake/package-lock.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/add_controlled.cmake) add_controlled("alpaka" REQUIRED PREFIX mallocMC) add_controlled("Catch2" REQUIRED PREFIX mallocMC) if(NOT TARGET mallocMC) if(mallocMC_TEST_INSTALLED_VERSION) find_package(mallocMC REQUIRED) else() CPMAddPackage(NAME mallocMC SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) endif() endif() ``` -------------------------------- ### Instantiate Allocator Source: https://github.com/alpaka-group/mallocmc/blob/dev/Usage.md Create an instance of the defined allocator type by specifying the desired heap size. ```c++ ScatterAllocator sa( 512U * 1024U * 1024U ); // heap size of 512MiB ``` -------------------------------- ### Configure Allocation Policies Source: https://github.com/alpaka-group/mallocmc/blob/dev/Usage.md Inherit from a policy's Properties struct to override default configuration parameters. ```c++ // configure the AlignmentPolicy "Shrink" struct ShrinkConfig : mallocMC::AlignmentPolicies::Shrink<>::Properties { static constexpr auto dataAlignment = 16; }; ``` -------------------------------- ### Configure Library Target Source: https://github.com/alpaka-group/mallocmc/blob/dev/CMakeLists.txt Defines the interface library, sets C++ standards, and configures include directories and link libraries. ```cmake # ---- Create library ---- # Note: for header-only libraries change all PUBLIC flags to INTERFACE and create an interface add_library(${PROJECT_NAME} INTERFACE) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) if(alpaka_ACC_GPU_CUDA_ENABLE) add_controlled("Gallatin") if (TARGET gallatin::gallatin) set(mallocMC_HAS_Gallatin_AVAILABLE YES) else() set(mallocMC_HAS_Gallatin_AVAILABLE NO) endif() # Gallatin needs some fairly recent compute capability from CUDA. # CMake defaults to taking the oldest supported by the device # (https://cmake.org/cmake/help/latest/variable/CMAKE_CUDA_ARCHITECTURES.html) # which can be too old. This leads to compilation errors along the lines of # # error: no instance of overloaded function "atomicCAS" matches the argument list # argument types are: (unsigned short *, unsigned short, unsigned short) # # because this overload was only added later (apparently?). if ("${CMAKE_CUDA_ARCHITECTURES}" LESS 70) message( WARNING "CUDA architecture detected is too old: ${CMAKE_CUDA_ARCHITECTURES}. " "If the architecture set is too old, this can lead to compilation errors with Gallatin. " "If Gallatin is needed, please set CMAKE_CUDA_ARCHITECTURES to the correct value >= 70." ) set(mallocMC_HAS_Gallatin_AVAILABLE NO) endif() if (mallocMC_HAS_Gallatin_AVAILABLE) target_link_libraries(${PROJECT_NAME} INTERFACE gallatin) target_compile_definitions(${PROJECT_NAME} INTERFACE mallocMC_HAS_Gallatin_AVAILABLE) endif() endif() # being a cross-platform target, we enforce standards conformance on MSVC target_compile_options(${PROJECT_NAME} INTERFACE "$<$:/permissive->") target_include_directories( ${PROJECT_NAME} INTERFACE $ $ ) target_link_libraries(${PROJECT_NAME} INTERFACE alpaka::alpaka) if(mallocMC_BUILD_TESTING) include(${CMAKE_CURRENT_LIST_DIR}/cmake/tools.cmake) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/test ${CMAKE_BINARY_DIR}/test) endif() if(mallocMC_BUILD_EXAMPLES) include(${CMAKE_CURRENT_LIST_DIR}/cmake/tools.cmake) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/examples ${CMAKE_BINARY_DIR}/examples) endif() ``` -------------------------------- ### CMake build configuration for getAvailableSlots Source: https://github.com/alpaka-group/mallocmc/blob/dev/examples/getAvailableSlots/CMakeLists.txt Configures the project, manages dependencies via CPM, and defines the executable target with C++20 standard requirements. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(mallocMCExampleGetAvailableSlots LANGUAGES CXX) # --- Import tools ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/tools.cmake) # ---- Dependencies ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../../cmake/package-lock.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/add_controlled.cmake) add_controlled("alpaka" REQUIRED PREFIX mallocMC) if(NOT TARGET mallocMC) CPMAddPackage(NAME mallocMC SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) endif() # ---- Create standalone executable ---- alpaka_add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/source/main.cpp) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 OUTPUT_NAME ${PROJECT_NAME} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_link_libraries(${PROJECT_NAME} mallocMC::mallocMC alpaka::alpaka) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) ``` -------------------------------- ### Perform dynamic memory allocation in a CUDA kernel Source: https://github.com/alpaka-group/mallocmc/blob/dev/Usage.md Demonstrates defining a ScatterAllocator and passing its handle to a kernel for device-side memory management. ```c++ #include namespace mallocMC = MC; using ScatterAllocator = MC::Allocator< MC::CreationPolicies::Scatter<>, MC::DistributionPolicies::XMallocSIMD<>, MC::OOMPolicies::ReturnNull, MC::ReservePoolPolicies::SimpleCudaMalloc, MC::AlignmentPolicies::Shrink >; __global__ exampleKernel(ScatterAllocator::AllocatorHandle sah) { // some code ... int* a = (int*) sah.malloc(sizeof(int)*42); // some more code, using *a sah.free(a); } int main(){ ScatterAllocator sa( 1U * 512U * 1024U * 1024U ); // heap size of 512MiB exampleKernel<<< 32, 32 >>>(sa); return 0; } ``` -------------------------------- ### Configure MallocMC Test Subdirectories Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/CMakeLists.txt Defines the project requirements and adds subdirectories for unit and multithreaded tests. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(Examples LANGUAGES CXX) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/unit ${CMAKE_BINARY_DIR}/test/unit ) add_subdirectory( ${CMAKE_CURRENT_LIST_DIR}/multithreaded ${CMAKE_BINARY_DIR}/test/multithreaded ) add_custom_target( mallocMCTests DEPENDS mallocMCUnitTests mallocMCMultithreadedTests COMMENT "Shortcut for building all tests" ) ``` -------------------------------- ### Configure Compiler Warnings Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/unit/CMakeLists.txt Sets compiler-specific warning flags for Clang, GCC, and MSVC, excluding CUDA-specific issues. ```cmake # enable compiler warnings if(NOT mallocMC_TEST_INSTALLED_VERSION) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") target_compile_options( mallocMC INTERFACE -Wall # nvcc generate C code which uses directives GCC complains about like this: # warning: style of line directive is a GCC extension # So we can't use -pedantic here. $<$>:-Wpedantic> -Wextra # Somehow, with the commandline that CMake composes nvcc misinterprets the flag # after -Werror as an argument to -Werror leading to errors like # nvcc fatal : Value '-Wpedantic' is not defined for option 'Werror' # So, we can't compile with -Werror for nvcc. $<$>:-Werror> ) elseif(MSVC) target_compile_options(mallocMC INTERFACE /W4 /WX) endif() endif() ``` -------------------------------- ### Combine Policies into Allocator Source: https://github.com/alpaka-group/mallocmc/blob/dev/Usage.md Define an allocator type by passing chosen policies as template parameters to the mallocMC::Allocator class. ```c++ using namespace mallocMC; using Allocator1 = mallocMC::Allocator< CreationPolicy::OldMalloc, DistributionPolicy::Noop, OOMPolicy::ReturnNull, ReservePoolPolicy::CudaSetLimits, AlignmentPolicy::Noop >; ``` ```c++ using namespace mallocMC; using ScatterAllocator = mallocMC::Allocator< CreationPolicies::Scatter<>, DistributionPolicies::XMallocSIMD<>, OOMPolicies::ReturnNull, ReservePoolPolicies::SimpleCudaMalloc, AlignmentPolicies::Shrink >; ``` -------------------------------- ### Manage Dependencies Source: https://github.com/alpaka-group/mallocmc/blob/dev/CMakeLists.txt Includes external CMake modules and uses CPM to manage project dependencies. ```cmake # ---- Add dependencies via CPM ---- # see https://github.com/TheLartians/CPM.cmake for more info include(${CMAKE_CURRENT_LIST_DIR}/cmake/PackageProject.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/cmake/package-lock.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/add_controlled.cmake) # PackageProject.cmake will be used to make our target installable add_controlled("alpaka" REQUIRED) ``` -------------------------------- ### Format changes since branching Source: https://github.com/alpaka-group/mallocmc/blob/dev/CONTRIBUTING.md Use this command in bash to format only the changes made since branching off the dev branch. ```bash git clang-format dev ``` -------------------------------- ### Include mallocMC Header Source: https://github.com/alpaka-group/mallocmc/blob/dev/Usage.md Include the primary header file to access all library functionality. ```c++ #include ``` -------------------------------- ### Integrate mallocMC in CMakeLists.txt Source: https://github.com/alpaka-group/mallocmc/blob/dev/INSTALL.md Configuration required to link the mallocMC library into a CMake-based project. ```cmake # this example will require at least CMake 3.15 CMAKE_MINIMUM_REQUIRED(VERSION 3.15) # add path to FindmallocMC.cmake, e.g., in the directory in cmake/ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) # find mallocMC installation find_package(mallocMC 2.6.0 REQUIRED) alpaka_add_executable(yourBinary ${SOURCES}) target_include_directories(yourBinary PUBLIC ${mallocMC_INCLUDE_DIRS}) target_link_libraries(yourBinary PUBLIC alpaka::alpaka) ``` -------------------------------- ### CMake Configuration for Multithreaded Tests Source: https://github.com/alpaka-group/mallocmc/blob/dev/test/multithreaded/CMakeLists.txt The primary CMake configuration file for building and testing the multithreaded components of the project. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(mallocMCMultithreadedTests LANGUAGES CXX) # ---- Options ---- option(mallocMC_ENABLE_TEST_COVERAGE "Enable test coverage" OFF) option(mallocMC_TEST_INSTALLED_VERSION "Test the version found by find_package" OFF) # --- Import tools ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/tools.cmake) # ---- Dependencies ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../../cmake/package-lock.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/add_controlled.cmake) add_controlled("alpaka" REQUIRED PREFIX mallocMC) add_controlled("Catch2" REQUIRED PREFIX mallocMC) if(NOT TARGET mallocMC) if(mallocMC_TEST_INSTALLED_VERSION) find_package(mallocMC REQUIRED) else() CPMAddPackage(NAME mallocMC SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) endif() endif() # ---- Create binary ---- file(GLOB sources CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp) alpaka_add_executable(${PROJECT_NAME} ${sources}) target_link_libraries(${PROJECT_NAME} mallocMC::mallocMC alpaka::alpaka Catch2::Catch2WithMain) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20) # enable compiler warnings if(NOT mallocMC_TEST_INSTALLED_VERSION) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") target_compile_options( mallocMC INTERFACE -Wall # nvcc generate C code which uses directives GCC complains about like this: # warning: style of line directive is a GCC extension # So we can't use -pedantic here. $<$>:-Wpedantic> -Wextra # Somehow, with the commandline that CMake composes nvcc misinterprets the flag # after -Werror as an argument to -Werror leading to errors like # nvcc fatal : Value '-Wpedantic' is not defined for option 'Werror' # So, we can't compile with -Werror for nvcc. $<$>:-Werror> ) elseif(MSVC) target_compile_options(mallocMC INTERFACE /W4 /WX) endif() endif() # ---- Add mallocMCTests ---- enable_testing() add_test(${PROJECT_NAME} ${PROJECT_NAME}) # ---- code coverage ---- if(mallocMC_ENABLE_TEST_COVERAGE) target_compile_options(mallocMC INTERFACE -O0 -g -fprofile-arcs -ftest-coverage) target_link_options(mallocMC INTERFACE -fprofile-arcs -ftest-coverage) endif() ``` -------------------------------- ### CMake Configuration for Native CUDA Project Source: https://github.com/alpaka-group/mallocmc/blob/dev/examples/native-cuda/CMakeLists.txt Defines the project requirements, dependency management, and executable target for a CUDA-based MallocMC application. ```cmake cmake_minimum_required(VERSION 3.14...3.22) project(mallocMCExampleNativeCuda LANGUAGES CXX CUDA) # --- Import tools ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/tools.cmake) # ---- Dependencies ---- include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/CPM_0.40.2.cmake) CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../../cmake/package-lock.cmake) if(NOT TARGET mallocMC) CPMAddPackage(NAME mallocMC SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) endif() # ---- Create standalone executable ---- add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/source/main.cu) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 OUTPUT_NAME ${PROJECT_NAME} CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_link_libraries(${PROJECT_NAME} mallocMC::mallocMC ${CUDA_LIBRARIES}) add_test(NAME ${PROJECT_NAME} COMMAND ${PROJECT_NAME}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.