bfs update
This commit is contained in:
@@ -131,6 +131,7 @@ void _clCmdParams(int argc, char* argv[]){
|
|||||||
// devices have no relationship with context
|
// devices have no relationship with context
|
||||||
void _clInit()
|
void _clInit()
|
||||||
{
|
{
|
||||||
|
printf("_clInit()\n");
|
||||||
int DEVICE_ID_INUSED = device_id_inused;
|
int DEVICE_ID_INUSED = device_id_inused;
|
||||||
cl_int resultCL;
|
cl_int resultCL;
|
||||||
|
|
||||||
@@ -225,15 +226,18 @@ void _clInit()
|
|||||||
throw(string("InitCL()::Creating Command Queue. (clCreateCommandQueue)"));
|
throw(string("InitCL()::Creating Command Queue. (clCreateCommandQueue)"));
|
||||||
//-----------------------------------------------
|
//-----------------------------------------------
|
||||||
//--cambine-5: Load CL file, build CL program object, create CL kernel object
|
//--cambine-5: Load CL file, build CL program object, create CL kernel object
|
||||||
std::string source_str = FileToString(kernel_file);
|
/*std::string source_str = FileToString(kernel_file);
|
||||||
const char * source = source_str.c_str();
|
const char * source = source_str.c_str();
|
||||||
size_t sourceSize[] = { source_str.length() };
|
size_t sourceSize[] = { source_str.length() };*/
|
||||||
|
|
||||||
oclHandles.program = clCreateProgramWithSource(oclHandles.context,
|
oclHandles.program =
|
||||||
|
clCreateProgramWithBuiltInKernels(oclHandles.context, 1, &oclHandles.devices[DEVICE_ID_INUSED], "BFS_1, BFS_2", &resultCL);
|
||||||
|
|
||||||
|
/*oclHandles.program = clCreateProgramWithSource(oclHandles.context,
|
||||||
1,
|
1,
|
||||||
&source,
|
&source,
|
||||||
sourceSize,
|
sourceSize,
|
||||||
&resultCL);
|
&resultCL);*/
|
||||||
|
|
||||||
if ((resultCL != CL_SUCCESS) || (oclHandles.program == NULL))
|
if ((resultCL != CL_SUCCESS) || (oclHandles.program == NULL))
|
||||||
throw(string("InitCL()::Error: Loading Binary into cl_program. (clCreateProgramWithBinary)"));
|
throw(string("InitCL()::Error: Loading Binary into cl_program. (clCreateProgramWithBinary)"));
|
||||||
|
|||||||
28677
benchmarks/opencl/bfs/graph4096.txt
Executable file
28677
benchmarks/opencl/bfs/graph4096.txt
Executable file
File diff suppressed because it is too large
Load Diff
@@ -189,7 +189,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char *h_graph_mask, *h_updating_graph_mask, *h_graph_visited;
|
char *h_graph_mask, *h_updating_graph_mask, *h_graph_visited;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char *input_f = "../data/bfs/graph1MW_6.txt";
|
char *input_f = "graph4096.txt";
|
||||||
printf("Reading File\n");
|
printf("Reading File\n");
|
||||||
// Read in Graph from a file
|
// Read in Graph from a file
|
||||||
fp = fopen(input_f, "r");
|
fp = fopen(input_f, "r");
|
||||||
@@ -198,6 +198,8 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("Reading File completed!\n");
|
||||||
|
|
||||||
int source = 0;
|
int source = 0;
|
||||||
|
|
||||||
fscanf(fp, "%d", &no_of_nodes);
|
fscanf(fp, "%d", &no_of_nodes);
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user