aboutsummaryrefslogtreecommitdiff
path: root/tests/all_cl.tests
blob: 8cefa431ed01b1606e3cd36ef717995419969f55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# All OpenCL tests that come with piglit, using default settings

import os
import os.path as path

from framework.core import *
from framework.exectest import *

######
# Helper functions

def add_plain_test(group, name, args):
	group[name] = PlainExecTest(args)

def add_concurrent_test(group, name, args):
	test = PlainExecTest(args)
	test.runConcurrent = true;
	group[name] = PlainExecTest(args)

def add_plain_program_tester_test(group, name, path):
	add_plain_test(group, name, ['cl-program-tester', path])

######
# Collecting all tests
profile = TestProfile()

custom = Group()
api = Group()
program = Group()
profile.tests['Custom'] = custom
profile.tests['API'] = api
profile.tests['Program'] = program

######
# Tests

# Custom
add_plain_test(custom, 'Run simple kernel', ['cl-custom-run-simple-kernel'])

# API
#  Platform
add_plain_test(api, 'clGetPlatformIDs', ['cl-api-get-platform-ids'])
add_plain_test(api, 'clGetPlatformInfo', ['cl-api-get-platform-info'])
#  Device
add_plain_test(api, 'clGetDeviceIDs', ['cl-api-get-device-ids'])
add_plain_test(api, 'clGetDeviceInfo', ['cl-api-get-device-info'])
#  Context
add_plain_test(api, 'clCreateContext', ['cl-api-create-context'])
add_plain_test(api, 'clCreateContextFromType', ['cl-api-create-context-from-type'])
add_plain_test(api, 'clGetContextInfo', ['cl-api-get-context-info'])
add_plain_test(api, 'clRetainContext and clReleaseContext', ['cl-api-retain_release-context'])
#  Command Queues
add_plain_test(api, 'clCreateCommandQueue', ['cl-api-create-command-queue'])
add_plain_test(api, 'clRetainComandQueue and clReleaseCommandQueue', ['cl-api-retain_release-command-queue'])
add_plain_test(api, 'clGetCommandQueueInfo', ['cl-api-get-command-queue-info'])
#  Memory objects
add_plain_test(api, 'clCreateBuffer', ['cl-api-create-buffer'])
add_plain_test(api, 'clEnqueueReadBuffer and clEnqueueWriteBuffer', ['cl-api-enqueue-read_write-buffer'])
add_plain_test(api, 'clGetMemObjectInfo', ['cl-api-get-mem-object-info'])
add_plain_test(api, 'clGetImageInfo', ['cl-api-get-image-info'])
add_plain_test(api, 'clRetainMemObject and clReleaseMemObject', ['cl-api-retain_release-mem-object'])
#  Program
add_plain_test(api, 'clCreateProgramWithSource', ['cl-api-create-program-with-source'])
add_plain_test(api, 'clBuildProgram', ['cl-api-build-program'])
add_plain_test(api, 'clCreateKernelsInProgram', ['cl-api-create-kernels-in-program'])
add_plain_test(api, 'clGetProgramInfo', ['cl-api-get-program-info'])
add_plain_test(api, 'clGetProgramBuildInfo', ['cl-api-get-program-build-info'])
add_plain_test(api, 'clRetainProgram and clReleaseProgram', ['cl-api-retain_release-program'])
add_plain_test(api, 'clUnloadCompiler', ['cl-api-unload-compiler'])
#  Kernel
add_plain_test(api, 'clCreateKernel', ['cl-api-create-kernel'])
add_plain_test(api, 'clCreateKernelsInProgram', ['cl-api-create-kernels-in-program'])
add_plain_test(api, 'clGetKernelInfo', ['cl-api-get-kernel-info'])
add_plain_test(api, 'clGetKernelWorkGroupInfo', ['cl-api-get-kernel-work-group-info'])
add_plain_test(api, 'clRetainKernel and clReleaseKernel', ['cl-api-retain_release-kernel'])
add_plain_test(api, 'clSetKernelArg', ['cl-api-set-kernel-arg'])
#  Event
add_plain_test(api, 'clGetEventInfo', ['cl-api-get-event-info'])
add_plain_test(api, 'clRetainEvent and clReleaseEvent', ['cl-api-retain_release-event'])

# Program
add_plain_test(program, 'Run kernel with max work item sizes', ['cl-program-max-work-item-sizes'])

# Program tester

def add_program_test_dir(group, dirpath):
	for filename in os.listdir(dirpath):
		filepath = path.join(dirpath, filename)
		ext = filename.rsplit('.')[-1]
		if ext != 'cl' and ext != 'program_test':
			continue
		testname = filename[0:-(len(ext) + 1)]
		add_plain_program_tester_test(group, testname, filepath)

program_build = Group()
program_build_fail = Group()
program_execute = Group()
program["Build"] = program_build
program["Build"]["Fail"] = program_build_fail
program["Execute"] = program_execute

add_program_test_dir(program_build, 'tests/cl/program/build')
add_program_test_dir(program_build_fail, 'tests/cl/program/build/fail')
add_program_test_dir(program_execute, 'tests/cl/program/execute')

#Run generated built-in tests
program_execute_builtin = Group()
program["Execute"]["Builtin"] = program_execute_builtin
add_program_test_dir(program_execute_builtin, 'generated_tests/cl/builtin/int')