Changes between Version 14 and Version 15 of AppCoprocessor


Ignore:
Timestamp:
Apr 1, 2008, 3:36:40 PM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppCoprocessor

    v14 v15  
    11= Applications that use coprocessors =
    2 
    3 [[T(DesignDocument)]]
    42
    53This document describes BOINC's support for applications that use coprocessors such as
     
    2927{{{
    3028bool app_plan(SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu) {
    31     if (strcmp(plan_class, "cuda_1.1") != 0) {
     29    // clients before 6.1.11 don't understand plan_class
     30    //
     31    int v = sreq.core_client_major_version*10000
     32        + sreq.core_client_minor_version*100
     33        + sreq.core_client_release;
     34    if (v < 60111) return false;
     35
     36    if (!strcmp(plan_class, "cuda_1.1")) {
     37         // the following is for an app that uses a CUDA GPU
     38        // and some CPU also, and gets 50 GFLOPS total
     39        //
     40        for (unsigned int i=0; i<sreq.coprocs.coprocs.size(); i++) {
     41            COPROC* cp = sreq.coprocs.coprocs[i];
     42            if (!strcmp(cp->name, "CUDA")) {
     43                COPROC* cu = new COPROC;
     44                strcpy(cu->name, cp->name);
     45                cu->count = 1;
     46                hu.coprocs.coprocs.push_back(cu);
     47                double x = 1e9/sreq.host.p_fpops;
     48                if (x > 1) x = 1;
     49                hu.avg_ncpus = x;
     50                hu.max_ncpus = x;
     51                hu.flops = 5e11;
     52                return true;
     53            }
     54        }
    3255        return false;
    33     }
    34     for (i=0; i<sreq.coprocs.size(); i++) {
    35         COPROC cp = sreq.coprocs[i];
    36         if (cp.type == COPROC_CUDA) {
    37             COPROC_USAGE cu;
    38             strcpy(cu.name, cp.name);
    39             cu.count = 1;
    40             hu.coprocs.push_back(cu);
    41             double x = 1e9/host.p_fpops;
    42             if (x > 1) x = 1;
    43             hu.avg_ncpus = x;
    44             hu.max_ncpus = x;
    45             hu.fpops = 5e11;
    46             return true;
    47         }
    4856    }
    4957    return false;