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

Support object files in JIT #290

Open
wants to merge 3 commits into
base: dev3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ if ( SUITESPARSE_DEMOS )
add_executable ( wathen_demo "Demo/Program/wathen_demo.c" )
add_executable ( context_demo "Demo/Program/context_demo.c" )
add_executable ( gauss_demo "Demo/Program/gauss_demo.c" )
add_executable ( wildtype_demo_obj "Demo/Program/wildtype_demo_obj.c" )

# Libraries required for Demo programs
if ( BUILD_SHARED_LIBS )
Expand All @@ -536,6 +537,8 @@ if ( SUITESPARSE_DEMOS )
target_link_libraries ( wathen_demo PUBLIC GraphBLAS )
target_link_libraries ( context_demo PUBLIC GraphBLAS )
target_link_libraries ( gauss_demo PUBLIC GraphBLAS )
target_link_libraries ( wildtype_demo_obj PUBLIC GraphBLAS )

else ( )
target_link_libraries ( openmp_demo PUBLIC GraphBLAS_static )
target_link_libraries ( openmp2_demo PUBLIC GraphBLAS_static )
Expand All @@ -548,6 +551,7 @@ if ( SUITESPARSE_DEMOS )
target_link_libraries ( wathen_demo PUBLIC GraphBLAS_static )
target_link_libraries ( context_demo PUBLIC GraphBLAS_static )
target_link_libraries ( gauss_demo PUBLIC GraphBLAS_static )
target_link_libraries ( wildtype_demo_obj PUBLIC GraphBLAS_static)
endif ( )

target_link_libraries ( openmp_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
Expand All @@ -556,6 +560,7 @@ if ( SUITESPARSE_DEMOS )
target_link_libraries ( kron_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( simple_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( wildtype_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( wildtype_demo_obj PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( reduce_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( import_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
target_link_libraries ( wathen_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} )
Expand Down
1 change: 1 addition & 0 deletions Config/GraphBLAS.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ typedef enum // for global options or matrix options
GxB_JIT_C_CMAKE_LIBS = 7031, // CPU JIT C libraries when using cmake
GxB_JIT_USE_CMAKE = 7032, // CPU JIT: use cmake or direct compile
GxB_JIT_ERROR_LOG = 7033, // CPU JIT: error log file
GxB_JIT_CMAKE = 7034, // CPU JIT: cmake / location

GxB_JIT_CUDA_PREFACE = 7100, // CUDA JIT C++ preface

Expand Down
20 changes: 20 additions & 0 deletions Demo/Program/wildadd.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
typedef struct
{
double stuff [4][4] ;
char whatstuff [64] ;
}
wildtype ; // C version of wildtype

void wildadd (wildtype *z, wildtype *x, wildtype *y)
{
for (int i = 0 ; i < 4 ; i++)
{
for (int j = 0 ; j < 4 ; j++)
{
z->stuff [i][j] = x->stuff [i][j] + y->stuff [i][j] ;
}
}
const char *psrc = "this was added" ;
char *pdst = z->whatstuff ;
while ((*pdst++ = *psrc++)) ;
}
Loading