40 using namespace nvbio;
42 int main(
int argc,
char* argv[])
44 cudaSetDeviceFlags( cudaDeviceMapHost );
50 log_info(stderr,
"nvSSA [-gpu] input-prefix [output-prefix]\n");
57 if (strcmp( argv[1],
"-gpu" ) == 0)
62 input = argv[base_arg];
63 if (argc == base_arg+2)
64 output = argv[base_arg+1];
66 output = argv[base_arg];
72 if (!driver_data.
load( input ))
77 if (strcmp( argv[1],
"-gpu" ) == 0)
85 init_ssa( driver_data_cuda, ssa_cuda, rssa_cuda );
96 log_info(stderr,
"saving SSA... started\n");
98 std::string file_name = std::string( output ) + std::string(
".sa");
99 FILE* file = fopen( file_name.c_str(),
"wb" );
102 fwrite( &driver_data.
m_L2+1,
sizeof(
uint32), 4u, file );
103 fwrite( &sa_intv,
sizeof(
uint32), 1u, file );
105 fwrite( &ssa.
m_ssa[1],
sizeof(
uint32), ssa_len-1, file );
109 std::string file_name = std::string( output ) + std::string(
".rsa");
110 FILE* file = fopen( file_name.c_str(),
"wb" );
113 fwrite( &driver_data.
m_L2+1,
sizeof(
uint32), 4u, file );
114 fwrite( &sa_intv,
sizeof(
uint32), 1u, file );
116 fwrite( &rssa.
m_ssa[1],
sizeof(
uint32), ssa_len-1, file );
119 log_info(stderr,
"saving SSA... done\n");