|
6 | 6 |
|
7 | 7 | class Backend(ABC): |
8 | 8 | """Base class for kernel_tuner backends""" |
| 9 | + |
9 | 10 | @abstractmethod |
10 | 11 | def ready_argument_list(self, arguments): |
11 | | - """ This method must implement the allocation of the arguments on device memory. """ |
| 12 | + """This method must implement the allocation of the arguments on device memory.""" |
12 | 13 | pass |
13 | 14 |
|
14 | 15 | @abstractmethod |
15 | 16 | def compile(self, kernel_instance): |
16 | | - """ This method must implement the compilation of a kernel into a callable function. """ |
| 17 | + """This method must implement the compilation of a kernel into a callable function.""" |
17 | 18 | pass |
18 | 19 |
|
19 | 20 | @abstractmethod |
20 | 21 | def start_event(self): |
21 | | - """ This method must implement the recording of the start of a measurement. """ |
| 22 | + """This method must implement the recording of the start of a measurement.""" |
22 | 23 | pass |
23 | 24 |
|
24 | 25 | @abstractmethod |
25 | 26 | def stop_event(self): |
26 | | - """ This method must implement the recording of the end of a measurement. """ |
| 27 | + """This method must implement the recording of the end of a measurement.""" |
27 | 28 | pass |
28 | 29 |
|
29 | 30 | @abstractmethod |
30 | 31 | def kernel_finished(self): |
31 | | - """ This method must implement a check that returns True if the kernel has finished, False otherwise. """ |
| 32 | + """This method must implement a check that returns True if the kernel has finished, False otherwise.""" |
32 | 33 | pass |
33 | 34 |
|
34 | 35 | @abstractmethod |
35 | 36 | def synchronize(self): |
36 | | - """ This method must implement a barrier that halts execution until device has finished its tasks. """ |
| 37 | + """This method must implement a barrier that halts execution until device has finished its tasks.""" |
37 | 38 | pass |
38 | 39 |
|
39 | 40 | @abstractmethod |
40 | 41 | def run_kernel(self, func, gpu_args, threads, grid, stream): |
41 | | - """ This method must implement the execution of the kernel on the device. """ |
| 42 | + """This method must implement the execution of the kernel on the device.""" |
42 | 43 | pass |
43 | 44 |
|
44 | 45 | @abstractmethod |
45 | 46 | def memset(self, allocation, value, size): |
46 | | - """ This method must implement setting the memory to a value on the device. """ |
| 47 | + """This method must implement setting the memory to a value on the device.""" |
47 | 48 | pass |
48 | 49 |
|
49 | 50 | @abstractmethod |
50 | 51 | def memcpy_dtoh(self, dest, src): |
51 | | - """ This method must implement a device to host copy. """ |
| 52 | + """This method must implement a device to host copy.""" |
52 | 53 | pass |
53 | 54 |
|
54 | 55 | @abstractmethod |
55 | 56 | def memcpy_htod(self, dest, src): |
56 | | - """ This method must implement a host to device copy. """ |
| 57 | + """This method must implement a host to device copy.""" |
57 | 58 | pass |
58 | 59 |
|
59 | 60 |
|
60 | 61 | class GPUBackend(Backend): |
61 | 62 | """Base class for GPU backends""" |
| 63 | + |
62 | 64 | @abstractmethod |
63 | 65 | def __init__(self, device, iterations, compiler_options, observers): |
64 | 66 | pass |
65 | 67 |
|
66 | 68 | @abstractmethod |
67 | 69 | def copy_constant_memory_args(self, cmem_args): |
68 | | - """ This method must implement the allocation and copy of constant memory to the GPU. """ |
| 70 | + """This method must implement the allocation and copy of constant memory to the GPU.""" |
69 | 71 | pass |
70 | 72 |
|
71 | 73 | @abstractmethod |
72 | 74 | def copy_shared_memory_args(self, smem_args): |
73 | | - """ This method must implement the dynamic allocation of shared memory on the GPU. """ |
| 75 | + """This method must implement the dynamic allocation of shared memory on the GPU.""" |
74 | 76 | pass |
75 | 77 |
|
76 | 78 | @abstractmethod |
77 | 79 | def copy_texture_memory_args(self, texmem_args): |
78 | | - """ This method must implement the allocation and copy of texture memory to the GPU. """ |
| 80 | + """This method must implement the allocation and copy of texture memory to the GPU.""" |
79 | 81 | pass |
80 | 82 |
|
81 | 83 |
|
82 | 84 | class CompilerBackend(Backend): |
83 | 85 | """Base class for compiler backends""" |
| 86 | + |
84 | 87 | @abstractmethod |
85 | 88 | def __init__(self, iterations, compiler_options, compiler): |
86 | 89 | pass |
0 commit comments