Skip to content

Commit 7ae0f44

Browse files
committed
Merge branch 'master' into cmake
2 parents bc5ae1e + 4eb68a3 commit 7ae0f44

File tree

442 files changed

+60759
-48399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+60759
-48399
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ project (SuiteSparse
2626
DESCRIPTION "A suite of sparse matrix packages"
2727
HOMEPAGE_URL http://faculty.cse.tamu.edu/davis/suitesparse.html
2828
LANGUAGES C
29-
VERSION 5.12.0
29+
VERSION 5.13.0
3030
)
3131

3232
set (CMAKE_DEBUG_POSTFIX _debug)

ChangeLog

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Aug 25, 2022, SuiteSparse 5.13.0
2+
3+
* GraphBLAS v7.2.0: see GraphBLAS/Doc/ChangeLog for details.
4+
* performance: more compact serialization (ZSTD added, now the
5+
default compression method).
6+
* MATLAB interface: faster linear indexing, reshape, bandwidth,
7+
istril, istriu, isbanded, isdiag. C(I,J)=A can now grow the
8+
size of C.
9+
* features: reshape methods, cube root operator, isStoredElement
10+
* bugs: a minor bug; user-defined types were incorrectly limited to
11+
128 bytes in size in v7.0.3.
12+
113
Apr 10, 2022, SuiteSparse 5.12.0
214

315
* GraphBLAS v7.0.3: see GraphBLAS/Doc/ChangeLog for details.

GraphBLAS/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ alternative/*.out
5959
alternative/*_out.m
6060
alternative/*_out2.m
6161
alternative/*_demo
62+
alternative/*.so*
63+
alternative/*.dylib*
6264

6365
Test/*.log
6466
Test/errlog.txt

GraphBLAS/CMakeLists.txt

+22-21
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ endif ( )
2626
set ( CMAKE_MACOSX_RPATH TRUE )
2727

2828
# version of SuiteSparse:GraphBLAS
29-
set ( GraphBLAS_DATE "Apr 8, 2022" )
29+
set ( GraphBLAS_DATE "Aug 8, 2022" )
3030
set ( GraphBLAS_VERSION_MAJOR 7 )
31-
set ( GraphBLAS_VERSION_MINOR 0 )
32-
set ( GraphBLAS_VERSION_SUB 3 )
31+
set ( GraphBLAS_VERSION_MINOR 2 )
32+
set ( GraphBLAS_VERSION_SUB 0 )
3333

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

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

5959
# TODO: use something like this:
6060
# if ( set some flag to ignore cuda )
61-
# set ( CMAKE_CUDA off )
61+
# ... disable CUDA
6262
# message ( STATUS "CUDA: disabled" )
6363
# elseif ( ${CMAKE_VERSION} VERSION_LESS "3.17.0" )
6464
# ...
6565

6666
if ( ${CMAKE_VERSION} VERSION_LESS "3.17.0" )
6767

68-
6968
# CUDA requires cmake 3.17 or later
7069
set ( CMAKE_CUDA off )
7170
message ( STATUS "CUDA: not enabled (cmake 3.17.0 or later required)" )
@@ -103,14 +102,14 @@ else ( )
103102
endif ( )
104103

105104
# CUDA is under development for now, and not deployed in production:
106-
set ( CMAKE_CUDA off)
105+
set ( CMAKE_CUDA off )
107106

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

111110
if ( CMAKE_CUDA )
112111
# for CUDA development only; not for production use
113-
set ( CMAKE_CUDA_DEV on )
112+
set ( CMAKE_CUDA_DEV off )
114113
project ( graphblas
115114
VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}"
116115
LANGUAGES CUDA C )
@@ -128,25 +127,21 @@ endif ( )
128127
find_package ( OpenMP )
129128

130129
if ( CMAKE_CUDA )
130+
# with CUDA and RMM
131+
message ( STATUS "CUDA: enabled" )
131132
set ( CMAKE_CUDA_FLAG " -DGBCUDA" )
132133
add_subdirectory ( CUDA )
133134
set ( GB_CUDA graphblascuda ${CUDA_LIBRARIES} )
134-
link_directories ( "CUDA" ${CUDA_LIBRARIES} )
135-
else ( )
136-
set ( CMAKE_CUDA_FLAG " " )
137-
set ( GB_CUDA )
138-
endif ( )
139-
140-
if ( CMAKE_CUDA )
141-
message ( STATUS "CUDA: enabled" )
142-
set ( CMAKE_RMM_FLAG " -DGBRMM" )
143-
set ( GB_RMM rmm_wrap ${CUDA_LIBRARIES} stdc++ )
135+
set ( GB_RMM rmm_wrap ${CUDA_LIBRARIES} )
144136
add_subdirectory ( rmm_wrap )
145137
include_directories ( "rmm_wrap" ${CUDA_INCLUDE_DIRS} )
146-
link_directories ( "CUDA" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "rmm_wrap" )
138+
link_directories ( "CUDA" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "rmm_wrap" "/usr/local/cuda/lib64" )
147139
else ( )
140+
# without CUDA and RMM
148141
message ( STATUS "CUDA: not enabled" )
142+
set ( CMAKE_CUDA_FLAG " " )
149143
set ( CMAKE_RMM_FLAG " " )
144+
set ( GB_CUDA )
150145
set ( GB_RMM )
151146
endif ( )
152147

@@ -257,9 +252,9 @@ set ( CMAKE_INCLUDE_CURRENT_DIR ON )
257252

258253
if ( CMAKE_CUDA_DEV )
259254
# for CUDA development only; not for production use
260-
include_directories ( Source/Template Source Include Source/Generated1 lz4 Demo/Include rmm_wrap )
255+
include_directories ( Source/Template Source Include Source/Generated1 lz4 zstd zstd/zstd_subset Demo/Include rmm_wrap )
261256
else ( )
262-
include_directories ( Source/Template Source Include Source/Generated1 lz4 Source/Generated2 Demo/Include rmm_wrap )
257+
include_directories ( Source/Template Source Include Source/Generated1 lz4 zstd zstd/zstd_subset Source/Generated2 Demo/Include rmm_wrap )
263258
endif ( )
264259

265260
#-------------------------------------------------------------------------------
@@ -284,7 +279,7 @@ if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
284279
# integer operations wrap
285280
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fwrapv " )
286281
# check all warnings (uncomment for development only)
287-
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Werror " )
282+
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic " )
288283
if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9 )
289284
message ( FATAL_ERROR "gcc version must be at least 4.9" )
290285
endif ( )
@@ -410,17 +405,23 @@ if ( NOT GBNCPUFEAT )
410405
include ( CheckSymbolExists )
411406
check_include_file ( dlfcn.h HAVE_DLFCN_H )
412407
if ( HAVE_DLFCN_H )
408+
message ( STATUS "cpu_feautures has dlfcn.h" )
413409
target_compile_definitions ( graphblas PRIVATE HAVE_DLFCN_H )
414410
if ( BUILD_GRB_STATIC_LIBRARY )
415411
target_compile_definitions ( graphblas_static PRIVATE HAVE_DLFCN_H )
416412
endif ( )
413+
else ( )
414+
message ( STATUS "cpu_feautures without dlfcn.h" )
417415
endif ( )
418416
check_symbol_exists ( getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL )
419417
if ( HAVE_STRONG_GETAUXVAL )
418+
message ( STATUS "cpu_feautures has getauxval from sys/auxv.h" )
420419
target_compile_definitions ( graphblas PRIVATE HAVE_STRONG_GETAUXVAL )
421420
if ( BUILD_GRB_STATIC_LIBRARY )
422421
target_compile_definitions ( graphblas_static PRIVATE HAVE_STRONG_GETAUXVAL )
423422
endif ( )
423+
else ( )
424+
message ( STATUS "cpu_feautures doesn't have getauxval from sys/auxv.h" )
424425
endif ( )
425426
endif ( )
426427
endif ( )

GraphBLAS/CUDA/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.so
55
jitFactory
66
stringify
7+
rmm_log.txt
78

89
# Do not ignore this file
910
!.gitignore

GraphBLAS/CUDA/CMakeLists.txt

+48-29
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.20.1)
77

88
project(GRAPHBLAS_CUDA VERSION 0.1 LANGUAGES CXX CUDA)
99

10-
set(CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -G")
10+
set(CMAKE_CUDA_FLAGS "-cudart=static -lineinfo ")
1111
set(CMAKE_CXX_STANDARD 17)
1212
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17 -fPIC ")
1313
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGBNCPUFEAT")
1414
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGBNCPUFEAT")
1515
set(CMAKE_C_STANDARD 11)
1616

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

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

@@ -32,21 +32,37 @@ set(GRAPHBLAS_CUDA_INCLUDES
3232
../Include
3333
../CUDA)
3434

35-
message(STATUS "${GRAPHBLAS_CUDA_INCLUDES}")
35+
message(STATUS "GraphBLAS CUDA includes: " "${GRAPHBLAS_CUDA_INCLUDES}")
3636

37-
target_include_directories(graphblascuda PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ${GRAPHBLAS_CUDA_INCLUDES})
37+
set(EXTERNAL_INCLUDES_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
38+
39+
IF(NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY})
40+
file(MAKE_DIRECTORY ${EXTERNAL_INCLUDES_DIRECTORY})
41+
endif()
42+
43+
IF(NOT EXISTS ${EXTERNAL_INCLUDES_DIRECTORY}/cuco)
44+
execute_process(
45+
COMMAND git clone "https://github.com/NVIDIA/cuCollections.git" --branch main --recursive cuco
46+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
47+
endif()
48+
49+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/external_includes/cuco/include)
50+
51+
target_include_directories(graphblascuda PUBLIC
52+
${CMAKE_CURRENT_BINARY_DIR}/external_includes/cuco/include
53+
${CUDAToolkit_INCLUDE_DIRS}
54+
${GRAPHBLAS_CUDA_INCLUDES})
3855
set_target_properties(graphblascuda PROPERTIES POSITION_INDEPENDENT_CODE ON)
3956
set_target_properties(graphblascuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
4057
set_target_properties(graphblascuda PROPERTIES CUDA_ARCHITECTURES "75")
4158

42-
target_link_libraries(graphblascuda CUDA::nvrtc CUDA::cudart_static)
59+
target_link_libraries(graphblascuda CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt )
4360

4461
install ( TARGETS graphblascuda
4562
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
4663
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
4764
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
4865

49-
5066
# 1. Execute enumify/stringify/jitify logic to compile ptx kernels and compile/link w/ relevant *.cu files.
5167

5268
# TODO: Need to do this piece in cmake
@@ -58,11 +74,12 @@ set(CUDA_TEST_SUITES
5874
)
5975

6076
#
61-
set(CUDA_TEST_MONOIDS PLUS) #MIN MAX TIMES ANY)
62-
set(CUDA_TEST_BINOPS TIMES) #PLUS MIN MAX DIV MINUS RDIV RMINUS FIRST SECOND PAIR)
63-
set(CUDA_TEST_SEMIRINGS PLUS_TIMES) # MIN_PLUS MAX_PLUS)
64-
set(CUDA_TEST_DATATYPES int32_t ) #int64_t uint32_t uint64_t float double)
77+
set(CUDA_TEST_MONOIDS PLUS MIN MAX) # TIMES ANY)
78+
set(CUDA_TEST_BINOPS TIMES PLUS MIN MAX DIV) #MINUS RDIV RMINUS FIRST SECOND PAIR)
79+
set(CUDA_TEST_SEMIRINGS PLUS_TIMES MIN_PLUS MAX_PLUS)
80+
set(CUDA_TEST_DATATYPES int32_t int64_t uint32_t uint64_t float double)
6581
set(CUDA_TEST_KERNELS vsvs) # mp vsvs dndn spdn vssp)
82+
set(CUDA_TEST_FORMATS sparse dense sparse_dense reduce)
6683

6784

6885
# TODO: Update testGen.py to accept the above CUDA_TEST_* params as arguments
@@ -77,23 +94,25 @@ set(CUDA_TEST_CPP_FILES "")
7794
foreach(var ${CUDA_TEST_SUITES})
7895
foreach(semiring ${CUDA_TEST_SEMIRINGS})
7996
foreach(kernel ${CUDA_TEST_KERNELS})
80-
81-
# TODO: Have Python script also build separate cudaTest.cpp (named something
82-
# like AxB_dot3_cuda_tests.cpp) for each suite. This way we should be able to
83-
# easily ignore them from the build
84-
add_custom_command(
85-
OUTPUT
86-
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_test_instances.hpp
87-
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_cuda_tests.cpp
88-
DEPENDS
89-
jitFactory.hpp
90-
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/test/testGen_cmake.py "\"${CMAKE_CURRENT_SOURCE_DIR}\"" "\"${var}\"" "\"${CUDA_TEST_MONOIDS}\""
91-
"\"${CUDA_TEST_BINOPS}\"" "\"${semiring}\"" "\"${CUDA_TEST_DATATYPES}\""
92-
"\"${kernel}\""
93-
)
94-
95-
# Construct final list of files to compile (in parallel)
96-
list(APPEND CUDA_TEST_CPP_FILES ${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_cuda_tests.cpp)
97+
foreach(format ${CUDA_TEST_FORMATS})
98+
99+
# TODO: Have Python script also build separate cudaTest.cpp (named something
100+
# like AxB_dot3_cuda_tests.cpp) for each suite. This way we should be able to
101+
# easily ignore them from the build
102+
add_custom_command(
103+
OUTPUT
104+
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_test_instances.hpp
105+
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_cuda_tests.cpp
106+
DEPENDS
107+
jitFactory.hpp
108+
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/test/testGen_cmake.py "\"${CMAKE_CURRENT_SOURCE_DIR}\"" "\"${var}\"" "\"${CUDA_TEST_MONOIDS}\""
109+
"\"${CUDA_TEST_BINOPS}\"" "\"${semiring}\"" "\"${CUDA_TEST_DATATYPES}\""
110+
"\"${kernel}\""
111+
)
112+
113+
# Construct final list of files to compile (in parallel)
114+
list(APPEND CUDA_TEST_CPP_FILES ${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_cuda_tests.cpp)
115+
endforeach()
97116
endforeach()
98117
endforeach()
99118
endforeach()
@@ -127,13 +146,13 @@ endif()
127146
# 3. Compile/link individual {test_suite_name}_cuda_tests.cpp files into a gtest executable
128147
set(GRAPHBLAS_CUDA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/test)
129148

130-
message(STATUS "${CUDA_TEST_CPP_FILES}")
149+
message(STATUS "CUDA tests files: " "${CUDA_TEST_CPP_FILES}")
131150

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

134153
set_target_properties(graphblascuda_test PROPERTIES POSITION_INDEPENDENT_CODE ON)
135154
set_target_properties(graphblascuda_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
136-
set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "70")
155+
set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "75")
137156

138157
include(GoogleTest)
139158

0 commit comments

Comments
 (0)