Package org.trifort.rootbeer.runtime

Examples of org.trifort.rootbeer.runtime.Kernel


    long[] longArray2 = new long[1];
    float[] floatArray2 = new float[1];
   
    List<Kernel> ret = new ArrayList<Kernel>();
    for(int i = 0; i < 10; ++i){
      Kernel kernel = new AtomicGlobalsRunOnGpu(intArray, longArray, floatArray,
          intArray2, longArray2, floatArray2);
      ret.add(kernel);
    }
    return ret;
  }
View Full Code Here


  public List<Kernel> create() {
    SimpleSynchronizedObject sync_obj = new SimpleSynchronizedObject();
    List<Kernel> ret = new ArrayList<Kernel>();
    for(int i = 0; i < 20; ++i){
      Kernel kernel = new SimpleSynchronizedRunOnGpu(sync_obj);
      ret.add(kernel);
    }
    return ret;
  }
View Full Code Here

    m_blockSize = 1024;
    m_gridSize = 1024;
  }

  public Kernel create() {
    Kernel ret = new EmptyKernel();
    return ret;
  }
View Full Code Here

    }

    for(int i = 0; i < b.length; ++i){
      b[i] = i;
    }
    Kernel ret = new MatrixKernel(a, b, c, m_blockSize, m_gridSize);
    return ret;
  }
View Full Code Here

      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;
          m_passed = false;
          return;
        }
View Full Code Here

  private void test(TestKernelTemplate creator, boolean print_mem) {
    int i = 0;
    try {     
      Rootbeer rootbeer = new Rootbeer();
      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();
View Full Code Here

        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;
            m_passed = false;
            return;
          }
View Full Code Here

  public List<Kernel> create() {
    List<Kernel> ret = new ArrayList<Kernel>();
    AtomicLong along = new AtomicLong();
    for(int i = 0; i < 5; ++i){
      Kernel kernel = new WhileTrueRunOnGpu(along, i);
      ret.add(kernel);
    }
    return ret;
  }
View Full Code Here

TOP

Related Classes of org.trifort.rootbeer.runtime.Kernel

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.