Example #1
0
    def test_benchmark(self):
        benchmark = parboil.Benchmark("spmv")

        # scenario = Scenario.get_id()
        self.assertEqual(config.parboil_root(), benchmark.parboil_root)
        self.assertEqual("spmv", benchmark.id)
        self.assertTrue(len(benchmark.datasets))
Example #2
0
    def __init__(self, benchmark_id):
        parboil_root = config.parboil_root()

        # Check that benchmark exists
        if not os.path.exists(os.path.join(parboil_root, 'benchmarks',
                                           benchmark_id)):
            raise BenchmarkException("Parboil benchmark '{}' not found"
                                     .format(benchmark_id))

        # Check that opencl_base or equivalent exists
        implementation = 'opencl_base'
        if not os.path.exists(os.path.join(
                parboil_root, 'benchmarks', benchmark_id, 'src',
                implementation)):
            raise BenchmarkException("Parboil implementation '{}' not found"
                                     .format(implementation))

        src_file = ImplementationFile.from_benchmark(parboil_root,
                                                     benchmark_id)

        # Get datasets
        datasets_path = os.path.join(parboil_root, 'datasets', benchmark_id)
        datasets = [Dataset(x) for x in os.listdir(datasets_path)]

        # Get OpenCL kernel
        oracle_kernel_path = os.path.join(parboil_root, 'benchmarks',
                                          benchmark_id, 'src', implementation,
                                          'kernel.cl')
        if not os.path.exists(oracle_kernel_path):
            raise BenchmarkException("Parboil OpenCL kernel '{}' not found"
                                     .format(oracle_kernel_path))

        # Set member variables
        self.parboil_root = parboil_root
        self.id = benchmark_id
        self.implementation = implementation
        self.datasets = datasets
        self.oracle_kernel_path = oracle_kernel_path
        self.src_file = src_file
Example #3
0
 def test_verify_parboil(self):
     self.assertTrue(config.parboil_root())