예제 #1
0
int main(int argc, char **argv) try 
{
  embree::main(argc, argv);

  // Functions enqueued on the sink side will not start executing until
  // you call COIPipelineStartExecutingRunFunctions(). This call is to
  // synchronize any initialization required on the sink side
  COIRESULT result = COIPipelineStartExecutingRunFunctions();
  if (result != COI_SUCCESS) 
    throw std::runtime_error("COIPipelineStartExecutingRunFunctions failed: "+std::string(COIResultGetName(result)));
  
  // This call will wait until COIProcessDestroy() gets called on the source
  // side. If COIProcessDestroy is called without force flag set, this call
  // will make sure all the functions enqueued are executed and does all
  // clean up required to exit gracefully.
  COIProcessWaitForShutdown();
  return 0;
  
 } catch (const std::exception &e) {
  std::cout << "main(): Error: " << e.what() << std::endl;
  return(1);

 } catch (...) {
  std::cout << "main(): Error: unknown exception caught." << std::endl;
  return(1);
 }
예제 #2
0
int main(int argc, char **argv){
  UNUSED_ATTR COIRESULT started = COIPipelineStartExecutingRunFunctions();

  if(started != COI_SUCCESS){
    printf("COI Kernel failed upon launch.\n");
    return 0;
  }

  COIProcessWaitForShutdown();

  return 0;
}
예제 #3
0
int main(int argc, char** argv)
{
    UNUSED_ATTR COIRESULT result;
    UNREFERENCED_PARAM (argc);
    UNREFERENCED_PARAM (argv);

    /* enable wait to attach with debugger */
#if 0
    std::cout << "waiting for debugger to attach ..." << std::flush;
#if 0
    volatile int loop = 1;
    do {
        volatile int a = 1;
    } while (loop);

#else
    for (int i=0; i<20; i++) {
        sleep(1);
        std::cout << "." << std::flush;
    }
#endif
    std::cout << " [DONE]" << std::endl;
#endif

    // Functions enqueued on the sink side will not start executing until
    // you call COIPipelineStartExecutingRunFunctions(). This call is to
    // synchronize any initialization required on the sink side
    result = COIPipelineStartExecutingRunFunctions();
    assert(result == COI_SUCCESS);

    // This call will wait until COIProcessDestroy() gets called on the source
    // side. If COIProcessDestroy is called without force flag set, this call
    // will make sure all the functions enqueued are executed and does all
    // clean up required to exit gracefully.
    COIProcessWaitForShutdown();
    return 0;
}