Package org.trifort.rootbeer.runtime

Examples of org.trifort.rootbeer.runtime.Context


      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());
View Full Code Here


    }

    Rootbeer rootbeer = new Rootbeer();
    List<GpuDevice> devices = rootbeer.getDevices();
    GpuDevice device0 = devices.get(0);
    Context context0 = device0.createContext(4212880);
    context0.setCacheConfig(CacheConfig.PREFER_SHARED);
    context0.setThreadConfig(sizeBy2, outerCount, outerCount * sizeBy2);
    context0.setKernel(new GPUSortKernel(array));
    context0.buildState();

    while(true){
      for(int i = 0; i < outerCount; ++i){
        fisherYates(array[i]);
      }
      long gpuStart = System.currentTimeMillis();
      context0.run();
      long gpuStop = System.currentTimeMillis();
      long gpuTime = gpuStop - gpuStart;

      StatsRow row0 = context0.getStats();
      System.out.println("serialization_time: "+row0.getSerializationTime());
      System.out.println("driver_memcopy_to_device_time: "+row0.getDriverMemcopyToDeviceTime());
      System.out.println("driver_execution_time: "+row0.getDriverExecTime());
      System.out.println("driver_memcopy_from_device_time: "+row0.getDriverMemcopyFromDeviceTime());
      System.out.println("total_driver_execution_time: "+row0.getTotalDriverExecutionTime());
      System.out.println("deserialization_time: "+row0.getDeserializationTime());
      System.out.println("gpu_required_memory: "+context0.getRequiredMemory());
      System.out.println("gpu_time: "+gpuTime);

      for(int i = 0; i < outerCount; ++i){
        checkSorted(array[i], i);
        fisherYates(array[i]);
View Full Code Here

TOP

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

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.