Changes between Version 45 and Version 46 of AppCoprocessor


Ignore:
Timestamp:
Jul 30, 2014, 2:35:58 PM (10 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppCoprocessor

    v45 v46  
    3636Call '''boinc_get_init_data()''' to get an APP_INIT_DATA structure;
    3737the device number (0, 1, ...) is in the '''gpu_device_num''' field.
    38 
    3938Old (pre-7.0.12) clients pass the device number via a command-line argument, '''--device N'''.
    4039In this case API_INIT_DATA::gpu_device_num will be -1,
    4140and your application must check its command-line args.
     41So to be compatible with all clients, your app should do something like
     42{{{
     43int device_num;
     44APP_INIT_DATA aid;
     45boinc_get_init_data(aid);
     46if (aid.gpu_device_num >= 0) {
     47   device_num = aid.gpu_device_num;
     48} else {
     49   device_num = (scan argc/argv for --device argument);
     50}
     51}}}
    4252
    43 OpenCL apps should use
     53OpenCL apps don't need this; instead, use
    4454the '''boinc_get_opencl_ids()''' API as described
    4555[http://boinc.berkeley.edu/trac/wiki/OpenclApps here].