Changes between Version 13 and Version 14 of AppCoprocessor


Ignore:
Timestamp:
Mar 20, 2008, 9:26:21 PM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppCoprocessor

    v13 v14  
    2020
    2121Suppose you've developed a coprocessor program,
    22 that it uses a CUDA GPU and 1 GFLOPS of the CPU.
     22that it uses a CUDA GPU and 1 GFLOPS of the CPU,
     23and produces a total of 100 GFLOPS.
    2324To deploy it:
    2425
     
    2728 * Link the following function into your scheduler:
    2829{{{
    29 bool app_plan(HOST& host, const char* plan_class, HOST_USAGE& hu) {
     30bool app_plan(SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu) {
    3031    if (strcmp(plan_class, "cuda_1.1") != 0) {
    3132        return false;
    3233    }
    33     for (i=0; i<host.coprocs.size(); i++) {
    34         COPROC cp = host.coprocs[i];
     34    for (i=0; i<sreq.coprocs.size(); i++) {
     35        COPROC cp = sreq.coprocs[i];
    3536        if (cp.type == COPROC_CUDA) {
    3637            COPROC_USAGE cu;
     
    4041            double x = 1e9/host.p_fpops;
    4142            if (x > 1) x = 1;
    42             hu.ncpus = x;
     43            hu.avg_ncpus = x;
     44            hu.max_ncpus = x;
    4345            hu.fpops = 5e11;
    4446            return true;