Changes between Version 13 and Version 14 of AppCoprocessor
- Timestamp:
- Mar 20, 2008, 9:26:21 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AppCoprocessor
v13 v14 20 20 21 21 Suppose you've developed a coprocessor program, 22 that it uses a CUDA GPU and 1 GFLOPS of the CPU. 22 that it uses a CUDA GPU and 1 GFLOPS of the CPU, 23 and produces a total of 100 GFLOPS. 23 24 To deploy it: 24 25 … … 27 28 * Link the following function into your scheduler: 28 29 {{{ 29 bool app_plan( HOST& host, const char* plan_class, HOST_USAGE& hu) {30 bool app_plan(SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu) { 30 31 if (strcmp(plan_class, "cuda_1.1") != 0) { 31 32 return false; 32 33 } 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]; 35 36 if (cp.type == COPROC_CUDA) { 36 37 COPROC_USAGE cu; … … 40 41 double x = 1e9/host.p_fpops; 41 42 if (x > 1) x = 1; 42 hu.ncpus = x; 43 hu.avg_ncpus = x; 44 hu.max_ncpus = x; 43 45 hu.fpops = 5e11; 44 46 return true;