Skip to content

Commit

Permalink
Merge pull request #148 from DrTimothyAldenDavis/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
DrTimothyAldenDavis authored Jun 18, 2022
2 parents 1bf1dde + a13a068 commit 1a654bb
Show file tree
Hide file tree
Showing 75 changed files with 3,425 additions and 5,358 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ alternative/*.out
alternative/*_out.m
alternative/*_out2.m
alternative/*_demo
alternative/*.so*
alternative/*.dylib*

Test/*.log
Test/errlog.txt
Expand Down
35 changes: 18 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ endif ( )
set ( CMAKE_MACOSX_RPATH TRUE )

# version of SuiteSparse:GraphBLAS
set ( GraphBLAS_DATE "May 20, 2022" )
set ( GraphBLAS_DATE "June 17, 2022" )
set ( GraphBLAS_VERSION_MAJOR 7 )
set ( GraphBLAS_VERSION_MINOR 1 )
set ( GraphBLAS_VERSION_SUB 0 )
set ( GraphBLAS_VERSION_SUB 1 )

message ( STATUS "Building SuiteSparse:GraphBLAS version: v" ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB} " date: " ${GraphBLAS_DATE} )

Expand Down Expand Up @@ -58,14 +58,13 @@ message ( STATUS "GraphBLAS C API: v" "${GraphBLAS_API_VERSION_MAJOR}.${GraphBLA

# TODO: use something like this:
# if ( set some flag to ignore cuda )
# set ( CMAKE_CUDA off )
# ... disable CUDA
# message ( STATUS "CUDA: disabled" )
# elseif ( ${CMAKE_VERSION} VERSION_LESS "3.17.0" )
# ...

if ( ${CMAKE_VERSION} VERSION_LESS "3.17.0" )


# CUDA requires cmake 3.17 or later
set ( CMAKE_CUDA off )
message ( STATUS "CUDA: not enabled (cmake 3.17.0 or later required)" )
Expand Down Expand Up @@ -103,14 +102,14 @@ else ( )
endif ( )

# CUDA is under development for now, and not deployed in production:
set ( CMAKE_CUDA off)
set ( CMAKE_CUDA off )

# Edit these lines for code development only, not for end-users:
# set ( CMAKE_BUILD_TYPE Debug )

if ( CMAKE_CUDA )
# for CUDA development only; not for production use
set ( CMAKE_CUDA_DEV on )
set ( CMAKE_CUDA_DEV off )
project ( graphblas
VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}"
LANGUAGES CUDA C )
Expand All @@ -128,25 +127,21 @@ endif ( )
find_package ( OpenMP )

if ( CMAKE_CUDA )
# with CUDA and RMM
message ( STATUS "CUDA: enabled" )
set ( CMAKE_CUDA_FLAG " -DGBCUDA" )
add_subdirectory ( CUDA )
set ( GB_CUDA graphblascuda ${CUDA_LIBRARIES} )
link_directories ( "CUDA" ${CUDA_LIBRARIES} )
else ( )
set ( CMAKE_CUDA_FLAG " " )
set ( GB_CUDA )
endif ( )

if ( CMAKE_CUDA )
message ( STATUS "CUDA: enabled" )
set ( CMAKE_RMM_FLAG " -DGBRMM" )
set ( GB_RMM rmm_wrap ${CUDA_LIBRARIES} stdc++ )
set ( GB_RMM rmm_wrap ${CUDA_LIBRARIES} )
add_subdirectory ( rmm_wrap )
include_directories ( "rmm_wrap" ${CUDA_INCLUDE_DIRS} )
link_directories ( "CUDA" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "rmm_wrap" )
link_directories ( "CUDA" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "rmm_wrap" "/usr/local/cuda/lib64" )
else ( )
# without CUDA and RMM
message ( STATUS "CUDA: not enabled" )
set ( CMAKE_CUDA_FLAG " " )
set ( CMAKE_RMM_FLAG " " )
set ( GB_CUDA )
set ( GB_RMM )
endif ( )

Expand Down Expand Up @@ -410,17 +405,23 @@ if ( NOT GBNCPUFEAT )
include ( CheckSymbolExists )
check_include_file ( dlfcn.h HAVE_DLFCN_H )
if ( HAVE_DLFCN_H )
message ( STATUS "cpu_feautures has dlfcn.h" )
target_compile_definitions ( graphblas PRIVATE HAVE_DLFCN_H )
if ( BUILD_GRB_STATIC_LIBRARY )
target_compile_definitions ( graphblas_static PRIVATE HAVE_DLFCN_H )
endif ( )
else ( )
message ( STATUS "cpu_feautures without dlfcn.h" )
endif ( )
check_symbol_exists ( getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL )
if ( HAVE_STRONG_GETAUXVAL )
message ( STATUS "cpu_feautures has getauxval from sys/auxv.h" )
target_compile_definitions ( graphblas PRIVATE HAVE_STRONG_GETAUXVAL )
if ( BUILD_GRB_STATIC_LIBRARY )
target_compile_definitions ( graphblas_static PRIVATE HAVE_STRONG_GETAUXVAL )
endif ( )
else ( )
message ( STATUS "cpu_feautures doesn't have getauxval from sys/auxv.h" )
endif ( )
endif ( )
endif ( )
Expand Down
12 changes: 6 additions & 6 deletions CUDA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.20.1)

project(GRAPHBLAS_CUDA VERSION 0.1 LANGUAGES CXX CUDA)

set(CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -G")
set(CMAKE_CUDA_FLAGS "-cudart=static -lineinfo ")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17 -fPIC ")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGBNCPUFEAT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGBNCPUFEAT")
set(CMAKE_C_STANDARD 11)

message(STATUS "${CMAKE_CXX_FLAGS}")
message(STATUS "C++ flags for CUDA:" "${CMAKE_CXX_FLAGS}")

file(GLOB GRAPHBLAS_CUDA_SOURCES "*.cu" "*.c" "*.cpp")

Expand All @@ -32,14 +32,14 @@ set(GRAPHBLAS_CUDA_INCLUDES
../Include
../CUDA)

message(STATUS "${GRAPHBLAS_CUDA_INCLUDES}")
message(STATUS "GraphBLAS CUDA includes: " "${GRAPHBLAS_CUDA_INCLUDES}")

target_include_directories(graphblascuda PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ${GRAPHBLAS_CUDA_INCLUDES})
set_target_properties(graphblascuda PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(graphblascuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(graphblascuda PROPERTIES CUDA_ARCHITECTURES "75")

target_link_libraries(graphblascuda CUDA::nvrtc CUDA::cudart_static)
target_link_libraries(graphblascuda CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt )

install ( TARGETS graphblascuda
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down Expand Up @@ -127,13 +127,13 @@ endif()
# 3. Compile/link individual {test_suite_name}_cuda_tests.cpp files into a gtest executable
set(GRAPHBLAS_CUDA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/test)

message(STATUS "${CUDA_TEST_CPP_FILES}")
message(STATUS "CUDA tests files: " "${CUDA_TEST_CPP_FILES}")

add_executable(graphblascuda_test ${CUDA_TEST_CPP_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/test/run_tests.cpp)

set_target_properties(graphblascuda_test PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(graphblascuda_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "70")
set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "75")

include(GoogleTest)

Expand Down
Loading

0 comments on commit 1a654bb

Please sign in to comment.