Package org.trifort.rootbeer.runtime.util

Examples of org.trifort.rootbeer.runtime.util.Stopwatch


    usingHandles = false;
    nativeContext = allocateNativeContext();
    cacheConfig = CacheConfig.PREFER_NONE;
   
    stats = new StatsRow();
    writeBlocksStopwatch = new Stopwatch();
    runStopwatch = new Stopwatch();
    runOnGpuStopwatch = new Stopwatch();
    readBlocksStopwatch = new Stopwatch();
  }
View Full Code Here


        a[x*size+y] = x*size+y;
        b[x*size+y] = x*size+y;
      }
    }

    Stopwatch watch = new Stopwatch();
    watch.start();
    app.multMatrices(a, b, c_gpu, size);
    watch.stop();
    System.out.println("gpu time: "+watch.elapsedTimeMillis());

    watch = new Stopwatch();
    watch.start();
    app.cpuMultMatrices(a, b, c_cpu, size);
    watch.stop();
    System.out.println("cpu time: "+watch.elapsedTimeMillis());
  }
View Full Code Here

    try {     
      Rootbeer rootbeer = new Rootbeer();
      Configuration.setPrintMem(print_mem);
      List<Kernel> known_good_items = creator.create();
      List<Kernel> testing_items = creator.create();
      Stopwatch watch = new Stopwatch();
      watch.start();
      rootbeer.run(testing_items);
      m_passed = true;
      watch.stop();
      m_gpuTime = watch.elapsedTimeMillis();
      watch.start();
      for(i = 0; i < known_good_items.size(); ++i){      
        Kernel known_good_item = known_good_items.get(i);
        known_good_item.gpuMethod();
      }
      watch.stop();
      m_cpuTime = watch.elapsedTimeMillis();
      for(i = 0; i < known_good_items.size(); ++i){
        Kernel known_good_item = known_good_items.get(i);
        Kernel testing_item = testing_items.get(i);
        if(!creator.compare(known_good_item, testing_item)){
          m_message = "Compare failed at: "+i;
View Full Code Here

      Configuration.setPrintMem(print_mem);
      Kernel known_good_item = creator.create();
      Kernel testing_item = creator.create();
      ThreadConfig thread_config = creator.getThreadConfig();

      Stopwatch watch = new Stopwatch();
      watch.start();
      Context context = rootbeer.createDefaultContext();
      context.setKernel(testing_item);
      context.setThreadConfig(thread_config);
      context.buildState();
      context.run();
      context.close();
      m_passed = true;
      watch.stop();
      m_gpuTime = watch.elapsedTimeMillis();
      watch.start();
      RootbeerGpu.setBlockDimx(thread_config.getThreadCountX());
      RootbeerGpu.setBlockDimy(thread_config.getThreadCountY());
      RootbeerGpu.setBlockDimz(thread_config.getThreadCountZ());
      RootbeerGpu.setGridDimx(thread_config.getBlockCountX());
      RootbeerGpu.setGridDimy(thread_config.getBlockCountY());
     
      for(int blockx = 0; blockx < thread_config.getBlockCountX(); ++blockx){
        RootbeerGpu.setBlockIdxx(blockx);
        for(int blocky = 0; blocky < thread_config.getBlockCountY(); ++blocky){
          RootbeerGpu.setBlockIdxy(blocky);
          for(int threadx = 0; threadx < thread_config.getThreadCountX(); ++threadx){
            RootbeerGpu.setThreadIdxx(threadx);
            for(int thready = 0; thready < thread_config.getThreadCountY(); ++thready){
              RootbeerGpu.setThreadIdxy(thready);
              for(int threadz = 0; threadz < thread_config.getThreadCountZ(); ++threadz){
                RootbeerGpu.setThreadIdxz(threadz);
                known_good_item.gpuMethod();
              }
            }
          }
        }
      }
      watch.stop();
      m_cpuTime = watch.elapsedTimeMillis();
      if(!creator.compare(known_good_item, testing_item)){
        m_message = "Compare failed at: "+i;
        m_passed = false;
        return;
      }
View Full Code Here

      int i = 0;
      try {     
        Configuration.setPrintMem(m_printMem);
        List<Kernel> known_good_items = m_creator.create();
        List<Kernel> testing_items = m_creator.create();
        Stopwatch watch = new Stopwatch();
        watch.start();
        m_rootbeer.run(testing_items);
        m_passed = true;
        watch.stop();
        m_gpuTime = watch.elapsedTimeMillis();
        watch.start();
        for(i = 0; i < known_good_items.size(); ++i){      
          Kernel known_good_item = known_good_items.get(i);
          known_good_item.gpuMethod();
        }
        watch.stop();
        m_cpuTime = watch.elapsedTimeMillis();
        for(i = 0; i < known_good_items.size(); ++i){
          Kernel known_good_item = known_good_items.get(i);
          Kernel testing_item = testing_items.get(i);
          if(!m_creator.compare(known_good_item, testing_item)){
            m_message = "Compare failed at: "+i;
View Full Code Here

  private Stopwatch m_cpuWatch;
  private Stopwatch m_gpuWatch;
  private Stopwatch m_transposeWatch;

  public MatrixApp(){
    m_cpuWatch = new Stopwatch();
    m_gpuWatch = new Stopwatch();
    m_transposeWatch = new Stopwatch();
  }
View Full Code Here

TOP

Related Classes of org.trifort.rootbeer.runtime.util.Stopwatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.