Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHOLMOD GPU: Fix qsort #366

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHOLMOD/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ if ( SUITESPARSE_CUDA )
endif ( )
endif ( )

include ( CheckTypeSize )
set ( old_CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_INCLUDE_FILES )
list ( APPEND CMAKE_EXTRA_INCLUDE_FILES "stdlib.h" )
check_type_size ( "__compar_fn_t" COMPAR_FN_T )
set ( CMAKE_EXTRA_INCLUDE_FILES old_CMAKE_EXTRA_INCLUDE_FILES )

if ( NOT HAVE_COMPAR_FN_T )
target_compile_definitions ( CHOLMOD_CUDA PRIVATE NCOMPAR_FN_T )
if ( NOT NSTATIC )
target_compile_definitions ( CHOLMOD_CUDA_static PRIVATE NCOMPAR_FN_T )
endif ( )
endif ( )

#-------------------------------------------------------------------------------
# installation location
#-------------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions CHOLMOD/GPU/t_cholmod_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ int TEMPLATE2 (CHOLMOD (gpu_init))

}

#if !defined(NCOMPAR_FN_T)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. I meant #if defined(NCOMPAR_FN_T).

Suggested change
#if !defined(NCOMPAR_FN_T)
#if defined(NCOMPAR_FN_T)

typedef int (*__compar_fn_t) (const void*, const void*);
#enfif
whuaegeanse marked this conversation as resolved.
Show resolved Hide resolved

/* ========================================================================== */
/* === gpu_reorder_descendants ============================================== */
Expand Down