GraphBLAS
GraphBLAS copied to clipboard
no JIT kernels produced?
i compiled like so: make static -j CMAKE_OPTIONS='-DCOMPACT=1'
got the ~11.8 MB static library file
root@clr-b5df9984821e4d129387e172044f5754~/xxx/libraries/lib # stat libgraphblas.a
File: libgraphblas.a
Size: 11829168 Blocks: 23104 IO Block: 4096 regular file
compiled and ran the below code:
g++ -O3 -I/root/xxx/libraries/include /root/xxx/test/factoryKernelExtractor.cpp -L/root/xxx/libraries/lib -Wl,-Bstatic -lgraphblas -lgomp -Wl,-Bdynamic -o factoryKernelExtractor.test
rm -rf GB_JIT_Cache && ./factoryKernelExtractor.test
#include <stdlib.h>
#include <random>
extern "C" {
#include <GraphBLAS/GraphBLAS.h>
}
static void test1()
{
GrB_Info result;
uint32_t dimension = 1'000;
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> dis(0, dimension);
GrB_Matrix A;
GrB_Matrix_new(&A, GrB_UINT8, dimension, dimension);
GxB_Matrix_Option_set(A, GxB_HYPER_SWITCH, GxB_ALWAYS_HYPER);
for (uint32_t index = 0; index < 5'000; index++)
{
uint32_t randomRow = dis(gen);
uint32_t randomColumn = dis(gen);
GrB_Matrix_setElement_UINT8(A, uint8_t(1), randomRow, randomColumn);
}
GrB_Descriptor invertMaskAndTransposeMatrixFirstThenReplaceOutput;
GrB_Descriptor_new(&invertMaskAndTransposeMatrixFirstThenReplaceOutput);
GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_MASK, GrB_COMP); // invert the mask
GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_INP0, GrB_TRAN);
GrB_Descriptor_set(invertMaskAndTransposeMatrixFirstThenReplaceOutput, GrB_OUTP, GrB_REPLACE);
GrB_Vector mask;
GrB_Vector_new(&mask, GrB_UINT8, dimension); // column vector
for (uint32_t index = 0; index < 70; index++)
{
uint32_t randomRow = dis(gen);
GrB_Vector_setElement_UINT8(mask, uint8_t(1), randomRow);
}
GrB_Vector input;
GrB_Vector_new(&input, GrB_UINT8, dimension);
for (uint32_t index = 0; index < 150; index++)
{
uint32_t randomRow = dis(gen);
GrB_Vector_setElement_UINT8(input, uint8_t(1), randomRow);
}
GrB_Vector output;
GrB_Vector_new(&output, GrB_UINT8, dimension);
result = GrB_mxv(output, mask, GrB_NULL, GxB_LOR_LAND_BOOL, A, input, invertMaskAndTransposeMatrixFirstThenReplaceOutput);
}
int main()
{
setenv("GxB_JIT_ERROR_LOG", "/root/GB_JIT.error", 1);
setenv("GRAPHBLAS_CACHE_PATH", "/root/GB_JIT_Cache", 1);
GrB_init(GrB_NONBLOCKING);
test1();
return 0;
}
GrB_mxv returned GrB_Sucess. no error output. the directory structure was created in GB_JIT_Cache... but no files outputted into /c or libraries created. weird? clearly i'm missing something.