Skip to content

Commit 931ed09

Browse files
GraphBLAS bug fix (GB_add_phase0), and latest CUDA draft kernels
1 parent c6ac90b commit 931ed09

File tree

188 files changed

+4311
-17662
lines changed

Some content is hidden

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

188 files changed

+4311
-17662
lines changed

GraphBLAS/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,6 @@ configure_file ( "Config/README.md.in"
203203
"${PROJECT_SOURCE_DIR}/README.md"
204204
NEWLINE_STYLE LF )
205205

206-
# for CUDA
207-
configure_file ( "CUDA/Config/GB_cuda_common_jitFactory.hpp.in"
208-
"${PROJECT_SOURCE_DIR}/CUDA/GB_cuda_common_jitFactory.hpp"
209-
NEWLINE_STYLE LF )
210-
211206
#-------------------------------------------------------------------------------
212207
# include directories for both graphblas and the demos
213208
#-------------------------------------------------------------------------------
@@ -465,6 +460,7 @@ if ( GRAPHBLAS_HAS_OPENMP )
465460
target_link_libraries ( GraphBLAS_static PRIVATE OpenMP::OpenMP_C )
466461
endif ( )
467462
message ( STATUS "CMAKE OpenMP C flags: ${OpenMP_C_FLAGS}" )
463+
set ( GB_OPENMP_C_FLAGS "${OpenMP_C_FLAGS}" )
468464
else ( )
469465
message ( WARNING
470466
"WARNING: OpenMP was not found (or was disabled with "
@@ -485,6 +481,7 @@ else ( )
485481
"The C compiler does not support thread-local-storage; "
486482
"GxB_Context_engage will return GrB_NOT_IMPLEMENTED." )
487483
endif ( )
484+
set ( GB_OPENMP_C_FLAGS "" )
488485
endif ( )
489486

490487
if ( SUITESPARSE_HAS_CUDA AND GRAPHBLAS_USE_CUDA )

GraphBLAS/CUDA/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
*.o
33
*.a
44
*.so
5-
jitFactory
6-
stringify
75
rmm_log.txt
86

97
# Do not ignore this file

GraphBLAS/CUDA/CMakeLists.txt

Lines changed: 7 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# GraphBLAS/CUDA/CMakeLists.txt: cmake script for GraphBLAS/CUDA
33
#-------------------------------------------------------------------------------
44

5-
# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved.
5+
# SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2024, All Rights Reserved.
66

77
# Some files in this folder are (c) NVIDIA or (c) Google. Please refer
88
# to their individual licenses (Apache, BSD, or others).
@@ -12,11 +12,6 @@
1212

1313
cmake_minimum_required ( VERSION 3.20 ) # GraphBLAS can be built stand-alone
1414

15-
# CMake build for generating googletest c++ files that can be compiled and
16-
# executed in parallel. Build can be customized to speed up development by
17-
# allowing the targeting of specific specific parameters. The output of this
18-
# build is an executable that can be used to run the gtests.
19-
2015
project ( GRAPHBLAS_CUDA
2116
VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}"
2217
LANGUAGES CXX CUDA )
@@ -29,7 +24,6 @@ set ( CMAKE_CUDA_FLAGS "-cudart=static -lineinfo " )
2924
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17 -fPIC " )
3025

3126
add_compile_definitions ( GBNCPUFEAT )
32-
add_compile_definitions ( GBCUDA_CPLUSPLUS )
3327

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

@@ -160,126 +154,13 @@ if ( NOT MSVC )
160154
endif ( )
161155

162156
#-------------------------------------------------------------------------------
163-
# test suite for the CUDA kernels
157+
# report
164158
#-------------------------------------------------------------------------------
165159

166-
if ( 0 )
167-
168-
# 1. Execute enumify/stringify/jitify logic to compile ptx kernels and
169-
# compile/link w/ relevant *.cu files.
170-
171-
# TODO: Need to do this piece in cmake
172-
173-
# 2. Generate test .cu files named "{semiring_operation}_test_instances.hpp"
174-
set ( CUDA_TEST_SUITES
175-
AxB_dot3
176-
# reduce_to_scalar
177-
)
178-
179-
#
180-
set ( CUDA_TEST_MONOIDS PLUS MIN MAX) # TIMES ANY )
181-
set ( CUDA_TEST_BINOPS TIMES PLUS MIN MAX DIV ) #MINUS RDIV RMINUS FIRST SECOND PAIR )
182-
set ( CUDA_TEST_SEMIRINGS PLUS_TIMES MIN_PLUS MAX_PLUS )
183-
set ( CUDA_TEST_DATATYPES int32_t int64_t uint32_t uint64_t float double )
184-
set ( CUDA_TEST_KERNELS vsvs) # mp vsvs dndn spdn vssp )
185-
set ( CUDA_TEST_FORMATS sparse dense sparse_dense reduce )
186-
187-
# TODO: Update testGen.py to accept the above CUDA_TEST_* params as arguments
188-
189-
# Note: I don't believe there's a way to do this particular piece in parallel but
190-
# once all the files are written, we should be able to compile them in parallel
191-
192-
# Separate individual kernels from larger "overview" test (e.g. 2-level testing structure)
193-
# We want to test all the *_cuda versions
194-
195-
# TODO: make this a shorter test
196-
set(CUDA_TEST_CPP_FILES "")
197-
if ( FALSE ) # TODO: use a cmake option
198-
foreach(var ${CUDA_TEST_SUITES})
199-
foreach(semiring ${CUDA_TEST_SEMIRINGS})
200-
foreach(kernel ${CUDA_TEST_KERNELS})
201-
foreach(format ${CUDA_TEST_FORMATS})
202-
# TODO: Have Python script also build separate cudaTest.cpp (named something
203-
# like AxB_dot3_cuda_tests.cpp) for each suite. This way we should be able to
204-
# easily ignore them from the build
205-
add_custom_command(
206-
OUTPUT
207-
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_test_instances.hpp
208-
${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_cuda_tests.cpp
209-
# DEPENDS
210-
# jitFactory.hpp
211-
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/test/testGen_cmake.py "\"${CMAKE_CURRENT_SOURCE_DIR}\"" "\"${var}\"" "\"${CUDA_TEST_MONOIDS}\""
212-
"\"${CUDA_TEST_BINOPS}\"" "\"${semiring}\"" "\"${CUDA_TEST_DATATYPES}\""
213-
"\"${kernel}\""
214-
)
215-
# Construct final list of files to compile (in parallel)
216-
list(APPEND CUDA_TEST_CPP_FILES ${CMAKE_CURRENT_BINARY_DIR}/${var}_${semiring}_${format}_cuda_tests.cpp)
217-
endforeach()
218-
endforeach()
219-
endforeach()
220-
endforeach()
221-
endif ( )
222-
223-
include(FetchContent)
224-
FetchContent_Declare(
225-
googletest
226-
# Specify the commit you depend on and update it regularly.
227-
URL https://github.com/google/googletest/archive/e2239ee6043f73722e7aa812a459f54a28552929.zip
228-
)
229-
# For Windows: Prevent overriding the parent project's compiler/linker settings
230-
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
231-
FetchContent_GetProperties(googletest)
232-
if(NOT googletest_POPULATED)
233-
FetchContent_Populate(googletest)
234-
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
235-
endif()
236-
237-
#FetchContent_MakeAvailable(googletest EC)
238-
239-
240-
#file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
241-
#execute_process(
242-
# COMMAND git clone "https://github.com/google/googletest.git" googletest
243-
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external_includes)
244-
#
245-
#include_directories(${CMAKE_CURRENT_BINARY_DIR}/external_includes/googletest/googletest/include)
246-
247-
#add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/external_includes/googletest/googletest/)
248-
249-
# 3. Compile/link individual {test_suite_name}_cuda_tests.cpp files into a gtest executable
250-
set(GRAPHBLAS_CUDA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/test)
160+
message ( STATUS "CMAKE_CUDA_ARCHITECTURES: ${CMAKE_CUDA_ARCHITECTURES} ")
161+
message ( STATUS "CMAKE_CUDA_COMPILER: ${CMAKE_CUDA_COMPILER} ")
162+
message ( STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS} ")
163+
message ( STATUS "CMAKE_CUDA_FLAGS_RELEASE: ${CMAKE_CUDA_FLAGS_RELEASE} ")
164+
message ( STATUS "CMAKE_CUDA_FLAGS_DEBUG: ${CMAKE_CUDA_FLAGS_DEBUG} ")
251165

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

254-
add_executable(graphblascuda_test ${CUDA_TEST_CPP_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/test/run_tests.cpp)
255-
256-
set_target_properties(graphblascuda_test PROPERTIES POSITION_INDEPENDENT_CODE ON)
257-
set_target_properties(graphblascuda_test PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
258-
set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "52;75;80" )
259-
260-
include(GoogleTest)
261-
262-
if ( ENABLE_SHARED_LIBS )
263-
target_link_libraries ( graphblascuda_test PUBLIC GraphBLAS )
264-
else ( )
265-
target_link_libraries ( graphblascuda_test PUBLIC GraphBLAS_static )
266-
endif ( )
267-
268-
target_link_libraries ( graphblascuda_test
269-
PUBLIC
270-
GraphBLAS_CUDA
271-
RMM_wrap
272-
CUDA::cudart_static
273-
CUDA::nvrtc
274-
${ADDITIONAL_DEPS}
275-
PRIVATE
276-
gtest_main )
277-
278-
target_include_directories ( graphblascuda_test
279-
PUBLIC
280-
rmm_wrap
281-
${ADDITIONAL_INCLUDES}
282-
${CUDAToolkit_INCLUDE_DIRS}
283-
${GRAPHBLAS_CUDA_INCLUDES} )
284-
285-
endif ( )

GraphBLAS/CUDA/Config/GB_cuda_common_jitFactory.hpp.in

Lines changed: 0 additions & 82 deletions
This file was deleted.

GraphBLAS/CUDA/Config/GraphBLAS_CUDA.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GraphBLAS_CUDA, Copyright (c) 2017-2023, Timothy A. Davis.
1+
# GraphBLAS_CUDA, Copyright (c) 2017-2024, FIXME
22
# All Rights Reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

GraphBLAS/CUDA/Config/GraphBLAS_CUDAConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# The following copyright and license applies to just this file only, not to
66
# the library itself:
7-
# GraphBLASConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved.
7+
# GraphBLASConfig.cmake, Copyright (c) 2023-2024, FIXME
88
# SPDX-License-Identifier: BSD-3-clause
99

1010
#-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)