opencl 库崩溃

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

opencl 库崩溃

640 Views
chenghaibo
Contributor III

int

main(int argc, char **argv)

{

  cl_device_id        device;

  cl_context          context;

  cl_command_queue    queue;

  int                 err;

  cl_device_type      device_type = CL_DEVICE_TYPE_GPU;

  cl_uint numPlatforms = 0;

  cl_uint devices = 1;

  cl_platform_id platforms;

  // Now, obtains a list of numPlatforms OpenCL platforms available

  // The list of platforms available will be returned in platforms

  clGetPlatformIDs(1, &platforms, &devices);

  err = clGetDeviceIDs(platforms, device_type, 1, &device, &devices);    //这一行碰到了崩溃

  if (err != CL_SUCCESS) {

  printf("clGetDeviceIDs() failed. (%d)\n", err);

  return EXIT_FAILURE;

  }

......
}

Program received signal SIGSEGV, Segmentation fault.

0x76538200 in gcoHAL_QuerySeparated2D (Hal=Hal@entry=0x0) at gc_hal_user_query.c:1036

1036    gc_hal_user_query.c: No such file or directory.

(gdb) in gcoHAL_QuerySeparated2D (Hal=Hal@entry=0x0) at gc_hal_user_query.c:1036

Ambiguous command "in gcoHAL_QuerySeparated2D (Hal=Hal@entry=0x0) at gc_hal_user_query.c:1036": inf, inferior, info, init-if-undefined, inspect, internals, interpreter-exec, interrupt.

(gdb) 1036    gc_hal_user_query.c: No such file or directory.

0 Kudos
0 Replies